Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #167810 > unrolled thread
| Started by | CN <cnliou9@fastmail.fm> |
|---|---|
| First post | 2016-05-13 14:00 +0200 |
| Last post | 2016-05-22 11:00 +0200 |
| Articles | 14 — 6 participants |
Back to article view | Back to linux.debian.user
update-rc.d creates unexpected sequence numbers CN <cnliou9@fastmail.fm> - 2016-05-13 14:00 +0200
Re: update-rc.d creates unexpected sequence numbers <tomas@tuxteam.de> - 2016-05-13 14:50 +0200
Re: update-rc.d creates unexpected sequence numbers <tomas@tuxteam.de> - 2016-05-13 15:20 +0200
Re: update-rc.d creates unexpected sequence numbers CN <cnliou9@fastmail.fm> - 2016-05-13 16:20 +0200
Re: update-rc.d creates unexpected sequence numbers <tomas@tuxteam.de> - 2016-05-13 19:20 +0200
Re: update-rc.d creates unexpected sequence numbers Gene Heskett <gheskett@shentel.net> - 2016-05-13 21:40 +0200
Re: update-rc.d creates unexpected sequence numbers <tomas@tuxteam.de> - 2016-05-13 22:20 +0200
Re: update-rc.d creates unexpected sequence numbers Gene Heskett <gheskett@shentel.net> - 2016-05-14 01:10 +0200
Re: update-rc.d creates unexpected sequence numbers Michael Biebl <biebl@debian.org> - 2016-05-13 23:40 +0200
Re: update-rc.d creates unexpected sequence numbers CN <cnliou9@fastmail.fm> - 2016-05-13 15:20 +0200
Re: update-rc.d creates unexpected sequence numbers Ansgar Burchardt <"Ansgar Burchardt"@43-1.org> - 2016-05-16 05:20 +0200
Re: update-rc.d creates unexpected sequence numbers CN <cnliou9@fastmail.fm> - 2016-05-17 14:30 +0200
Re: update-rc.d creates unexpected sequence numbers Ansgar Burchardt <"Ansgar Burchardt"@43-1.org> - 2016-05-17 21:10 +0200
Re: update-rc.d creates unexpected sequence numbers Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.com> - 2016-05-22 11:00 +0200
| From | CN <cnliou9@fastmail.fm> |
|---|---|
| Date | 2016-05-13 14:00 +0200 |
| Subject | update-rc.d creates unexpected sequence numbers |
| Message-ID | <ryjV8-2yY-33@gated-at.bofh.it> |
Hi!
/etc/init.d/my-program is correctly prepared with LSB header comments
like this:
#!/bin/sh
### BEGIN INIT INFO
# Provides: my-program
# Required-Start: $postgresql
# Required-Stop: $postgresql
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: My program.
# Description: My program.
### END INIT INFO
Both of these two commands
update-rc.d my-program defaults 20 80
update-rc.d my-program defaults start 20 2 3 4 5 . stop 80 0 1 6 .
yield the same incorrect sequence numbers in contrast to the results
demonstrated here:
https://debian-administration.org/article/28/Making_scripts_run_at_boot_time_with_Debian
cd /etc
ls rc5.d rc6.d
rc5.d:
README
S01motd
S01my-program
S01rsyslog
S02cron
S02dbus
S02ntp
S02postgresql
S02rsync
S02ssh
S02xfs
S03avahi-daemon
S03xdm
S04bootlogs
S04saned
S05minissdpd
S05rc.local
S05rmnologin
rc6.d:
K01minissdpd
K01saned
K01urandom
K01xdm
K02avahi-daemon
K02my-program
K02postgresql
K03sendsigs
K04rsyslog
K05hwclock.sh
K05umountnfs.sh
K06rpcbind
K07networking
K08umountfs
K09umountroot
K10reboot
README
I thought the linked files were S20my-program and K80my-program. Why
update-rc.d gives unexpected results? What is the procedure to get the
correct results?
Besides, why none of the sequence numbers with K is 100 minus the number
of the start link "S" according to the recommendations from "man
update-rc.d"?
--
http://www.fastmail.com - Access all of your messages and folders
wherever you are
[toc] | [next] | [standalone]
| From | <tomas@tuxteam.de> |
|---|---|
| Date | 2016-05-13 14:50 +0200 |
| Message-ID | <rykHv-3n4-5@gated-at.bofh.it> |
| In reply to | #167810 |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Fri, May 13, 2016 at 07:54:55PM +0800, CN wrote: > Hi! [...] > Both of these two commands > > update-rc.d my-program defaults 20 80 > update-rc.d my-program defaults start 20 2 3 4 5 . stop 80 0 1 6 . > > yield the same incorrect sequence numbers in contrast to the results > demonstrated here: Bizarre. Just tried in my box and it behaves as it should. It comes from sysv-rc 2.88dsf-41+deb7u1 What version is yours? And... just to double-check: tomas@rasputin:~$ sha1sum /usr/sbin/update-rc.d 19d097b7dbe7f0d0a551e40e9183656f81908088 /usr/sbin/update-rc.d (pity that it hasn't --version and --debug options, though). Regards - -- tomás -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlc1zKwACgkQBcgs9XrR2kaeDwCcDd3cxVmt11nOhr0oYFogW8Lz SY4An2LrkduRUnx5w/Ocij5Yu52w8Ffa =2Y67 -----END PGP SIGNATURE-----
[toc] | [prev] | [next] | [standalone]
| From | <tomas@tuxteam.de> |
|---|---|
| Date | 2016-05-13 15:20 +0200 |
| Message-ID | <rylax-3Vi-7@gated-at.bofh.it> |
| In reply to | #167813 |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Fri, May 13, 2016 at 09:09:56PM +0800, CN wrote: > On Fri, May 13, 2016, at 08:46 PM, tomas@tuxteam.de wrote: > > > > Bizarre. Just tried in my box and it behaves as it should. It comes from > > > > sysv-rc 2.88dsf-41+deb7u1 > > > > What version is yours? And... just to double-check: > > > > tomas@rasputin:~$ sha1sum /usr/sbin/update-rc.d > > 19d097b7dbe7f0d0a551e40e9183656f81908088 /usr/sbin/update-rc.d > > > > (pity that it hasn't --version and --debug options, though). > > > > Hi! > > I get the same weird results from 3 Debian hosts: > > - Linux host1 4.3.3 $8 SMP (Wheezy i686, local host I am working on) > > - Linux vps1 3.16.0-4-amd64 #1 SMP Debian 3.16.7 (from IaaS provider) > > - Linux vps2 4.5.2-2 $1 SMP x86-64 (Jessie, from IaaS provider) Jessie/Sid here. But the more important thing is... what version of sysv-rc is yours? What update-rc.d are you using? - -- t -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlc10x0ACgkQBcgs9XrR2kaMSwCfeKyQDch/C6YsIQPOlRLS3kFZ prsAnRgjh/Jcq4s9J8uQXy+1SKmV0gEN =OpJG -----END PGP SIGNATURE-----
[toc] | [prev] | [next] | [standalone]
| From | CN <cnliou9@fastmail.fm> |
|---|---|
| Date | 2016-05-13 16:20 +0200 |
| Message-ID | <rym6B-4Zg-7@gated-at.bofh.it> |
| In reply to | #167814 |
On Fri, May 13, 2016, at 09:14 PM, tomas@tuxteam.de wrote: > Jessie/Sid here. But the more important thing is... what version of > sysv-rc is yours? What update-rc.d are you using? > "dpkg -l sysv-rc" show this from local host: ii sysv-rc 2.88dsf-41+deb7u1 "2.88dsf-59" from my VPS provider. How embarrasing! I spent quite a while trying to get your second point, but to no avail. I am in the impression that there is only one copy of globally accessible update-rc.d, which is exactly located in /usr/sbin/, meaning that every time I type "update-rc.d" in shell, this exact version /usr/sbin/update-rc.d gets executed. The only special thing I notice is that it is a perl script. Am I missing anything else? I do not know what I am doing. Regardless, I typed what you showed in previous message: sha1sum /usr/sbin/update-rc.d and got this result which I have no idea of its meaning: 19d097b7dbe7f0d0a551e40e9183656f81908088 /usr/sbin/update-rc.d Best regards, CN -- http://www.fastmail.com - Access your email from home and the web
[toc] | [prev] | [next] | [standalone]
| From | <tomas@tuxteam.de> |
|---|---|
| Date | 2016-05-13 19:20 +0200 |
| Message-ID | <ryoUN-7ZA-1@gated-at.bofh.it> |
| In reply to | #167823 |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Fri, May 13, 2016 at 10:16:00PM +0800, CN wrote: > On Fri, May 13, 2016, at 09:14 PM, tomas@tuxteam.de wrote: > > Jessie/Sid here. But the more important thing is... what version of > > sysv-rc is yours? What update-rc.d are you using? > > > > "dpkg -l sysv-rc" show this from local host: > > ii sysv-rc 2.88dsf-41+deb7u1 > > "2.88dsf-59" from my VPS provider. OK. Same version as here. > How embarrasing! I spent quite a while trying to get your second point, > but to no avail. No worries :) > I am in the impression that there is only one copy of > globally accessible update-rc.d, which is exactly located in /usr/sbin/, > meaning that every time I type "update-rc.d" in shell, this exact > version /usr/sbin/update-rc.d gets executed. The only special thing I > notice is that it is a perl script. Am I missing anything else? All correct. > I do not know what I am doing. Regardless, I typed what you showed in > previous message: > > sha1sum /usr/sbin/update-rc.d > > and got this result which I have no idea of its meaning: > > 19d097b7dbe7f0d0a551e40e9183656f81908088 /usr/sbin/update-rc.d This gives a "fingerprint" of the file. If it is identical to the one I get in my box we can be (nearly) sure that both files are identical. They are. So the question now is... why they behave differently? I don't know yet, but perhaps I come up with an idea. regards - -- t -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlc2DHcACgkQBcgs9XrR2kYh1wCdFKi17ZB3VmSH5BAQkjb++tT5 tvAAnjfJFcK3iaXYz5PYBUbSKB0BGp08 =022Z -----END PGP SIGNATURE-----
[toc] | [prev] | [next] | [standalone]
| From | Gene Heskett <gheskett@shentel.net> |
|---|---|
| Date | 2016-05-13 21:40 +0200 |
| Message-ID | <ryr6i-1tO-19@gated-at.bofh.it> |
| In reply to | #167823 |
On Friday 13 May 2016 10:16:00 CN wrote: > On Fri, May 13, 2016, at 09:14 PM, tomas@tuxteam.de wrote: > > Jessie/Sid here. But the more important thing is... what version of > > sysv-rc is yours? What update-rc.d are you using? > > "dpkg -l sysv-rc" show this from local host: > > ii sysv-rc 2.88dsf-41+deb7u1 > > "2.88dsf-59" from my VPS provider. > > How embarrasing! I spent quite a while trying to get your second > point, but to no avail. I am in the impression that there is only one > copy of globally accessible update-rc.d, which is exactly located in > /usr/sbin/, meaning that every time I type "update-rc.d" in shell, > this exact version /usr/sbin/update-rc.d gets executed. The only > special thing I notice is that it is a perl script. Am I missing > anything else? > > I do not know what I am doing. Regardless, I typed what you showed in > previous message: > > sha1sum /usr/sbin/update-rc.d > > and got this result which I have no idea of its meaning: > > 19d097b7dbe7f0d0a551e40e9183656f81908088 /usr/sbin/update-rc.d > That is exactly what you asked for, the sha1sum of the file update-rc.d. Although this is rarely done, it has a several billion to one chance of being different IF you have modified ANYTHING in that perl script. But you would have had to do that as it was being installed, and recorded someplace so that you could do it again later to detect ANY CHANGE in that perl script, which would give you a different sha1sum. Since I doubt that you did that, the only use might be to post it as you have, so that others could compare theirs to yours. Indirectly, if several others get a different sha1sum that matches others, but is different from yours, then its time to compare version numbers. If everybody is running the same version number, but everyone else is getting a different sha1sum, yours stands a very good chance of being contaminated somehow. Bit rot on your hard drive would be slim because the hard drive itself keeps checksums and will re-read that data block until its good, and will usually put that good data into a spare sector, and will remap the spoiled sector to the newly allocated spare, all by itself. A 100,000/1 better chance would be that you've had it in an editor that noticed the last line wasn't terminated by a newline or linefeed and it added one. As some are fond of saying it doesn't mean squat, but the sha1sum goes BOOM in that event. But for the above comparison to work correctly, you (and everybody responding to your message) would have to post the version number of the parent package that held this file too. No use comparing apples to tangerines. :) > Best regards, > CN Cheers, Gene Heskett -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) Genes Web page <http://geneslinuxbox.net:6309/gene>
[toc] | [prev] | [next] | [standalone]
| From | <tomas@tuxteam.de> |
|---|---|
| Date | 2016-05-13 22:20 +0200 |
| Message-ID | <ryrIZ-29P-1@gated-at.bofh.it> |
| In reply to | #167838 |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Fri, May 13, 2016 at 03:35:29PM -0400, Gene Heskett wrote: [...] > But for the above comparison to work correctly, you (and everybody > responding to your message) would have to post the version number of the > parent package that held this file too. No use comparing apples to > tangerines. :) Gene, you have me confused now. This is *exactly* what we did: we compared the version of the package containing update-rc.d and the program file's sha1sum. Both match. We still get different behaviours, thus there must be something different in the execution environment. At least we know now where *not* to look :-) regards - -- tomás -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlc2NKkACgkQBcgs9XrR2kYIfACeL6dGdCmTMChYs78aWe+2dLCa K5AAnjLqbv3AZjV1Xo34yj7MXZeuctRx =eb+t -----END PGP SIGNATURE-----
[toc] | [prev] | [next] | [standalone]
| From | Gene Heskett <gheskett@shentel.net> |
|---|---|
| Date | 2016-05-14 01:10 +0200 |
| Message-ID | <ryunv-4M0-7@gated-at.bofh.it> |
| In reply to | #167840 |
On Friday 13 May 2016 16:10:17 tomas@tuxteam.de wrote: > On Fri, May 13, 2016 at 03:35:29PM -0400, Gene Heskett wrote: > > [...] > > > But for the above comparison to work correctly, you (and everybody > > responding to your message) would have to post the version number of > > the parent package that held this file too. No use comparing apples > > to tangerines. :) > > Gene, you have me confused now. This is *exactly* what we did: we > compared the version of the package containing update-rc.d and the > program file's sha1sum. Both match. > > We still get different behaviours, thus there must be something > different in the execution environment. At least we know now where > *not* to look :-) > > regards > -- tomás Yes, I believe we are on the same page, so obviously there is something else gone aglay in the environment as you suggested. You are I believe, making progress in discovering that, so I'll bow out and try not to confuse an issue about which I apparently know not well enough. Cheers, Gene Heskett -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) Genes Web page <http://geneslinuxbox.net:6309/gene>
[toc] | [prev] | [next] | [standalone]
| From | Michael Biebl <biebl@debian.org> |
|---|---|
| Date | 2016-05-13 23:40 +0200 |
| Message-ID | <rysYp-3bd-5@gated-at.bofh.it> |
| In reply to | #167823 |
[Multipart message — attachments visible in raw view] — view raw
Am 13.05.2016 um 16:16 schrieb CN: > On Fri, May 13, 2016, at 09:14 PM, tomas@tuxteam.de wrote: >> Jessie/Sid here. But the more important thing is... what version of >> sysv-rc is yours? What update-rc.d are you using? >> > > "dpkg -l sysv-rc" show this from local host: > > ii sysv-rc 2.88dsf-41+deb7u1 that's wheezy > "2.88dsf-59" from my VPS provider. that's jessie So you are using the wheezy version on your local host which doesn't necessarily use insserv but static priorities. If insserv is used, the start priorities are dynamically computed and what you pass to update-rc.d is ignored. https://wiki.debian.org/LSBInitScripts/DependencyBasedBoot -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?
[toc] | [prev] | [next] | [standalone]
| From | CN <cnliou9@fastmail.fm> |
|---|---|
| Date | 2016-05-13 15:20 +0200 |
| Message-ID | <rylax-3Vi-9@gated-at.bofh.it> |
| In reply to | #167813 |
On Fri, May 13, 2016, at 08:46 PM, tomas@tuxteam.de wrote:
>
> Bizarre. Just tried in my box and it behaves as it should. It comes from
>
> sysv-rc 2.88dsf-41+deb7u1
>
> What version is yours? And... just to double-check:
>
> tomas@rasputin:~$ sha1sum /usr/sbin/update-rc.d
> 19d097b7dbe7f0d0a551e40e9183656f81908088 /usr/sbin/update-rc.d
>
> (pity that it hasn't --version and --debug options, though).
>
Hi!
I get the same weird results from 3 Debian hosts:
- Linux host1 4.3.3 $8 SMP (Wheezy i686, local host I am working on)
- Linux vps1 3.16.0-4-amd64 #1 SMP Debian 3.16.7 (from IaaS provider)
- Linux vps2 4.5.2-2 $1 SMP x86-64 (Jessie, from IaaS provider)
Best regards,
CN
--
http://www.fastmail.com - Or how I learned to stop worrying and
love email again
[toc] | [prev] | [next] | [standalone]
| From | Ansgar Burchardt <"Ansgar Burchardt"@43-1.org> |
|---|---|
| Date | 2016-05-16 05:20 +0200 |
| Message-ID | <rzhez-1xy-67@gated-at.bofh.it> |
| In reply to | #167810 |
Hi, CN <cnliou9@fastmail.fm> writes: > /etc/init.d/my-program is correctly prepared with LSB header comments > like this: > > #!/bin/sh > ### BEGIN INIT INFO > # Provides: my-program > # Required-Start: $postgresql > # Required-Stop: $postgresql > # Default-Start: 2 3 4 5 > # Default-Stop: 0 1 6 > # Short-Description: My program. > # Description: My program. > ### END INIT INFO That doesn't look correct: unless you defined a "$postgresql" system facility (in /etc/insserv.conf), you should require "postgresql" and not "$postgresql". Ansgar
[toc] | [prev] | [next] | [standalone]
| From | CN <cnliou9@fastmail.fm> |
|---|---|
| Date | 2016-05-17 14:30 +0200 |
| Message-ID | <rzMim-4v6-27@gated-at.bofh.it> |
| In reply to | #167898 |
Hi! Ansgar,
On Sun, May 15, 2016, at 10:05 PM, Ansgar Burchardt wrote:
>
> That doesn't look correct: unless you defined a "$postgresql" system
> facility (in /etc/insserv.conf), you should require "postgresql" and
> not "$postgresql".
>
Many thanks for the correction, which seems to have fixed my execution
problems.
After I remove the "$" to make the script look like this
#!/bin/sh
### BEGIN INIT INFO
# Provides: my-program
# Required-Start: postgresql
# Required-Stop: postgresql
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: My program.
# Description: My program.
### END INIT INFO
, command
update-rc.d my-program defaults 20 80
gives the correct orders of my-program and postgresql like so:
S02postgresql
S03my-program
and
K02my-program
K03postgresql
I think this start and stop orders of my-program will work as expected
now although the sequence numbers in /etc/rcN.d/* do not strictly follow
the rule suggested by "man update-rc.d", which I guess is trivial after
systemd has been in play.
Best regards,
CN
--
http://www.fastmail.com - Accessible with your email software
or over the web
[toc] | [prev] | [next] | [standalone]
| From | Ansgar Burchardt <"Ansgar Burchardt"@43-1.org> |
|---|---|
| Date | 2016-05-17 21:10 +0200 |
| Message-ID | <rzSxs-7q-11@gated-at.bofh.it> |
| In reply to | #167941 |
Hi, CN writes: > On Sun, May 15, 2016, at 10:05 PM, Ansgar Burchardt wrote: >> That doesn't look correct: unless you defined a "$postgresql" system >> facility (in /etc/insserv.conf), you should require "postgresql" and >> not "$postgresql". >> > > Many thanks for the correction, which seems to have fixed my execution > problems. [...] > , command > update-rc.d my-program defaults 20 80 > gives the correct orders of my-program and postgresql like so: You can leave out the numbers at the end, that is just call update-rc.d my-program defaults The sequence numbers are automatically calculated from the dependencies by `insserv`. (Under both sysvinit and systemd.) For older releases the specified number was relevant, but even the documentation for `update-rc.d` in Wheezy documents the dependency-based system; for Jessie and later the manual sequence numbers is even no longer mentioned in the documentation (and always ignored anyway as far as I know). Ansgar
[toc] | [prev] | [next] | [standalone]
| From | Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.com> |
|---|---|
| Date | 2016-05-22 11:00 +0200 |
| Message-ID | <rBxoS-75z-11@gated-at.bofh.it> |
| In reply to | #167810 |
> update-rc.d my-program defaults 20 80 > update-rc.d my-program defaults start 20 2 3 4 5 . stop 80 0 1 6 . Support for run levels in "start" and "stop" subcommands was dropped from update-rc.d by Roger Leigh in 2013. You'll find that the command has been warning you about using explicit run levels in start and stop that don't match the header in the script file since at least 2009. The sole source of information about applicable run levels is now the header in the script file. At the very minimum, switch to only using the header-based way of doing things. Better: switch to only using "defaults", and not "start" and "stop" at all. Note also that "defaults" now ignores any arguments given to it, that having been dropped in 2013 as well. Non-dependency based van Smoorenbug rc script organization has been removed from update-rc.d. So best: just use "defaults", use it without arguments, and supply a (correct) header. * http://anonscm.debian.org/cgit/collab-maint/sysvinit.git/commit/?id=6323a1e4eb39ed1c050b1e74b6baef92dcfde4b1 * http://anonscm.debian.org/cgit/collab-maint/sysvinit.git/commit/?id=23aa96526e2cfc11e29507547dd38c1ff0c7e804 Note, in all of the fiddling with the sysv-rc package that you are all doing in this thread, that update-rc.d is no longer part of that package and has not been since 2015. * http://anonscm.debian.org/cgit/collab-maint/sysvinit.git/commit/?id=9b3afdb93ab6d1f73c3ae50c0f816b915665b1e2
[toc] | [prev] | [standalone]
Back to top | Article view | linux.debian.user
csiph-web