aboutsummaryrefslogtreecommitdiffstats
path: root/add-service
diff options
context:
space:
mode:
Diffstat (limited to 'add-service')
-rwxr-xr-xadd-service4
1 files changed, 2 insertions, 2 deletions
diff --git a/add-service b/add-service
index 307f0a4..1b5ac54 100755
--- a/add-service
+++ b/add-service
@@ -91,7 +91,7 @@ add_service() {
if [ -n "$units_to_enable" ]; then
/bin/systemctl --quiet enable $units_to_enable
fi
- if [ -n "$srv" ]; then
+ if [ -n "$srv" -a -f /etc/rc.d/init.d/$srv ]; then
/sbin/chkconfig --add $srv
if [ -r /etc/sysconfig/system ]; then
@@ -117,7 +117,7 @@ else
# Upgrade mode.
if [ x$init = xsystemd ]; then
/bin/systemctl --quiet try-restart $units
- else
+ elif [ -f /etc/rc.d/init.d/$srv ]; then
set -- /etc/rc3.d/S??$srv
if [ $# -gt 1 ]; then
echo 1>&2 "add-service: Error: $srv appears multiple times: $*"