Subject: service doesn't correctly parse "cron" init.d
Package: sysvinit-utils
Version: 2.88dsf-13.1
Severity: minor
Tags: patch

Hello,

/etc/init.d/cron case statements don't begin with whitespaces. This
make "service" command print a "?" when running "service
--status-all".

See the attached patch.

-- 
Mathieu
--- /usr/sbin/service.old	2011-03-25 11:26:48.000000000 +0100
+++ /usr/sbin/service	2011-03-25 11:27:49.000000000 +0100
@@ -74,7 +74,7 @@
               *)
                 if ! is_ignored_file "${SERVICE}" \
 		    && [ -x "${SERVICEDIR}/${SERVICE}" ]; then
-                        if ! grep -qs "\Wstatus)" "$SERVICE"; then
+                        if ! egrep -qs "(^|\W)status\)" "$SERVICE"; then
                           #printf " %s %-60s %s\n" "[?]" "$SERVICE:" "unknown" 1>&2
                           echo " [ ? ]  $SERVICE" 1>&2
                           continue

Reply via email to