[PATCH] LSB install_initd / remove_initd exit codes are undefined

Tobias Burnus <[email protected]>
Newsgroups gmane.linux.lsb.discuss
Message-ID <[email protected]>
Hi,

I just realized that currenty the behaviour of /usr/lib/lsb/install_initd
and /usr/lib/lsb/removed_initd is undefined if no the dependencies are not
fulfilled or will be broken, respectively.

The attached patch adds these rules:

a) install_initd
   (i)   successful installation: exit 0
   (ii)  already installed:       exit 0
   (iii) missing required boot facility: exit 1
   (iv)  other errors (cannot access init script database etc.):
         undefined/ignored by this patch (an exit status != 0 is useful!)

b) remove_initd
   (i)   successfully removed: exit 0
   (ii)  not installed:        exit 0
   (iii) other init script depends on this one: exit 1 and not removed
   (iv)  other problems: not defined/ignored by this patch
         (an exit status != 0 is useful in this case!)

Especially the wording of the remove_initd paragraph is a bit clumsy. If
you find better word, go ahead!

The described behaviour is implemented that way in
SuSE 8.2/UnitedLinux 1.0 and with restrictions in Debian.
(Debian gives these exit status codes but it will install/remove a package
nevertheless.)

Don't forget to run "make" in lsb/spec/wip/sysinit/ after applying this
patch.


Tobias
installinit.sgml.diff (text/plain, 1.3 KB)
Index: installinit.sgml
===================================================================
RCS file: /cvsroot/lsb/spec/wip/sysinit/installinit.sgml,v
retrieving revision 1.1
diff -u -r1.1 installinit.sgml
--- installinit.sgml	21 Apr 2003 12:36:37 -0000	1.1
+++ installinit.sgml	21 Jun 2003 10:43:18 -0000
@@ -20,6 +20,13 @@
 	/usr/lib/lsb/install_initd /etc/init.d/example.com-coffeed
 </SCREEN>
 
+<PARA>
+The install_initd program shall return an exit status of zero if the
+init.d file has been successfully installed or if the the init.d file
+was already installed. If the required boot facilities cannot be fulfilled
+an exit status of one shall be returned and the init.d file shall not be
+installed.
+</PARA>
 
 <PARA> 
 When a software package is removed, the package's preuninstall script
@@ -35,6 +42,13 @@
 	/usr/lib/lsb/remove_initd /etc/init.d/example.com-coffeed
 </SCREEN>
 
+<PARA>
+The remove_initd program shall return an exit status of zero if the
+init.d file has been successfully removed or if the the init.d file
+is not installed. If another init.d file which depends on a boot facility
+provided by this init.d file is installed, an exit status of one shall be
+returned and the init.d file shall remained installed.
+</PARA>
 
 <PARA>
 There should be a tool available to the user (e.g., RedHat's chkconfig)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.