diff options
Diffstat (limited to 'add-service')
-rwxr-xr-x | add-service | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/add-service b/add-service index bd16c8f..755403a 100755 --- a/add-service +++ b/add-service @@ -43,9 +43,9 @@ units_to_enable= # units enabled by msec systemd_migration_dir=/var/lib/rpm-helper/systemd-migration mkdir -p "${systemd_migration_dir}" -SYSTEMUNITDIR=/lib/systemd/system USERUNITDIR=/etc/systemd/system RUNTIMEUNITDIR=/run/systemd/system +SYSTEMUNITDIR=/lib/systemd/system find_unit() { unit=$(basename $1) @@ -56,13 +56,7 @@ find_unit() { # and disabling units we must use the official name. searchunit= - if [ -f "$SYSTEMUNITDIR/$unit" ]; then - if [ -L "$SYSTEMUNITDIR/$unit" ]; then - searchunit=$(/usr/bin/readlink "$SYSTEMUNITDIR/$unit") - else - searchunit="$SYSTEMUNITDIR/$unit" - fi - elif [ -f "$USERUNITDIR/$unit" ]; then + if [ -f "$USERUNITDIR/$unit" ]; then if [ -L "$USERUNITDIR/$unit" ]; then searchunit=$(/usr/bin/readlink "$USERUNITDIR/$unit") else @@ -74,6 +68,12 @@ find_unit() { else searchunit="$RUNTIMEUNITDIR/$unit" fi + elif [ -f "$SYSTEMUNITDIR/$unit" ]; then + if [ -L "$SYSTEMUNITDIR/$unit" ]; then + searchunit=$(/usr/bin/readlink "$SYSTEMUNITDIR/$unit") + else + searchunit="$SYSTEMUNITDIR/$unit" + fi fi if [ -n "$searchunit" ]; then echo -n $searchunit |