Package: debian-goodies
Version: 0.55
Severity: wishlist
Tags: patch

Hi,

the Debian packages initscripts and sysvinit in their current version
depend on sysvinit-utils which includes the command service. This command
should be prefered for calling the initscripts of packages, because it
cleanes up the environment before running the initscript. Hence,
checkrestart should suggest the user to restart the service with this
command instead of calling the initscript directly.

--- /usr/sbin/checkrestart      2010-10-14 21:34:26.000000000 +0200
+++ /tmp/checkrestart   2010-11-02 12:12:25.519804503 +0100
@@ -180,13 +180,13 @@
             if path.startswith('/etc/init.d/'):
                 if path.endswith('.sh'):
                     continue
-                package.initscripts.append(path)
+                package.initscripts.append(path[12:])
         # Alternatively, find init.d scripts that match the process name
         if len(package.initscripts) == 0:
             for process in package.processes:
-                path = '/etc/init.d/' + os.path.basename(process.program)
-                if os.path.exists(path):
-                    package.initscripts.append(path)
+                proc_name = os.path.basename(process.program)
+                if os.path.exists('/etc/init.d/' + proc_name):
+                    package.initscripts.append(proc_name)
             # Remove duplicate inits
             package.initscripts = [ u for u in package.initscripts if u not in 
locals()['_[1]'] ]
 
@@ -196,7 +196,7 @@
     for package in packages.values():
         if len(package.initscripts) > 0:
             restartable.append(package)
-            restartCommands.extend(map(lambda s: s + ' 
restart',package.initscripts))
+            restartCommands.extend(map(lambda s: 'service ' + s + ' 
restart',package.initscripts))
         else:
             nonrestartable.append(package)
             

Bye, Jörg.

-- System Information:
Debian Release: unstable/experimental
  APT prefers unstable
  APT policy: (900, 'unstable'), (700, 'experimental')
Architecture: powerpc (ppc)

Kernel: Linux 2.6.36+
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages debian-goodies depends on:
ii  curl                    7.21.2-1         Get a file from an HTTP, HTTPS or 
ii  dctrl-tools [grep-dctrl 2.14.5           Command-line tools to process Debi
ii  dialog                  1.1-20100428-1   Displays user-friendly dialog boxe
ii  less                    436-1            pager program similar to more
ii  perl                    5.10.1-15        Larry Wall's Practical Extraction 
ii  python                  2.6.6-3+squeeze1 interactive high-level object-orie

Versions of packages debian-goodies recommends:
ii  lsof                       4.81.dfsg.1-1 List open files

Versions of packages debian-goodies suggests:
ii  popularity-contest   1.49                Vote for your favourite packages a
ii  xdg-utils            1.0.2+cvs20100307-3 desktop integration utilities from
pn  zenity               <none>              (no description available)

-- no debconf information

Attachment: signature.asc
Description: Digital signature http://en.wikipedia.org/wiki/OpenPGP

Reply via email to