Discussion:
Bug#934066: sysv-rc: /etc/init.d/README is misleading wrt *.sh
Add Reply
Adam Borowski
2019-08-06 16:40:01 UTC
Reply
Permalink
Package: sysv-rc
Version: 2.95-4
Severity: wishlist

Hi!
The documentation in /etc/init.d/README talks a lot about *.sh files in that
dir, in a way that suggests that's the way regular init scripts should be
named. Could you please disambiguate?

(Apologies for not submitting patches myself -- I'm on a phoney PDA until
mid August.)


Meow!
-- System Information:
Debian Release: bullseye/sid
APT prefers unstable-debug
APT policy: (500, 'unstable-debug'), (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.2.5-00036-g8cfc5c871f99 (SMP w/64 CPU cores)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages sysv-rc depends on:
ii init-system-helpers 1.57
ii insserv 1.20.0-2
ii lsb-base 10.2019051400
ii startpar 0.63-1
ii sysvinit-utils 2.95-4

sysv-rc recommends no packages.

sysv-rc suggests no packages.

-- no debconf information
Dmitry Bogatov
2019-08-08 20:30:02 UTC
Reply
Permalink
Post by Adam Borowski
Package: sysv-rc
Version: 2.95-4
Severity: wishlist
Hi!
The documentation in /etc/init.d/README talks a lot about *.sh files in that
dir, in a way that suggests that's the way regular init scripts should be
named. Could you please disambiguate?
(Apologies for not submitting patches myself -- I'm on a phoney PDA until
mid August.)
Copy-editing is welcome.

From 949cb25e210d8f896068a018223c8cc2d78ac98f Mon Sep 17 00:00:00 2001
From: Dmitry Bogatov <***@debian.org>
Date: Tue, 6 Aug 2019 22:41:56 +0000
Subject: [PATCH] Do not imply in README that init scripts must have extension

Avoid refererring to init scripts using /etc/init.d/*.sh wildcard,
most of them do not have (and should not!) extension.

Closes: #934066
---
debian/src/sysv-rc/doc/init.d-README | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/debian/src/sysv-rc/doc/init.d-README b/debian/src/sysv-rc/doc/init.d-README
index 8477036a..9d2d1428 100644
--- a/debian/src/sysv-rc/doc/init.d-README
+++ b/debian/src/sysv-rc/doc/init.d-README
@@ -20,15 +20,15 @@ installed you can probably read it at
Some more detailed information can also be found in the files in the
/usr/share/doc/sysv-rc directory.

-Debian Policy dictates that /etc/init.d/*.sh scripts must work properly
-when sourced. The following additional rules apply:
+Debian Policy dictates that scripts in /etc/init.d/ must work properly when
+sourced. The following additional rules apply:

-* /etc/init.d/*.sh scripts must not rely for their correct functioning
+* /etc/init.d/* scripts must not rely for their correct functioning
on their being sourced rather than executed. That is, they must work
properly when executed too. They must include "#!/bin/sh" at the top.
This is useful when running scripts in parallel.

-* /etc/init.d/*.sh scripts must conform to the rules for sh scripts as
+* /etc/init.d/* scripts must conform to the rules for sh scripts as
spelled out in the Debian policy section entitled "Scripts" (§10.4).

Use the update-rc.d command to create symbolic links in the /etc/rc?.d
--
Note, that I send and fetch email in batch, once in a few days.
Please, mention in body of your reply when you add or remove recepients.
Adam Borowski
2019-08-08 23:20:02 UTC
Reply
Permalink
Post by Dmitry Bogatov
Post by Adam Borowski
The documentation in /etc/init.d/README talks a lot about *.sh files in that
dir, in a way that suggests that's the way regular init scripts should be
named. Could you please disambiguate?
(Apologies for not submitting patches myself -- I'm on a phoney PDA until
mid August.)
Copy-editing is welcome.
From 949cb25e210d8f896068a018223c8cc2d78ac98f Mon Sep 17 00:00:00 2001
Date: Tue, 6 Aug 2019 22:41:56 +0000
Subject: [PATCH] Do not imply in README that init scripts must have extension
Avoid refererring to init scripts using /etc/init.d/*.sh wildcard,
most of them do not have (and should not!) extension.
-Debian Policy dictates that /etc/init.d/*.sh scripts must work properly
+Debian Policy dictates that scripts in /etc/init.d/ must work properly when
-* /etc/init.d/*.sh scripts must not rely for their correct functioning
+* /etc/init.d/* scripts must not rely for their correct functioning
on their being sourced rather than executed. That is, they must work
properly when executed too. They must include "#!/bin/sh" at the top.
This part is not true: there's also #!/usr/bin/env /lib/init/init-d-script
Post by Dmitry Bogatov
This is useful when running scripts in parallel.
-* /etc/init.d/*.sh scripts must conform to the rules for sh scripts as
+* /etc/init.d/* scripts must conform to the rules for sh scripts as
Meow!
--
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian is one big family. Including that weird uncle
⢿⡄⠘⠷⠚⠋⠀ and ultra-religious in-laws.
⠈⠳⣄⠀⠀⠀⠀
Dmitry Bogatov
2019-08-10 16:10:02 UTC
Reply
Permalink
Post by Adam Borowski
Post by Dmitry Bogatov
Post by Adam Borowski
The documentation in /etc/init.d/README talks a lot about *.sh files in that
dir, in a way that suggests that's the way regular init scripts should be
named. Could you please disambiguate?
(Apologies for not submitting patches myself -- I'm on a phoney PDA until
mid August.)
Copy-editing is welcome.
From 949cb25e210d8f896068a018223c8cc2d78ac98f Mon Sep 17 00:00:00 2001
Date: Tue, 6 Aug 2019 22:41:56 +0000
Subject: [PATCH] Do not imply in README that init scripts must have extension
Avoid refererring to init scripts using /etc/init.d/*.sh wildcard,
most of them do not have (and should not!) extension.
-Debian Policy dictates that /etc/init.d/*.sh scripts must work properly
+Debian Policy dictates that scripts in /etc/init.d/ must work properly when
-* /etc/init.d/*.sh scripts must not rely for their correct functioning
+* /etc/init.d/* scripts must not rely for their correct functioning
on their being sourced rather than executed. That is, they must work
properly when executed too. They must include "#!/bin/sh" at the top.
This part is not true: there's also #!/usr/bin/env /lib/init/init-d-script
Thank you for your suggestion. This part is addressed by another patch
-- fix for #934065. Probably, it would be simplier to look not at patch,
but at resulting file:

https://salsa.debian.org/debian/sysvinit/blob/wip2/debian/src/sysv-rc/doc/init.d-README

And here is new version of init-d-script(5):

https://salsa.debian.org/debian/sysvinit/blob/wip2/debian/init-d-script.md
--
Note, that I send and fetch email in batch, once in a few days.
Please, mention in body of your reply when you add or remove recepients.
Tom H
2019-08-12 09:00:02 UTC
Reply
Permalink
Post by Dmitry Bogatov
-Debian Policy dictates that /etc/init.d/*.sh scripts must work
This hasn't been Policy for nine years or so.
Post by Dmitry Bogatov
+Debian Policy dictates that scripts in /etc/init.d/ must work
This has never been Policy.

Loading...