Codebase list sysvinit / debian/2.94-2
Merge branch 'release/2.94-2' Dmitry Bogatov 5 years ago
28 changed file(s) with 207 addition(s) and 171 deletion(s). Raw diff Collapse all Expand all
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
013 sysvinit (2.94-1) experimental; urgency=medium
114
215 * New upstream release (Closes: #923371, #671589)
4242 # Function that starts the daemon/service
4343 #
4444
45 # Return
46 # 0 if daemon has been started
47 # 1 if daemon was already running
48 # 2 if daemon could not be started
4945 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
6149 }
6250
6351 do_start()
6755 fi
6856 [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
6957 call do_start_cmd
70 case "$?" in
58 retval=$?
59 case ${retval} in
7160 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
7261 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
7362 esac
7463 if is_call_implemented do_start_cleanup ; then
7564 call do_start_cleanup
65 else
66 return ${retval}
7667 fi
7768 }
7869
8071 # Function that stops the daemon/service
8172 #
8273
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
8874 do_stop_cmd() {
8975 start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \
9076 $STOP_ARGS \
11399 fi
114100 [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
115101 call do_stop_cmd
116 case "$?" in
102 retval=$?
103 case ${retval} in
117104 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
118105 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
119106 esac
120107 if is_call_implemented do_stop_cleanup ; then
121108 call do_stop_cleanup
109 else
110 return ${retval}
122111 fi
123112 }
124113
129118 [ "$VERBOSE" != no ] && log_daemon_msg "Restarting $DESC" "$NAME"
130119 call do_stop_cmd
131120 call do_start_cmd
132 case "$?" in
121 retval=$?
122 case ${retval} in
133123 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
134124 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
135125 esac
136126 if is_call_implemented do_restart_cleanup ; then
137127 call do_restart_cleanup
128 else
129 return ${retval}
138130 fi
139131 }
140132
2626 /etc/default/rcS
2727 /etc/default/tmpfs
2828 /etc/network/if-up.d/mountnfs
29 /etc/rc.local
1616 exit 0
1717 ;;
1818 esac
19
20 if [ -f /etc/rc.local.dpkg-old ] ; then
21 mv /etc/rc.local.dpkg-old /etc/rc.local
22 fi
1923
2024 umask 022
2125
4848
4949 #DEBHELPER#
5050
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
9494 sed -i -ne '/sysvinit (2.86.ds1-47)/q' -e p \
9595 $(rctmp)$(doc)/sysv-rc/changelog.Debian
9696
97 override_dh_fixperms:
98 dh_fixperms -X/etc/init.d/skeleton -X/etc/init.d/README
99
10097 override_dh_installdeb-arch:
10198 dh_installdeb
10299
122119 rm -rf $(inittmp)/etc/hurd
123120 endif
124121
125 override_dh_installdeb-indep:
126 dh_installdeb
127
128 # Neither rc, rcS nor README are conffiles
129 $(RM) $(rctmp)/DEBIAN/conffiles
130
131122 override_dh_clean:
132123 dh_clean
133124 $(MAKE) -C src clobber
2626 find $(DESTDIR)/lib -type d -name .svn -print0 |xargs -r0 rm -r
2727 chmod 755 $(DESTDIR)$(sysconfdir)/init.d/[a-z]*
2828 chmod 755 $(DESTDIR)$(sysconfdir)/network/if-up.d/[a-z]*
29 chmod 755 $(DESTDIR)$(sysconfdir)/rc.local
2930 chmod 644 $(DESTDIR)/lib/init/*.sh
3031 chmod -R g-w $(DESTDIR)
3132 chown -R root:root $(DESTDIR)
00 # Default behaviour of shutdown -h / halt. Set to "halt" or "poweroff".
11 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
2525 esac
2626
2727 # Create /var/run/utmp so we can login.
28 : > /var/run/utmp
28 true > /var/run/utmp
2929 if grep -q ^utmp: /etc/group
3030 then
3131 chmod 664 /var/run/utmp
1111 PATH=/sbin:/usr/sbin:/bin:/usr/bin
1212
1313 . /lib/lsb/init-functions
14 [ -f /etc/default/halt ] && . /etc/default/halt
1415
1516 do_stop () {
1617 # Message should end with a newline since kFreeBSD may
1718 # print more stuff (see #323749)
1819 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}
2025 }
2126
2227 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
1818 # able to introduce a symlink here. As an extra precaution,
1919 # set noclobber.
2020 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 ; }
2222 return 0
2323 }
2424
5454 that \fI/run/nologin\fP does not exist.
5555
5656 .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.
6163
6264 .IP \fBFSCKFIX\fP
6365 When the root and all other file systems are checked,
1313 $(INSTALL) -d $(DESTDIR)$(docdir)/.
1414 $(INSTALL) -d $(DESTDIR)/var/lib/insserv
1515 $(INSTALL) -d $(DESTDIR)$(sysconfdir)/.
16 $(INSTALL_DATA) doc/* $(DESTDIR)$(docdir)/.
17 cp -af etc/* $(DESTDIR)$(sysconfdir)
1816 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)
2817
2918 $(INSTALL) -d $(DESTDIR)/usr/share/sysv-rc/.
3019 $(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
-60
debian/src/sysv-rc/etc/init.d/README less more
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
-11
debian/src/sysv-rc/etc/rc0.d/README less more
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
-11
debian/src/sysv-rc/etc/rc1.d/README less more
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
-11
debian/src/sysv-rc/etc/rc6.d/README less more
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
-12
debian/src/sysv-rc/etc/rcS.d/README less more
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
-15
debian/src/sysv-rc/rc2-5.d-README less more
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/*
00 /lib/init/rc /etc/init.d/rc
11 /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