diff options
author | Roy Marples <roy@marples.name> | 2009-02-28 14:12:19 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2009-02-28 14:12:19 +0000 |
commit | 077b2d3ba8516edee7dcc225179fda2bf1c937cd (patch) | |
tree | 01c66639a6ff90a7e110b1579906a610e7135b59 /src/rc | |
parent | 907ca8a89f47c8982249dd93d1f1d6f9e567f01c (diff) |
Report if service is not executable.
Diffstat (limited to 'src/rc')
-rw-r--r-- | src/rc/rc-update.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/rc/rc-update.c b/src/rc/rc-update.c index 5a0264cd..3e0c7959 100644 --- a/src/rc/rc-update.c +++ b/src/rc/rc-update.c @@ -55,17 +55,20 @@ add(const char *runlevel, const char *service) { int retval = -1; - if (! rc_service_exists (service)) - eerror ("%s: service `%s' does not exist", applet, service); - else if (rc_service_in_runlevel (service, runlevel)) { + if (!rc_service_exists(service)) { + if (errno == ENOEXEC) + eerror("%s: service `%s' is not executeable", applet, service); + else + eerror("%s: service `%s' does not exist", applet, service); + } else if (rc_service_in_runlevel(service, runlevel)) { ewarn ("%s: %s already installed in runlevel `%s'; skipping", applet, service, runlevel); retval = 0; - } else if (rc_service_add (runlevel, service)) { + } else if (rc_service_add(runlevel, service)) { einfo ("%s added to runlevel %s", service, runlevel); retval = 1; } else - eerror ("%s: failed to add service `%s' to runlevel `%s': %s", + eerror("%s: failed to add service `%s' to runlevel `%s': %s", applet, service, runlevel, strerror (errno)); return retval; @@ -77,8 +80,8 @@ delete(const char *runlevel, const char *service) int retval = -1; errno = 0; - if (rc_service_delete (runlevel, service)) { - einfo ("%s removed from runlevel %s", service, runlevel); + if (rc_service_delete(runlevel, service)) { + einfo("%s removed from runlevel %s", service, runlevel); return 1; } |