Merge branch 'release/2.94-2'
Dmitry Bogatov
5 years ago
0 | sysvinit (2.94-2) experimental; urgency=medium | |
1 | ||
2 | * Make init-d-scripts exit with sensible values (Closes: #427889) | |
3 | * Make /etc/init.d/reboot respect NETDOWN variable (Closes: #499796) | |
4 | * Improve description of VERBOSE in rcS(5) (Closes: #589050) | |
5 | * Document NETDOWN variable in /etc/default/halt (Closes: #703844) | |
6 | * Move README files from /etc (Closes: #921333) | |
7 | * Do not use unsafe `: >` shell command to create files (Closes: #923478) | |
8 | + Thanks: Pierre Ynard <linkfanel@yahoo.fr> | |
9 | * Make /etc/rc.local conffile (Closes: #923485) | |
10 | ||
11 | -- Dmitry Bogatov <KAction@debian.org> Thu, 04 Apr 2019 22:30:28 +0000 | |
12 | ||
0 | 13 | sysvinit (2.94-1) experimental; urgency=medium |
1 | 14 | |
2 | 15 | * New upstream release (Closes: #923371, #671589) |
42 | 42 | # Function that starts the daemon/service |
43 | 43 | # |
44 | 44 | |
45 | # Return | |
46 | # 0 if daemon has been started | |
47 | # 1 if daemon was already running | |
48 | # 2 if daemon could not be started | |
49 | 45 | do_start_cmd() { |
50 | start-stop-daemon --start --quiet ${PIDFILE:+--pidfile ${PIDFILE}} \ | |
51 | $START_ARGS \ | |
52 | --startas $DAEMON --name $NAME --exec $DAEMON --test > /dev/null \ | |
53 | || return 1 | |
54 | start-stop-daemon --start --quiet ${PIDFILE:+--pidfile ${PIDFILE}} \ | |
55 | $START_ARGS \ | |
56 | --startas $DAEMON --name $NAME --exec $DAEMON -- $DAEMON_ARGS \ | |
57 | || return 2 | |
58 | # Add code here, if necessary, that waits for the process to be ready | |
59 | # to handle requests from services started subsequently which depend | |
60 | # on this one. As a last resort, sleep for some time. | |
46 | start-stop-daemon --start --quiet --oknodo \ | |
47 | ${PIDFILE:+--pidfile ${PIDFILE}} $START_ARGS \ | |
48 | --startas $DAEMON --name $NAME --exec $DAEMON -- $DAEMON_ARGS | |
61 | 49 | } |
62 | 50 | |
63 | 51 | do_start() |
67 | 55 | fi |
68 | 56 | [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" |
69 | 57 | call do_start_cmd |
70 | case "$?" in | |
58 | retval=$? | |
59 | case ${retval} in | |
71 | 60 | 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; |
72 | 61 | 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; |
73 | 62 | esac |
74 | 63 | if is_call_implemented do_start_cleanup ; then |
75 | 64 | call do_start_cleanup |
65 | else | |
66 | return ${retval} | |
76 | 67 | fi |
77 | 68 | } |
78 | 69 | |
80 | 71 | # Function that stops the daemon/service |
81 | 72 | # |
82 | 73 | |
83 | # Return | |
84 | # 0 if daemon has been stopped | |
85 | # 1 if daemon was already stopped | |
86 | # 2 if daemon could not be stopped | |
87 | # other if a failure occurred | |
88 | 74 | do_stop_cmd() { |
89 | 75 | start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \ |
90 | 76 | $STOP_ARGS \ |
113 | 99 | fi |
114 | 100 | [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" |
115 | 101 | call do_stop_cmd |
116 | case "$?" in | |
102 | retval=$? | |
103 | case ${retval} in | |
117 | 104 | 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; |
118 | 105 | 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; |
119 | 106 | esac |
120 | 107 | if is_call_implemented do_stop_cleanup ; then |
121 | 108 | call do_stop_cleanup |
109 | else | |
110 | return ${retval} | |
122 | 111 | fi |
123 | 112 | } |
124 | 113 | |
129 | 118 | [ "$VERBOSE" != no ] && log_daemon_msg "Restarting $DESC" "$NAME" |
130 | 119 | call do_stop_cmd |
131 | 120 | call do_start_cmd |
132 | case "$?" in | |
121 | retval=$? | |
122 | case ${retval} in | |
133 | 123 | 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; |
134 | 124 | 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; |
135 | 125 | esac |
136 | 126 | if is_call_implemented do_restart_cleanup ; then |
137 | 127 | call do_restart_cleanup |
128 | else | |
129 | return ${retval} | |
138 | 130 | fi |
139 | 131 | } |
140 | 132 |
16 | 16 | exit 0 |
17 | 17 | ;; |
18 | 18 | esac |
19 | ||
20 | if [ -f /etc/rc.local.dpkg-old ] ; then | |
21 | mv /etc/rc.local.dpkg-old /etc/rc.local | |
22 | fi | |
19 | 23 | |
20 | 24 | umask 022 |
21 | 25 |
48 | 48 | |
49 | 49 | #DEBHELPER# |
50 | 50 | |
51 | : | |
51 | case $1 in | |
52 | (install|upgrade) | |
53 | if dpkg --compare-versions "$2" lt '2.94-2' ; then | |
54 | if [ -f /etc/rc.local ] ; then | |
55 | mv /etc/rc.local /etc/rc.local.dpkg-old | |
56 | fi | |
57 | fi | |
58 | ;; | |
59 | esac |
94 | 94 | sed -i -ne '/sysvinit (2.86.ds1-47)/q' -e p \ |
95 | 95 | $(rctmp)$(doc)/sysv-rc/changelog.Debian |
96 | 96 | |
97 | override_dh_fixperms: | |
98 | dh_fixperms -X/etc/init.d/skeleton -X/etc/init.d/README | |
99 | ||
100 | 97 | override_dh_installdeb-arch: |
101 | 98 | dh_installdeb |
102 | 99 | |
122 | 119 | rm -rf $(inittmp)/etc/hurd |
123 | 120 | endif |
124 | 121 | |
125 | override_dh_installdeb-indep: | |
126 | dh_installdeb | |
127 | ||
128 | # Neither rc, rcS nor README are conffiles | |
129 | $(RM) $(rctmp)/DEBIAN/conffiles | |
130 | ||
131 | 122 | override_dh_clean: |
132 | 123 | dh_clean |
133 | 124 | $(MAKE) -C src clobber |
26 | 26 | find $(DESTDIR)/lib -type d -name .svn -print0 |xargs -r0 rm -r |
27 | 27 | chmod 755 $(DESTDIR)$(sysconfdir)/init.d/[a-z]* |
28 | 28 | chmod 755 $(DESTDIR)$(sysconfdir)/network/if-up.d/[a-z]* |
29 | chmod 755 $(DESTDIR)$(sysconfdir)/rc.local | |
29 | 30 | chmod 644 $(DESTDIR)/lib/init/*.sh |
30 | 31 | chmod -R g-w $(DESTDIR) |
31 | 32 | chown -R root:root $(DESTDIR) |
0 | 0 | # Default behaviour of shutdown -h / halt. Set to "halt" or "poweroff". |
1 | 1 | HALT=poweroff |
2 | ||
3 | # Bring networking down right before halting/rebooting system. You | |
4 | # should only need this to handle issues with Wake-on-LAN or network | |
5 | # filesystems. Set to "yes" or "no". | |
6 | NETDOWN=yes |
25 | 25 | esac |
26 | 26 | |
27 | 27 | # Create /var/run/utmp so we can login. |
28 | : > /var/run/utmp | |
28 | true > /var/run/utmp | |
29 | 29 | if grep -q ^utmp: /etc/group |
30 | 30 | then |
31 | 31 | chmod 664 /var/run/utmp |
11 | 11 | PATH=/sbin:/usr/sbin:/bin:/usr/bin |
12 | 12 | |
13 | 13 | . /lib/lsb/init-functions |
14 | [ -f /etc/default/halt ] && . /etc/default/halt | |
14 | 15 | |
15 | 16 | do_stop () { |
16 | 17 | # Message should end with a newline since kFreeBSD may |
17 | 18 | # print more stuff (see #323749) |
18 | 19 | log_action_msg "Will now restart" |
19 | reboot -d -f -i | |
20 | local netdown="-i" | |
21 | if [ "${NETDOWN}" = no ] ; then | |
22 | netdown="" | |
23 | fi | |
24 | reboot -d -f ${netdown} | |
20 | 25 | } |
21 | 26 | |
22 | 27 | case "$1" in |
0 | #!/bin/sh -e | |
1 | # | |
2 | # rc.local | |
3 | # | |
4 | # This script is executed at the end of each multiuser runlevel. | |
5 | # Make sure that the script will "exit 0" on success or any other | |
6 | # value on error. | |
7 | # | |
8 | # In order to enable or disable this script just change the execution | |
9 | # bits. | |
10 | ||
11 | if test -d /etc/boot.d ; then | |
12 | run-parts /etc/boot.d | |
13 | fi |
18 | 18 | # able to introduce a symlink here. As an extra precaution, |
19 | 19 | # set noclobber. |
20 | 20 | set -o noclobber |
21 | :> "$1" || { log_failure_msg "bootclean: Failure creating '$1'." ; return 1 ; } | |
21 | true > "$1" || { log_failure_msg "bootclean: Failure creating '$1'." ; return 1 ; } | |
22 | 22 | return 0 |
23 | 23 | } |
24 | 24 |
54 | 54 | that \fI/run/nologin\fP does not exist. |
55 | 55 | |
56 | 56 | .IP \fBVERBOSE\fP |
57 | Setting this option to \fBno\fP (in lower case) will make the boot process | |
58 | a bit less verbose. | |
59 | Setting this option to \fByes\fP will make the boot process | |
60 | a bit more verbose. | |
57 | Choose, whether boot process should be verbose | |
58 | (value | |
59 | .BR yes ) | |
60 | or quiet (value | |
61 | .BR no ). | |
62 | Setting this variable to any other value results in undefined behaviour. | |
61 | 63 | |
62 | 64 | .IP \fBFSCKFIX\fP |
63 | 65 | When the root and all other file systems are checked, |
13 | 13 | $(INSTALL) -d $(DESTDIR)$(docdir)/. |
14 | 14 | $(INSTALL) -d $(DESTDIR)/var/lib/insserv |
15 | 15 | $(INSTALL) -d $(DESTDIR)$(sysconfdir)/. |
16 | $(INSTALL_DATA) doc/* $(DESTDIR)$(docdir)/. | |
17 | cp -af etc/* $(DESTDIR)$(sysconfdir) | |
18 | 16 | find $(DESTDIR)$(sysconfdir) -type d -name .svn -print0 |xargs -r0 rm -r |
19 | ||
20 | for N in 2 3 4 5 ; do \ | |
21 | $(INSTALL) -d $(DESTDIR)$(sysconfdir)/rc$${N}.d ; \ | |
22 | $(INSTALL_DATA) rc2-5.d-README \ | |
23 | $(DESTDIR)$(sysconfdir)/rc$${N}.d/README ; \ | |
24 | done | |
25 | chmod 644 $(DESTDIR)$(sysconfdir)/init.d/README | |
26 | chmod -R go=u-w $(DESTDIR)$(sysconfdir) | |
27 | chown -R root:root $(DESTDIR)$(sysconfdir) | |
28 | 17 | |
29 | 18 | $(INSTALL) -d $(DESTDIR)/usr/share/sysv-rc/. |
30 | 19 | $(INSTALL) saveconfig $(DESTDIR)/usr/share/sysv-rc/saveconfig |
0 | Configuration of System V init under Debian GNU/Linux | |
1 | ||
2 | Most Unix versions have a file here that describes how the scripts | |
3 | in this directory work, and how the links in the /etc/rc?.d/ directories | |
4 | influence system startup/shutdown. | |
5 | ||
6 | For Debian, this information is contained in the policy manual, chapter | |
7 | "System run levels and init.d scripts". The Debian Policy Manual is | |
8 | available at: | |
9 | ||
10 | http://www.debian.org/doc/debian-policy/#contents | |
11 | ||
12 | The Debian Policy Manual is also available in the Debian package | |
13 | "debian-policy". When this package is installed, the policy manual can be | |
14 | found in directory /usr/share/doc/debian-policy. If you have a browser | |
15 | installed you can probably read it at | |
16 | ||
17 | file://localhost/usr/share/doc/debian-policy/ | |
18 | ||
19 | Some more detailed information can also be found in the files in the | |
20 | /usr/share/doc/sysv-rc directory. | |
21 | ||
22 | Debian Policy dictates that /etc/init.d/*.sh scripts must work properly | |
23 | when sourced. The following additional rules apply: | |
24 | ||
25 | * /etc/init.d/*.sh scripts must not rely for their correct functioning | |
26 | on their being sourced rather than executed. That is, they must work | |
27 | properly when executed too. They must include "#!/bin/sh" at the top. | |
28 | This is useful when running scripts in parallel. | |
29 | ||
30 | * /etc/init.d/*.sh scripts must conform to the rules for sh scripts as | |
31 | spelled out in the Debian policy section entitled "Scripts" (ยง10.4). | |
32 | ||
33 | Use the update-rc.d command to create symbolic links in the /etc/rc?.d | |
34 | as appropriate. See that man page for more details. | |
35 | ||
36 | All init.d scripts are expected to have a LSB style header documenting | |
37 | dependencies and default runlevel settings. The header look like this | |
38 | (not all fields are required): | |
39 | ||
40 | ### BEGIN INIT INFO | |
41 | # Provides: skeleton | |
42 | # Required-Start: $remote_fs $syslog | |
43 | # Required-Stop: $remote_fs $syslog | |
44 | # Should-Start: $portmap | |
45 | # Should-Stop: $portmap | |
46 | # X-Start-Before: nis | |
47 | # X-Stop-After: nis | |
48 | # Default-Start: 2 3 4 5 | |
49 | # Default-Stop: 0 1 6 | |
50 | # X-Interactive: true | |
51 | # Short-Description: Example initscript | |
52 | # Description: This file should be used to construct scripts to be | |
53 | # placed in /etc/init.d. | |
54 | ### END INIT INFO | |
55 | ||
56 | More information on the format is available from insserv(8). This | |
57 | information is used to dynamicaly assign sequence numbers to the | |
58 | boot scripts and to run the scripts in parallel during the boot. | |
59 | See also /usr/share/doc/insserv/README.Debian. |
0 | The scripts in this directory are executed once when entering | |
1 | runlevel 0. | |
2 | ||
3 | The scripts are all symbolic links whose targets are located in | |
4 | /etc/init.d/ . | |
5 | ||
6 | Generally it is not necessary to alter the scripts in this directory. | |
7 | Their purpose is to stop all services and to make the system ready | |
8 | for shutdown. | |
9 | ||
10 | For more information see /etc/init.d/README. |
0 | The scripts in this directory are executed each time the system enters | |
1 | this runlevel. | |
2 | ||
3 | The scripts are all symbolic links whose targets are located in | |
4 | /etc/init.d/ . | |
5 | ||
6 | Generally it is not necessary to alter the scripts in this directory. | |
7 | Their purpose is to stop all services and thus to put the system in | |
8 | single-user mode. | |
9 | ||
10 | For more information see /etc/init.d/README. |
0 | The scripts in this directory are executed each time the system enters | |
1 | this runlevel. | |
2 | ||
3 | The scripts are all symbolic links whose targets are located in | |
4 | /etc/init.d/ . | |
5 | ||
6 | To disable a service in this runlevel, rename its script in this | |
7 | directory so that the new name begins with a 'K' and a two-digit | |
8 | number, and run 'update-rc.d <script> defaults' to reorder the scripts | |
9 | according to dependencies. A warning about the current runlevels | |
10 | being enabled not matching the LSB header in the init.d script will be | |
11 | printed. To re-enable the service, rename the script back to its | |
12 | original name beginning with 'S' and run update-rc.d again. | |
13 | ||
14 | For a more information see /etc/init.d/README. |
0 | The scripts in this directory are executed once when entering | |
1 | runlevel 6. | |
2 | ||
3 | The scripts are all symbolic links whose targets are located in | |
4 | /etc/init.d/ . | |
5 | ||
6 | Generally it is not necessary to alter the scripts in this directory. | |
7 | Their purpose is to stop all services and to make the system ready | |
8 | for reboot. | |
9 | ||
10 | For more information see /etc/init.d/README. |
0 | The scripts in this directory whose names begin with an 'S' are | |
1 | executed once when booting the system, even when booting directly into | |
2 | single user mode. | |
3 | ||
4 | The scripts are all symbolic links whose targets are located in | |
5 | /etc/init.d/ . | |
6 | ||
7 | To disable a script in this directory, rename it so that it begins | |
8 | with a 'K' and run 'update-rc.d script defaults' to update the order | |
9 | using the script dependencies. | |
10 | ||
11 | For more information see /etc/init.d/README. |
0 | Configuration of System V init under Debian GNU/Linux | |
1 | ||
2 | Most Unix versions have a file here that describes how the scripts | |
3 | in this directory work, and how the links in the /etc/rc?.d/ directories | |
4 | influence system startup/shutdown. | |
5 | ||
6 | For Debian, this information is contained in the policy manual, chapter | |
7 | "System run levels and init.d scripts". The Debian Policy Manual is | |
8 | available at: | |
9 | ||
10 | http://www.debian.org/doc/debian-policy/#contents | |
11 | ||
12 | The Debian Policy Manual is also available in the Debian package | |
13 | "debian-policy". When this package is installed, the policy manual can be | |
14 | found in directory /usr/share/doc/debian-policy. If you have a browser | |
15 | installed you can probably read it at | |
16 | ||
17 | file://localhost/usr/share/doc/debian-policy/ | |
18 | ||
19 | Some more detailed information can also be found in the files in the | |
20 | /usr/share/doc/sysv-rc directory. | |
21 | ||
22 | Debian Policy dictates that /etc/init.d/*.sh scripts must work properly | |
23 | when sourced. The following additional rules apply: | |
24 | ||
25 | * /etc/init.d/*.sh scripts must not rely for their correct functioning | |
26 | on their being sourced rather than executed. That is, they must work | |
27 | properly when executed too. They must include "#!/bin/sh" at the top. | |
28 | This is useful when running scripts in parallel. | |
29 | ||
30 | * /etc/init.d/*.sh scripts must conform to the rules for sh scripts as | |
31 | spelled out in the Debian policy section entitled "Scripts" (ยง10.4). | |
32 | ||
33 | Use the update-rc.d command to create symbolic links in the /etc/rc?.d | |
34 | as appropriate. See that man page for more details. | |
35 | ||
36 | All init.d scripts are expected to have a LSB style header documenting | |
37 | dependencies and default runlevel settings. The header look like this | |
38 | (not all fields are required): | |
39 | ||
40 | ### BEGIN INIT INFO | |
41 | # Provides: skeleton | |
42 | # Required-Start: $remote_fs $syslog | |
43 | # Required-Stop: $remote_fs $syslog | |
44 | # Should-Start: $portmap | |
45 | # Should-Stop: $portmap | |
46 | # X-Start-Before: nis | |
47 | # X-Stop-After: nis | |
48 | # Default-Start: 2 3 4 5 | |
49 | # Default-Stop: 0 1 6 | |
50 | # X-Interactive: true | |
51 | # Short-Description: Example initscript | |
52 | # Description: This file should be used to construct scripts to be | |
53 | # placed in /etc/init.d. | |
54 | ### END INIT INFO | |
55 | ||
56 | More information on the format is available from insserv(8). This | |
57 | information is used to dynamicaly assign sequence numbers to the | |
58 | boot scripts and to run the scripts in parallel during the boot. | |
59 | See also /usr/share/doc/insserv/README.Debian. |
0 | The scripts in this directory are executed once when entering | |
1 | runlevel 0. | |
2 | ||
3 | The scripts are all symbolic links whose targets are located in | |
4 | /etc/init.d/ . | |
5 | ||
6 | Generally it is not necessary to alter the scripts in this directory. | |
7 | Their purpose is to stop all services and to make the system ready | |
8 | for shutdown. | |
9 | ||
10 | For more information see /etc/init.d/README. |
0 | The scripts in this directory are executed each time the system enters | |
1 | this runlevel. | |
2 | ||
3 | The scripts are all symbolic links whose targets are located in | |
4 | /etc/init.d/ . | |
5 | ||
6 | Generally it is not necessary to alter the scripts in this directory. | |
7 | Their purpose is to stop all services and thus to put the system in | |
8 | single-user mode. | |
9 | ||
10 | For more information see /etc/init.d/README. |
0 | The scripts in this directory are executed once when entering | |
1 | runlevel 6. | |
2 | ||
3 | The scripts are all symbolic links whose targets are located in | |
4 | /etc/init.d/ . | |
5 | ||
6 | Generally it is not necessary to alter the scripts in this directory. | |
7 | Their purpose is to stop all services and to make the system ready | |
8 | for reboot. | |
9 | ||
10 | For more information see /etc/init.d/README. |
0 | The scripts in this directory whose names begin with an 'S' are | |
1 | executed once when booting the system, even when booting directly into | |
2 | single user mode. | |
3 | ||
4 | The scripts are all symbolic links whose targets are located in | |
5 | /etc/init.d/ . | |
6 | ||
7 | To disable a script in this directory, rename it so that it begins | |
8 | with a 'K' and run 'update-rc.d script defaults' to update the order | |
9 | using the script dependencies. | |
10 | ||
11 | For more information see /etc/init.d/README. |
0 | The scripts in this directory are executed each time the system enters | |
1 | this runlevel. | |
2 | ||
3 | The scripts are all symbolic links whose targets are located in | |
4 | /etc/init.d/ . | |
5 | ||
6 | To disable a service in this runlevel, rename its script in this | |
7 | directory so that the new name begins with a 'K' and a two-digit | |
8 | number, and run 'update-rc.d <script> defaults' to reorder the scripts | |
9 | according to dependencies. A warning about the current runlevels | |
10 | being enabled not matching the LSB header in the init.d script will be | |
11 | printed. To re-enable the service, rename the script back to its | |
12 | original name beginning with 'S' and run update-rc.d again. | |
13 | ||
14 | For a more information see /etc/init.d/README. |
0 | debian/src/sysv-rc/doc/* |
0 | 0 | /lib/init/rc /etc/init.d/rc |
1 | 1 | /lib/init/rcS /etc/init.d/rcS |
2 | ||
3 | /usr/share/doc/sysv-rc/init.d-README /etc/init.d/README | |
4 | /usr/share/doc/sysv-rc/rc0.d-README /etc/init.d/README | |
5 | /usr/share/doc/sysv-rc/rc1.d-README /etc/rc1.d/README | |
6 | /usr/share/doc/sysv-rc/rc2-5.d-README /etc/rc2.d/README | |
7 | /usr/share/doc/sysv-rc/rc2-5.d-README /etc/rc3.d/README | |
8 | /usr/share/doc/sysv-rc/rc2-5.d-README /etc/rc4.d/README | |
9 | /usr/share/doc/sysv-rc/rc2-5.d-README /etc/rc5.d/README | |
10 | /usr/share/doc/sysv-rc/rc6.d-README /etc/rc6.d/README | |
11 | /usr/share/doc/sysv-rc/rcS.d-README /etc/rcS.d/README |