diff options
author | Colin Guthrie <colin@mageia.org> | 2014-10-09 09:22:23 +0100 |
---|---|---|
committer | Colin Guthrie <colin@mageia.org> | 2014-10-09 09:24:45 +0100 |
commit | a875fe4c7af9e1f2375b8543314fae794dcffb43 (patch) | |
tree | bb8d0bfc72c49a80435e2f2efd79b789d7570151 /add-service | |
parent | b7b0cc9d4f3dc6747848317e721eb21b6eba561e (diff) | |
download | rpm-helper-a875fe4c7af9e1f2375b8543314fae794dcffb43.tar rpm-helper-a875fe4c7af9e1f2375b8543314fae794dcffb43.tar.gz rpm-helper-a875fe4c7af9e1f2375b8543314fae794dcffb43.tar.bz2 rpm-helper-a875fe4c7af9e1f2375b8543314fae794dcffb43.tar.xz rpm-helper-a875fe4c7af9e1f2375b8543314fae794dcffb43.zip |
Be quieter when enabling services, but tell the user when it goes wrong
Diffstat (limited to 'add-service')
-rwxr-xr-x | add-service | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/add-service b/add-service index 880bd2e..f30b81e 100755 --- a/add-service +++ b/add-service @@ -129,7 +129,12 @@ add_service() { # Actually do enable/disable foo if [ -n "$units_to_enable" ]; then # 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 + /bin/systemctl --quiet preset $units_to_enable >/dev/null 2>&1 || /bin/systemctl --quiet enable $units_to_enable >/dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "Warning: Problems encountered when activating services." >&2 + echo " Please check and enable manually if necessary." >&2 + echo " Service units affected: $units_to_enable" >&2 + fi if [ -n "$srv" -a ! -f "${systemd_migration_dir}/$srv" ]; then touch "${systemd_migration_dir}/$srv" fi |