title: Resolve systemd alias (service name)
body: <p>Systemd supports aliases. For example "httpd.service"</p>
  
  <pre><code>ls -l /etc/systemd/system/httpd.service
    /etc/systemd/system/httpd.service -&gt; /usr/lib/systemd/system/apache2.service
  </code></pre>
  
  <p>Content of this file:</p>
  
  <pre><code>[Unit]
  Description=The Apache Webserver
  ...
  [Install]
  WantedBy=multi-user.target
  Alias=httpd.service apache.service
  </code></pre>
  
  <p>I would like to resolve the alias in a script.</p>
  
  <p>Example:</p>
  
  <p>If the input is "httpd.service", then the output should be "apache2.service"</p>
  
  <p>I can use shell or python for this script.</p>
  
  <p>How to do this the systemd-way?</p>
  
  <p>Reading the symlink might work, but I guess there is a more official way to resolve the alias.</p>