<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - "Failed to execute operation: File exists" when enabling a service that is already enabled via symlink to /lib (rather than /usr/lib)"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=90277">90277</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>"Failed to execute operation: File exists" when enabling a service that is already enabled via symlink to /lib (rather than /usr/lib)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>systemd
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>minor
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>adamw@happyassassin.net
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Saw this on 'dnf update' on Fedora 22 today:

Failed to execute operation: File exists
warning: %triggerun(rpcbind-0.2.3-0.0.fc22.x86_64) scriptlet failed, exit
status 1
Non-fatal <unknown> scriptlet failure in rpm package rpcbind

This is caused by:

%triggerun -- rpcbind > 0.2.2-2.0
/bin/systemctl enable rpcbind.socket

I can reproduce it by running the command manually:

[adamw@adam rpcbind (f22)]$ sudo systemctl enable rpcbind.socket
Failed to execute operation: File exists

However, some others said they couldn't. Eventually I figured out the
difference. Services are 'enabled' via symlinks in special directories. Note
where the symlink for rpcbind.socket points on my system:

[root@adam system]# ls -l
/etc/systemd/system/sockets.target.wants/rpcbind.socket 
lrwxrwxrwx. 1 root root 34 Sep 13  2011
/etc/systemd/system/sockets.target.wants/rpcbind.socket ->
/lib/systemd/system/rpcbind.socket

the target is in /lib, not /usr/lib - because this is an old install that has
been updated all the way to F22, rpcbind.socket was originally enabled before
the /usr move. If I disable and re-enable the service manually, the symlink
target is updated to /usr/lib:

[root@adam system]# systemctl disable rpcbind.socket
Removed symlink /etc/systemd/system/sockets.target.wants/rpcbind.socket.
[root@adam system]# systemctl enable rpcbind.socket
Created symlink from /etc/systemd/system/sockets.target.wants/rpcbind.socket to
/usr/lib/systemd/system/rpcbind.socket.
[root@adam system]# ls -l
/etc/systemd/system/sockets.target.wants/rpcbind.socket
lrwxrwxrwx. 1 root root 38 May  1 12:07
/etc/systemd/system/sockets.target.wants/rpcbind.socket ->
/usr/lib/systemd/system/rpcbind.socket

and now the bug doesn't happen any more:

[root@adam system]# systemctl enable rpcbind.socket
[root@adam system]# 

Still, this could be an annoyance to users who have older installs, if it can
be fixed somehow that'd be good.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>