aboutsummaryrefslogtreecommitdiffstats
path: root/add-service
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2014-10-08 20:22:40 +0100
committerColin Guthrie <colin@mageia.org>2014-10-08 20:22:40 +0100
commitb94f44cf1458983b798426f6e9d038b6768eae9f (patch)
treed40664e2650ca5e4b853bc683f293886a8f25ecc /add-service
parentb289b717a84396801bda6b0949cabbdb8299328d (diff)
downloadrpm-helper-b94f44cf1458983b798426f6e9d038b6768eae9f.tar
rpm-helper-b94f44cf1458983b798426f6e9d038b6768eae9f.tar.gz
rpm-helper-b94f44cf1458983b798426f6e9d038b6768eae9f.tar.bz2
rpm-helper-b94f44cf1458983b798426f6e9d038b6768eae9f.tar.xz
rpm-helper-b94f44cf1458983b798426f6e9d038b6768eae9f.zip
Use systemctl enable if preset fails (which it will for sysvinit)
Diffstat (limited to 'add-service')
-rwxr-xr-xadd-service3
1 files changed, 2 insertions, 1 deletions
diff --git a/add-service b/add-service
index 04eb865..880bd2e 100755
--- a/add-service
+++ b/add-service
@@ -128,7 +128,8 @@ add_service() {
# Actually do enable/disable foo
if [ -n "$units_to_enable" ]; then
- /bin/systemctl --quiet preset $units_to_enable >/dev/null
+ # Prefer preset (for native systemd units), but fall back to enable (for sysvinit units)
+ /bin/systemctl --quiet preset $units_to_enable >/dev/null || /bin/systemctl --quiet enable $units_to_enable >/dev/null
if [ -n "$srv" -a ! -f "${systemd_migration_dir}/$srv" ]; then
touch "${systemd_migration_dir}/$srv"
fi