[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

use of *-rc.d in *.{postrm,prerm} w/o || true or || exit 0

Hi, (I am not subscribed. CC me if you can.)

My life:
1. Dummy admin screw-up configuration and kill daemon-foo system.
2. Try to remove everything and start from scratch
3. dpkg -P daemon-foo
4. error ! daemon-foo.postrm has
  /usr/sbin/invoke-rc.d daemon-foo.postrm stop
 while daemon-foo was dead long time ago.
 No way to remove it.  (See BTS #263511 as example)

So it is good idea to use || true or || exit 0 for these scripts if
these are not in [ ... ] (update-rc.d and invoke-rc.d)

I made a quick check and found many packaging scripts like this on my
system.  Are they acceptable or we should have lintian checking them?

Your thoughts?

$ cd /var/lib/dpkg/info
$ grep -e "-rc.d" * | fgrep -v "||" | fgrep -v "]"
acpid.postinst.org:update-rc.d acpid defaults > /dev/null
alsa-base.postinst:	update-rc.d alsa defaults >/dev/null
alsa-base.postrm:	update-rc.d alsa remove >/dev/null
anacron.postrm:	update-rc.d anacron remove >/dev/null
apache2-common.postinst:        update-rc.d apache2 defaults 91 >/dev/null
apache2-mpm-prefork.prerm:                /usr/sbin/invoke-rc.d apache2 stop
at.postinst:update-rc.d atd defaults 89 > /dev/null
at.postrm:	update-rc.d atd remove >/dev/null;
canna.postinst:	update-rc.d canna defaults >/dev/null
console-common.postinst:# we hit dpkg Bug#59740.  Additionally the "update-rc.d remove"
console-common.postinst:    update-rc.d keymaps.sh remove >/dev/null
console-common.postinst:    update-rc.d keymaps-lct.sh remove >/dev/null
console-common.postinst:	update-rc.d keymap.sh start 05 S . >/dev/null
console-tools.postinst:	update-rc.d console-screen.sh start 48 S . >/dev/null
cron.postinst:update-rc.d cron defaults 89 11 >/dev/null
cron.postinst:	       invoke-rc.d cron start
cron.postrm:    update-rc.d cron remove >/dev/null
cron.prerm:	       invoke-rc.d cron stop
cupsys.postrm:	update-rc.d cupsys remove >/dev/null
dbus-1.postinst:	update-rc.d dbus-1 defaults >/dev/null
dhcp3-server.postinst:update-rc.d dhcp3-server defaults >/dev/null
dhcp3-server.postrm:	update-rc.d dhcp3-server remove >/dev/null
dhcp3-server.prerm:	invoke-rc.d dhcp3-server stop
dictd.postinst:     update-rc.d dictd defaults >/dev/null
dictd.postrm:        update-rc.d dictd remove >/dev/null
discover.postinst:      update-rc.d -f discover remove > /dev/null
discover.postinst:  update-rc.d discover start 36 S . > /dev/null
discover.postrm:  update-rc.d discover remove > /dev/null 2>&1
exim4-base.postinst:           update-rc.d exim4 defaults >/dev/null
exim4-base.postrm:	update-rc.d exim4 remove > /dev/null
exim4-config.config:	command -v invoke-rc.d >/dev/null 2>&1; then 
exim4-daemon-heavy.postinst:		if command -v invoke-rc.d >/dev/null 2>&1; then
exim4-daemon-heavy.prerm:		if command -v invoke-rc.d >/dev/null 2>&1; then
exim4-daemon-heavy.prerm:		    invoke-rc.d exim4 stop
fcron.postinst:	update-rc.d fcron defaults 89 11 >/dev/null
fcron.postinst:		invoke-rc.d fcron start
fcron.postrm:	update-rc.d fcron remove >/dev/null
fcron.prerm:		invoke-rc.d fcron stop
festival.postinst:	update-rc.d festival defaults >/dev/null
fetchmail.postinst:	update-rc.d fetchmail defaults 99 15 >/dev/null
fetchmail.postinst:		invoke-rc.d --quiet fetchmail start
fetchmail.prerm:		invoke-rc.d --quiet fetchmail stop
flex.postinst:##: update-rc.d ${package_name} default >/dev/null
flex.postrm:    ##: update-rc.d ${package_name} remove >/dev/null
fonty.postrm:        update-rc.d -f fonty remove >/dev/null
fonty.postrm:        update-rc.d -f fonty remove >/dev/null
gdm.postinst:  update-rc.d gdm defaults 99 01 >/dev/null 2>&1
gdm.postrm:	update-rc.d gdm remove >/dev/null
gpm.postinst:update-rc.d gpm defaults >/dev/null
gpm.postrm:	update-rc.d gpm remove >/dev/null
hdparm.postinst:	update-rc.d hdparm start 07 S . stop 75 0 6 . >/dev/null
hdparm.postrm:	update-rc.d hdparm remove >/dev/null
hdparm.preinst:    update-rc.d -f hdparm remove > /dev/null 2>&1
hwtools.postinst:  update-rc.d hwtools start 60 S . >/dev/null
hwtools.postrm:    update-rc.d hwtools remove >/dev/null
ifupdown.postinst:	update-rc.d ifupdown start 39 S . >/dev/null
ifupdown.postrm:	update-rc.d ifupdown remove >/dev/null
inetutils-inetd.postinst:	update-rc.d inetutils-inetd defaults >/dev/null
inetutils-inetd.postinst:		invoke-rc.d inetutils-inetd start
inetutils-inetd.postrm:	update-rc.d inetutils-inetd remove >/dev/null
inetutils-inetd.prerm:		invoke-rc.d inetutils-inetd stop
inetutils-syslogd.postinst:    update-rc.d -f inetutils-syslogd remove >/dev/null
inetutils-syslogd.postinst:update-rc.d inetutils-syslogd defaults 10 90 >/dev/null
inetutils-syslogd.postinst:	update-rc.d inetutils-syslogd defaults >/dev/null
inetutils-syslogd.postinst:		invoke-rc.d inetutils-syslogd start
inetutils-syslogd.postrm:	update-rc.d inetutils-syslogd remove >/dev/null
inetutils-syslogd.prerm:		invoke-rc.d inetutils-syslogd stop
initrd-tools.postinst:	update-rc.d initrd-tools.sh start 05 S . > /dev/null
initrd-tools.postrm:	update-rc.d initrd-tools.sh remove > /dev/null
initscripts.postinst:#	Function like update-rc.d but simpler & faster.
initscripts.postinst:#	Heuristic: use the real update-rc.d if file-rc is detected,
initscripts.postinst:		update-rc.d "$@" > /dev/null
initscripts.postinst:#	Okay, we could do this with update-rc.d, but that would probably
kdm.postrm:	 update-rc.d kdm remove >/dev/null
klogd.postinst:    update-rc.d klogd defaults 11 89 >/dev/null
klogd.postinst:	    invoke-rc.d klogd start
klogd.postrm:  update-rc.d klogd remove >/dev/null
klogd.preinst:	    invoke-rc.d klogd stop
klogd.prerm:	invoke-rc.d klogd stop
libc6.postinst:#	Function like update-rc.d but simpler & faster.
libc6.postinst:#	Now we use the real update-rc.d, so now this function should
libc6.postinst:#	be equivalent to /usr/sbin/update-rc.d.
libc6.postinst:		update-rc.d "$@" > /dev/null
libc6.postinst:#	invoke-rc.d mountkernfs start
libc6.postrm:#    update-rc.d mountkernfs remove > /dev/null
libc6.preinst:		update-rc.d utmpd remove > /dev/null
libdevmapper1.00.postinst:	update-rc.d libdevmapper1.00 start 25 S . >/dev/null
login.postinst:			update-rc.d logoutd remove
make.postinst:##: update-rc.d ${package_name} default >/dev/null
makedev.postinst:	update-rc.d makedev defaults >/dev/null
nas.postrm:		update-rc.d -f nas remove >/dev/null
netbase.postinst:      update-rc.d -f networking remove > /dev/null 2>&1
netbase.postinst:    update-rc.d -f netbase remove > /dev/null 2>&1
netbase.postinst:  update-rc.d networking start 40 S . start 35 0 6 . > /dev/null
netbase.postrm:    update-rc.d networking remove > /dev/null
nfs-common.postinst:	update-rc.d nfs-common defaults 21 79 >/dev/null
nfs-common.postinst:invoke-rc.d nfs-common $act
nfs-common.postrm:	update-rc.d nfs-common remove >/dev/null
nfs-kernel-server.postinst:	update-rc.d nfs-kernel-server defaults 20 80 >/dev/null
nfs-kernel-server.postinst:invoke-rc.d nfs-kernel-server $act
nfs-kernel-server.postrm:	update-rc.d nfs-kernel-server remove >/dev/null
nullmailer.postrm:	update-rc.d nullmailer remove > /dev/null
nvi.postinst:    update-rc.d nviboot start 70 S . >/dev/null
nvi.postrm:    update-rc.d nviboot remove > /dev/null
pcmcia-cs.postinst:    update-rc.d pcmcia defaults >/dev/null
pcmcia-cs.postrm:    update-rc.d pcmcia remove >/dev/null
portmap.postinst:	update-rc.d portmap start 43 S . start 32 0 6 . start 18 2 3 4 5 . stop 81 1 . >/dev/null
portmap.postinst:		invoke-rc.d portmap start
portmap.postrm:	update-rc.d portmap remove >/dev/null
portmap.prerm:		invoke-rc.d portmap stop
procps.postinst:			update-rc.d procps remove >/dev/null
procps.postinst:	update-rc.d procps.sh start 30 S . >/dev/null
resolvconf.postinst:	update-rc.d -f resolvconf remove > /dev/null 2>&1
resolvconf.postinst:	update-rc.d resolvconf start 38 S . stop 89 0 6 . >/dev/null
resolvconf.postrm:	update-rc.d resolvconf remove >/dev/null
rsync.postinst:        update-rc.d rsync defaults >/dev/null
rsync.postinst:                invoke-rc.d rsync restart
rsync.postrm:    update-rc.d rsync remove >/dev/null
rsync.prerm:			invoke-rc.d rsync stop
screen.postinst:	update-rc.d screen-cleanup start 70 S . >/dev/null
screen.postrm:	update-rc.d screen-cleanup remove >/dev/null
setserial.postinst:  update-rc.d -f setserial remove >/dev/null
setserial.postinst:    update-rc.d etc-setserial start 30 S . stop 30 0 6 . >/dev/null
setserial.postinst:update-rc.d setserial start 46 S . stop 19 0 6 . >/dev/null
setserial.postrm:  update-rc.d setserial remove >/dev/null
setserial.postrm:  update-rc.d etc-setserial remove >/dev/null
spamassassin.postinst:	update-rc.d spamassassin defaults 19 >/dev/null
spamassassin.postinst:		invoke-rc.d spamassassin start
spamassassin.postrm:	update-rc.d spamassassin remove >/dev/null
spamassassin.prerm:		invoke-rc.d spamassassin stop
squid.postrm:		update-rc.d squid remove > /dev/null
ssh.postinst:			invoke-rc.d --quiet ssh stop
ssh.postinst:		update-rc.d ssh defaults >/dev/null
ssh.postinst:			invoke-rc.d ssh restart
ssh.postrm:    update-rc.d ssh remove >/dev/null
ssh.prerm:			invoke-rc.d ssh stop
sudo.postinst:system ('update-rc.d -f sudo remove >/dev/null 2>&1');
sudo.postinst:system ('update-rc.d sudo start 75 S . >/dev/null');
sysklogd.postrm:    update-rc.d sysklogd remove >/dev/null
sysv-rc.postrm:ln -sf /usr/share/sysvinit/update-rc.d /usr/sbin/update-rc.d
sysv-rc.postrm:ln -sf /usr/share/sysvinit/update-rc.d /usr/sbin/invoke-rc.d
tpconfig.postinst:	update-rc.d tpconfig defaults 19 81 >/dev/null
tpconfig.postinst:		invoke-rc.d tpconfig start
tpconfig.postrm:	update-rc.d tpconfig remove defaults 19 81 >/dev/null
tpconfig.prerm:		invoke-rc.d tpconfig stop
ucf.postinst:# update-rc.d ${package_name} default >/dev/null
ucf.postrm:    # update-rc.d ${package_name} remove >/dev/null
uml-utilities.postrm:	update-rc.d uml-utilities remove >/dev/null
umlrun-uml.postinst:	update-rc.d umlrun-uml start 99 2 3 4 5 . >/dev/null
umlrun-uml.postinst:		invoke-rc.d umlrun-uml start
umlrun-uml.postrm:	update-rc.d umlrun-uml remove >/dev/null
umlrun-uml.prerm:		invoke-rc.d umlrun-uml stop
util-linux.postinst:#	update-rc.d will do it's job.
util-linux.postinst:        update-rc.d -f hwclock.sh remove 2>/dev/null > /dev/null
util-linux.postinst:        update-rc.d hwclock.sh start 50 S . stop 25 0 6 . > /dev/null
util-linux.postinst:        update-rc.d -f hwclockfirst.sh remove 2>/dev/null > /dev/null
util-linux.postinst:        update-rc.d hwclockfirst.sh start 18 S . > /dev/null
util-linux.postrm:                update-rc.d hwclock.sh remove >/dev/null
util-linux.postrm:		update-rc.d hwclockfirst.sh remove >/dev/null
wdm.postrm:    update-rc.d wdm remove >/dev/null
xdm.postinst:  update-rc.d xdm defaults 99 01
xdm.postrm:  update-rc.d xdm remove
xfree86-common.postinst:  update-rc.d xfree86-common start 70 S .
xfree86-common.postrm:  update-rc.d xfree86-common remove
xfs.postinst:  update-rc.d xfs defaults
xfs.postrm:  update-rc.d xfs remove
xprt-common.postinst:	update-rc.d xprint defaults >/dev/null
xprt-xprintorg.postinst:        invoke-rc.d xprint restart
xprt-xprintorg.prerm:        invoke-rc.d xprint stop


Except sysv-rc.* and sysvinit.list ones, I do not like other lines.

Attachment: signature.asc
Description: Digital signature

Reply to: