3 # Check for daemon presence
4 test -x /usr/sbin/acpid || exit 0
6 # Check for ACPI support on kernel side
7 [ -d /proc/acpi ] || exit 0
9 # Include acpid defaults if available
11 if [ -f /etc/default/acpid ] ; then
16 . /lib/lsb/init-functions
19 if [ "x$VERBOSE" = "xno" ]; then
20 MODPROBE_OPTIONS="$MODPROBE_OPTIONS -Q"
21 export MODPROBE_OPTIONS
24 # As the name says. If the kernel supports modules, it'll try to load
25 # the ones listed in "MODULES".
27 PRINTK=`cat /proc/sys/kernel/printk`
28 [ "$VERBOSE" = no ] && echo "0 0 0 0" > /proc/sys/kernel/printk
30 LIST=`/sbin/lsmod|awk '!/Module/ {print $1}'`
32 # Get list of available modules
33 LOC="/lib/modules/`uname -r`/kernel/drivers/acpi"
34 LOC2="/lib/modules/`uname -r`/kernel/ubuntu/acpi"
36 MODAVAIL=`( find $LOC -type f -name "*.o" -printf "basename %f .o\n"; \
37 find $LOC -type f -name "*.ko" -printf "basename %f .ko\n" ) | /bin/sh`
43 MODAVAIL="$MODAVAIL `( find $LOC2 -type f -name "*.o" -printf "basename %f .o\n"; \
44 find $LOC2 -type f -name "*.ko" -printf "basename %f .ko\n" ) | /bin/sh`"
47 if [ "$MODULES" = "all" ]; then
51 if [ -n "$MODULES" ]; then
52 log_begin_msg "Loading ACPI modules..."
54 for mod in $MODULES; do
55 echo $MODAVAIL | grep -q -w "$mod" || continue
56 if echo $LIST | grep -q -w "$mod"; then
57 [ "$VERBOSE" != no ] && log_success_msg "Module already loaded: $mod"
59 if modprobe -b $mod 2>/dev/null; then
60 [ "$VERBOSE" != no ] && log_success_msg "Loaded module: $mod"
62 if [ "$VERBOSE" != no ]; then
63 log_warning_msg "Unable to load module: $mod"
70 echo "$PRINTK" > /proc/sys/kernel/printk
75 [ -f /proc/modules ] && load_modules
76 log_begin_msg "Starting ACPI services..."
77 start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/acpid -- -c /etc/acpi/events $OPTIONS
81 log_begin_msg "Stopping ACPI services..."
82 start-stop-daemon --stop --quiet --oknodo --retry 2 --exec /usr/sbin/acpid
91 log_begin_msg "Reloading ACPI services..."
92 start-stop-daemon --stop --signal 1 --exec /usr/sbin/acpid
96 log_success_msg "Usage: /etc/init.d/acpid {start|stop|restart|reload|force-reload}"
102 # INIT script to check whether we're on batteries, and so start with laptop
105 # BUGS: unless we start *really* late, we have no way of throttling
106 # xscreensaver, since it won't be there to command.
107 . /usr/share/acpi-support/power-funcs
109 test -f /lib/lsb/init-functions || exit 1
110 . /lib/lsb/init-functions
112 test -d /var/lib/acpi-support || exit 0
118 log_begin_msg "Checking battery state..."
120 # Source everything in /etc/acpi/start.d/
121 for SCRIPT in /etc/acpi/start.d/*.sh; do
127 log_begin_msg "Disabling power management..."
128 /etc/acpi/power.sh stop
138 # alsa-utils initscript
141 # Provides: alsa-utils
142 # Required-Start: $remote_fs
143 # Required-Stop: $remote_fs
146 # Short-Description: Restore and store ALSA driver settings
147 # Description: This script stores and restores mixer levels on
148 # shutdown and bootup.On sysv-rc systems: to
149 # disable storing of mixer levels on shutdown,
150 # remove /etc/rc[06].d/K50alsa-utils. To disable
151 # restoring of mixer levels on bootup, rename the
152 # "S50alsa-utils" symbolic link in /etc/rcS.d/ to
156 # Don't use set -e; check exit status instead
158 # Exit silently if package is no longer installed
159 [ -x /sbin/alsactl ] || exit 0
161 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
162 MYNAME=/etc/init.d/alsa-utils
164 . /lib/lsb/init-functions
168 log_action_end_msg_and_exit()
170 log_action_end_msg "$1" ${2:+"$2"}
177 # If which is not available then we must be running before
178 # /usr is mounted on a system that has which in /usr/bin/.
179 # Conclude that $1 is not executable.
180 [ -x /bin/which ] || [ -x /usr/bin/which ] || return 1
181 which "$1" >/dev/null 2>&1
184 # Wait for filesystems to show up
185 while [ ! -d /usr/bin -o ! -d /var/lib/alsa ]; do
189 executable amixer || { echo "${MYNAME}: Error: No amixer program available." >&2 ; exit 1 ; }
191 bugout() { echo "${MYNAME}: Programming error" >&2 ; exit 123 ; }
193 # $1 <card ID> | "all"
196 [ -f /var/lib/alsa/asound.state ] || return 1
198 [ "$1" = all ] && CARD=""
199 # Assume that if alsactl prints a message on stderr
200 # then it failed somehow. This works around the fact
201 # that alsactl doesn't return nonzero status when it
202 # can't restore settings for the card
203 if MSG="$(alsactl restore $CARD 2>&1 >/dev/null)" && [ ! "$MSG" ] ; then
206 # Retry with the "force" option. This restores more levels
207 # but it results in much longer error messages.
208 alsactl -F restore $CARD >/dev/null 2>&1
209 [ -z "$CARD" ] && log_action_cont_msg "warning: 'alsactl restore' failed with error message '$MSG'"
214 # $1 <card ID> | "all"
218 [ "$1" = all ] && CARD=""
219 if MSG="$(alsactl store $CARD 2>&1)" ; then
223 [ -z "$CARD" ] && log_action_cont_msg "warning: 'alsactl store' failed with error message '$MSG'"
230 if [ -f /proc/asound/cards ] ; then
231 sed -n -e's/^[[:space:]]*\([0-7]\)[[:space:]].*/\1/p' /proc/asound/cards
235 filter_amixer_output()
238 -e '/Unable to find simple control/d' \
239 -e '/Unknown playback setup/d' \
243 # The following functions try to set many controls.
244 # No card has all the controls and so some of the attempts are bound to fail.
245 # Because of this, the functions can't return useful status values.
250 unmute_and_set_level()
252 { [ "$2" ] && [ "$CARDOPT" ] ; } || bugout
253 amixer $CARDOPT -q set "$1" "$2" unmute 2>&1 | filter_amixer_output || :
259 mute_and_zero_level()
261 { [ "$1" ] && [ "$CARDOPT" ] ; } || bugout
262 amixer $CARDOPT -q set "$1" "0%" mute 2>&1 | filter_amixer_output || :
271 { [ "$2" ] && [ "$CARDOPT" ] ; } || bugout
272 amixer $CARDOPT -q set "$1" "$2" 2>&1 | filter_amixer_output || :
277 sanify_levels_on_card()
281 unmute_and_set_level "Front" "80%"
282 unmute_and_set_level "Master" "80%"
283 unmute_and_set_level "Master Mono" "80%" # See Bug#406047
284 unmute_and_set_level "Master Digital" "80%" # E.g., cs4237B
285 unmute_and_set_level "Playback" "80%"
286 unmute_and_set_level "Headphone" "70%"
287 unmute_and_set_level "PCM" "80%"
288 unmute_and_set_level "PCM,1" "80%" # E.g., ess1969
289 unmute_and_set_level "DAC" "80%" # E.g., envy24, cs46xx
290 unmute_and_set_level "DAC,0" "80%" # E.g., envy24
291 unmute_and_set_level "DAC,1" "80%" # E.g., envy24
292 unmute_and_set_level "Synth" "80%"
293 unmute_and_set_level "CD" "80%"
295 mute_and_zero_level "Mic"
296 mute_and_zero_level "IEC958" # Ubuntu #19648
298 # Intel P4P800-MX (Ubuntu bug #5813)
299 switch_control "Master Playback Switch" on
300 switch_control "Master Surround" on
302 # Trident/YMFPCI/emu10k1:
303 unmute_and_set_level "Wave" "80%"
304 unmute_and_set_level "Music" "80%"
305 unmute_and_set_level "AC97" "80%"
308 unmute_and_set_level "Dynamic Range Compression" "80%"
310 # Required for HDA Intel (hda-intel):
311 unmute_and_set_level "Front" "80%"
313 # Required for SB Live 7.1/24-bit (ca0106):
314 unmute_and_set_level "Analog Front" "80%"
316 # Required at least for Via 823x hardware on DFI K8M800-MLVF Motherboard with kernels 2.6.10-3/4 (see ubuntu #7286):
317 switch_control "IEC958 Capture Monitor" off
319 # Required for hardware allowing toggles for AC97 through IEC958,
320 # valid values are 0, 1, 2, 3. Needs to be set to 0 for PCM1.
321 unmute_and_set_level "IEC958 Playback AC97-SPSA" "0"
323 # Required for newer Via hardware (see Ubuntu #31784)
324 unmute_and_set_level "VIA DXS,0" "80%"
325 unmute_and_set_level "VIA DXS,1" "80%"
326 unmute_and_set_level "VIA DXS,2" "80%"
327 unmute_and_set_level "VIA DXS,3" "80%"
329 # Required on some notebooks with ICH4:
330 switch_control "Headphone Jack Sense" off
331 switch_control "Line Jack Sense" off
333 # Some machines need one or more of these to be on;
334 # others need one or more of these to be off:
336 # switch_control "External Amplifier" on
337 switch_control "Audigy Analog/Digital Output Jack" on
338 switch_control "SB Live Analog/Digital Output Jack" on
340 # D1984 -- Thinkpad T61/X61
341 switch_control "Speaker" on
342 switch_control "Headphone" on
344 # HDA-Intel w/ "Digital" capture mixer (See Ubuntu #193823)
345 unmute_and_set_level "Digital" "80%"
350 # $1 <card ID> | "all"
353 TTSDML_RETURNSTATUS=0
356 for CARD in $(echo_card_indices) ; do
357 sanify_levels_on_card "$CARD" || TTSDML_RETURNSTATUS=1
361 sanify_levels_on_card "$1" || TTSDML_RETURNSTATUS=1
364 return $TTSDML_RETURNSTATUS
368 preinit_levels_on_card()
372 # Silly dance to activate internal speakers by default on PowerMac
373 # Snapper and Tumbler
374 id=`cat /proc/asound/card$1/id 2>/dev/null`
375 if [ "$id" = "Snapper" -o "$id" = "Tumbler" ]; then
376 switch_control "Auto Mute" off
377 switch_control "PC Speaker" off
378 switch_control "Auto Mute" on
382 # $1 <card ID> | "all"
385 TTSDML_RETURNSTATUS=0
388 for CARD in $(echo_card_indices) ; do
389 preinit_levels_on_card "$CARD" || TTSDML_RETURNSTATUS=1
393 preinit_levels_on_card "$1" || TTSDML_RETURNSTATUS=1
396 return $TTSDML_RETURNSTATUS
400 mute_and_zero_levels_on_card()
422 mute_and_zero_level "$CTL"
425 # "Audigy Analog/Digital Output Jack" \
426 # "SB Live Analog/Digital Output Jack"
428 # switch_control "$CTL" off
433 # $1 <card ID> | "all"
434 mute_and_zero_levels()
439 for CARD in $(echo_card_indices) ; do
440 mute_and_zero_levels_on_card "$CARD" || TTZML_RETURNSTATUS=1
444 mute_and_zero_levels_on_card "$1" || TTZML_RETURNSTATUS=1
447 return $TTZML_RETURNSTATUS
451 # $1 <card ID> | "all"
455 if [ "$1" = all ] ; then
459 [ -d "/proc/asound/card$1" ] || [ -d "/proc/asound/$1" ]
464 # If a card identifier is provided in $2 then regard it as an error
465 # if that card is not present; otherwise don't regard it as an error.
471 case "$TARGET_CARD" in
472 ""|all) TARGET_CARD=all ; log_action_begin_msg "Setting up ALSA" ;;
474 if ! card_OK "$TARGET_CARD"; then
475 [ "$TARGET_CARD" = "all" ] && log_action_end_msg "$( [ ! "$2" ] ; echo $? ; )" "none loaded"
478 preinit_levels "$TARGET_CARD" || EXITSTATUS=1
479 if ! restore_levels "$TARGET_CARD" ; then
480 sanify_levels "$TARGET_CARD" || EXITSTATUS=1
481 restore_levels "$TARGET_CARD" >/dev/null 2>&1 || :
483 [ "$TARGET_CARD" = "all" ] && log_action_end_msg_and_exit "$EXITSTATUS"
489 case "$TARGET_CARD" in
490 ""|all) TARGET_CARD=all ; log_action_begin_msg "Shutting down ALSA" ;;
491 *) log_action_begin_msg "Shutting down ALSA card ${TARGET_CARD}" ;;
493 card_OK "$TARGET_CARD" || log_action_end_msg_and_exit "$( [ ! "$2" ] ; echo $? ; )" "none loaded"
494 store_levels "$TARGET_CARD" || EXITSTATUS=1
495 mute_and_zero_levels "$TARGET_CARD" || EXITSTATUS=1
496 log_action_end_msg_and_exit "$EXITSTATUS"
498 restart|force-reload)
500 $0 stop || EXITSTATUS=1
501 $0 start || EXITSTATUS=1
506 case "$TARGET_CARD" in
507 ""|all) TARGET_CARD=all ; log_action_begin_msg "Resetting ALSA" ;;
508 *) log_action_begin_msg "Resetting ALSA card ${TARGET_CARD}" ;;
510 card_OK "$TARGET_CARD" || log_action_end_msg_and_exit "$( [ ! "$2" ] ; echo $? ; )" "none loaded"
511 preinit_levels "$TARGET_CARD"
512 sanify_levels "$TARGET_CARD"
513 log_action_end_msg_and_exit "$?"
516 echo "Usage: $MYNAME {start [CARD]|stop [CARD]|restart [CARD]|reset [CARD]}" >&2
523 # apache2 This init.d script is used to start apache2.
524 # It basically just calls apache2ctl.
526 ENV="env -i LANG=C PATH=/usr/local/bin:/usr/bin:/bin"
528 #edit /etc/default/apache2 to change this.
532 if [ -x /usr/sbin/apache2 ] ; then
538 . /lib/lsb/init-functions
540 test -f /etc/default/rcS && . /etc/default/rcS
541 test -f /etc/default/apache2 && . /etc/default/apache2
542 if [ "$NO_START" != "0" -a "$1" != "stop" ]; then
543 [ "$VERBOSE" != "no" ] && log_warning_msg "Not starting apache2 - edit /etc/default/apache2 and change NO_START to be 0.";
547 APACHE2="$ENV /usr/sbin/apache2"
548 APACHE2CTL="$ENV /usr/sbin/apache2ctl"
553 AP_CONF=/etc/apache2/apache2.conf
555 # apache2 allows more than PidFile entry in the config but only the
556 # last found in the config is used; we attempt to follow includes
557 # here, but only first-level includes are supported, not nested ones
559 for i in $AP_CONF `awk '$1 ~ /^\s*[Ii]nclude$/ && $2 ~ /^\// {print $2}' $AP_CONF`; do
560 PIDFILE=`grep -i ^PidFile $i | tail -n 1 | awk '{print $2}'`
561 if [ -e "$PIDFILE" ]; then
566 errors=`$APACHE2 -t 2>&1`
568 # if the config is ok than we just stop normaly
579 [ ! -d /proc/$PID ] && break
583 if [ "$VERBOSE" != "no" ]; then
585 echo "Apache2 failed to honor the stop command, please investigate the situation by hand."
593 if [ "$VERBOSE" != "no" ]; then
594 echo -n " ... no pidfile found! not running?"
599 [ "$VERBOSE" != "no" ] && echo "$errors"
601 # if we are here something is broken and we need to try
602 # to exit as nice and clean as possible
604 # if pidof is null for some reasons the script exits automagically
605 # classified as good/unknown feature
606 PIDS=`pidof apache2` || true
609 # if there is a pid we need to verify that belongs to apache2
612 if [ "$i" = "$PID" ]; then
613 # in this case the pid stored in the
614 # pidfile matches one of the pidof apache
615 # so a simple kill will make it
620 if [ $REALPID = 1 ]; then
621 # in this case everything is nice and dandy
622 # and we kill apache2
625 # this is the worst situation... just kill all of them
629 # Except, we can't do that, because it's very, very bad
630 if [ "$PIDS" ] && [ "$VERBOSE" != "no" ]; then
632 echo "You may still have some apache2 processes running. There are"
633 echo "processes named 'apache2' which do not match your pid file,"
634 echo "and in the name of safety, we've left them alone. Please review"
635 echo "the situation by hand."
642 # Stupid hack to keep lintian happy. (Warrk! Stupidhack!).
645 [ -f /etc/apache2/httpd.conf ] || touch /etc/apache2/httpd.conf
646 # ssl_scache shouldn't be here if we're just starting up.
647 [ -f /var/run/apache2/ssl_scache ] && rm -f /var/run/apache2/*ssl_scache*
648 # /var/run and /var/lock could be on a tmpfs
649 [ ! -d /var/run/apache2 ] && mkdir /var/run/apache2
650 [ ! -d /var/lock/apache2 ] && mkdir /var/lock/apache2
651 # Make sure /var/lock/apache2 has the correct permissions
652 chown www-data /var/lock/apache2
654 log_begin_msg "Starting apache 2.0 web server..."
655 if $APACHE2CTL startssl; then
662 log_begin_msg "Stopping apache 2.0 web server..."
670 log_begin_msg "Reloading apache 2.0 configuration..."
671 if $APACHE2CTL graceful $2 ; then
677 restart | force-reload)
678 log_begin_msg "Forcing reload of apache 2.0 web server..."
679 if ! apache_stop; then
682 if $APACHE2CTL startssl; then
692 echo "Usage: /etc/init.d/apache2 start|stop|restart|reload|force-reload" >&2
699 # Required-Start: $syslog $time $local_fs $remote_fs
700 # Required-Stop: $syslog $time $local_fs $remote_fs
701 # Default-Start: 2 3 4 5
702 # Default-Stop: S 0 1 6
703 # Short-Description: Deferred execution scheduler
704 # Description: Debian init script for the atd deferred executions
708 # Author: Ryan Murray <rmurray@debian.org>
712 PATH=/bin:/usr/bin:/sbin:/usr/sbin
715 test -x $DAEMON || exit 0
717 . /lib/lsb/init-functions
721 log_daemon_msg "Starting deferred execution scheduler" "atd"
726 log_daemon_msg "Stopping deferred execution scheduler" "atd"
730 force-reload|restart)
735 echo "Usage: /etc/init.d/atd {start|stop|restart|force-reload}"
743 # Provides: binfmt-support
744 # Required-Start: $local_fs $remote_fs
745 # Required-Stop: $local_fs $remote_fs
746 # Default-Start: 2 3 4 5
747 # Default-Stop: 0 1 6
748 # Short-Description: Support for extra binary formats
749 # Description: Enable support for extra binary formats using the Linux
750 # kernel's binfmt_misc facility.
753 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
755 DESC="additional executable binary formats"
757 test -x /usr/sbin/update-binfmts || exit 0
759 . /lib/lsb/init-functions
767 log_daemon_msg "Enabling $DESC" "$NAME"
768 update-binfmts --enable || CODE=$?
774 log_daemon_msg "Disabling $DESC" "$NAME"
775 update-binfmts --disable || CODE=$?
780 restart|force-reload)
787 echo "Usage: $N {start|stop|restart|force-reload}" >&2
799 # DO NOT RUN AFTER S:55bootmisc.sh and do not run this script directly
800 # in runlevel S. Instead write an initscript to call it.
805 . /lib/lsb/init-functions
807 # Should be called outside verbose message block
810 # Prevent symlink attack (See #264234.)
811 [ -L "$1" ] && log_warning_msg "bootclean: Deleting symbolic link '$1'."
812 rm -f "$1" || { log_failure_msg "bootclean: Failure deleting '$1'." ; return 1 ; }
813 # No user processes should be running, so no one should be able to introduce
814 # a symlink here. As an extra precaution, set noclobber.
816 :> "$1" || { log_failure_msg "bootclean: Failure creating '$1'." ; return 1 ; }
821 cd /tmp || { log_failure_msg "bootclean: Could not cd to /tmp." ; return 1 ; }
824 # Only clean out /tmp if it is world-writable. This ensures
825 # it really is a/the temp directory we're cleaning.
827 [ "$(find . -maxdepth 0 -perm -002)" = "." ] || return 0
831 log_warning_msg "Using default TMPTIME 0."
835 [ "$VERBOSE" = no ] || log_action_begin_msg "Cleaning /tmp"
838 # Remove regardless of TMPTIME setting
843 # Don't clean remaining files if TMPTIME is negative or 'infinite'
846 -*|infinite|infinity)
847 [ "$VERBOSE" = no ] || log_action_end_msg 0 "skipped"
853 # Wipe /tmp, excluding system files, but including lost+found
855 # If TMPTIME is set to 0, we do not use any ctime expression
856 # at all, so we can also delete files with timestamps
859 if [ "$TMPTIME" = 0 ]
864 TEXPR="-mtime +$TMPTIME -ctime +$TMPTIME -atime +$TMPTIME"
865 DEXPR="-mtime +$TMPTIME -ctime +$TMPTIME"
869 ! ( -path ./lost+found -uid 0 )
870 ! ( -path ./quota.user -uid 0 )
871 ! ( -path ./aquota.user -uid 0 )
872 ! ( -path ./quota.group -uid 0 )
873 ! ( -path ./aquota.group -uid 0 )
874 ! ( -path ./.journal -uid 0 )
875 ! ( -path ./.clean -uid 0 )
876 ! ( -path './...security*' -uid 0 )'
878 mkflagfile /tmp/.clean || return 1
882 if [ "$VERBOSE" = no ]
884 log_failure_msg "bootclean: Failure cleaning /tmp."
886 log_action_end_msg 1 "bootclean: Failure cleaning /tmp"
891 # First remove all old files...
892 # (Use xargs here so that only one additional process gets created)
894 find . -depth -xdev $TEXPR $EXCEPT ! -type d \
895 -print0 | xargs -0r rm -f -- \
896 || { report_err ; return 1 ; }
899 # ...and then all empty directories
900 # (Don't use xargs here because dirs must be removed one by one from
903 find . -depth -xdev $DEXPR $EXCEPT -type d -empty \
904 -exec rmdir \{\} \; \
905 || { report_err ; return 1 ; }
907 [ "$VERBOSE" = no ] || log_action_end_msg 0
911 which find >/dev/null 2>&1 || exit 1
912 which xargs >/dev/null 2>&1 || exit 1
914 # If there are flag files that have not been created by root
920 which stat >/dev/null 2>&1 && cleanuid="$(stat -c %u $D/.clean)"
921 # Poor's man stat %u, since stat (and /usr) might not be
922 # available in some bootup stages
923 [ "$cleanuid" ] || cleanuid="$(find $D/.clean -printf %U)"
924 [ "$cleanuid" ] || { log_failure_msg "bootclean: Could not stat '$D/.clean'." ; exit 1 ; }
925 if [ "$cleanuid" -ne 0 ]
927 rm -f $D/.clean || { log_failure_msg "bootclean: Could not delete '$D/.clean'." ; exit 1 ; }
932 [ -f /tmp/.clean ] && exit 0
935 [ -d /tmp ] && ! [ -f /tmp/.clean ] && { clean_tmp || ES=1 ; }
941 # Required-Start: mountdevsubfs
945 # Short-Description: Start or stop bootlogd.
946 # Description: Starts or stops the bootlogd log program
947 # which logs boot messages.
951 DAEMON=/sbin/bootlogd
952 [ -x "$DAEMON" ] || exit 0
955 BOOTLOGD_OPTS="-r -c"
956 [ -r /etc/default/bootlogd ] && . /etc/default/bootlogd
959 . /lib/lsb/init-functions
961 # Because bootlogd is broken on some systems, we take the special measure
962 # of requiring it to be enabled by setting an environment variable.
963 case "$BOOTLOGD_ENABLE" in
969 # Previously this script was symlinked as "stop-bootlogd" which, when run
970 # with the "start" argument, should stop bootlogd. Now stop-bootlogd is
971 # a distinct script, but for backward compatibility this script continues
972 # to implement the old behavior.
974 SCRIPTNAME=${SCRIPTNAME#[SK]??}
978 [ "$ACTION" = start ] && ACTION=stop
985 log_daemon_msg "Starting $DESC" "$NAME"
989 start-stop-daemon --start --quiet --exec $DAEMON -- \
993 $DAEMON $BOOTLOGD_OPTS
999 PATH=/sbin:/bin:/usr/sbin:/usr/bin
1000 log_daemon_msg "Stopping $DESC" "$NAME"
1001 start-stop-daemon --stop --quiet --exec $DAEMON
1005 if [ -f /var/log/boot ] && [ -f /var/log/boot~ ]
1007 [ "$VERBOSE" = no ] || log_action_begin_msg "Moving boot log file"
1008 # bootlogd writes to boot, making backup at boot~
1011 savelog -q -p -c 5 boot \
1016 [ "$VERBOSE" = no ] || log_action_end_msg $ES
1019 restart|force-reload)
1020 /etc/init.d/bootlogd stop
1021 /etc/init.d/bootlogd start
1024 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
1032 # Provides: bootmisc
1033 # Required-Start: $local_fs hostname $remote_fs
1034 # Required-Stop: $local_fs
1037 # Short-Description: Miscellaneous things to be done during bootup.
1041 PATH=/usr/sbin:/usr/bin:/sbin:/bin
1042 [ "$DELAYLOGIN" ] || DELAYLOGIN=yes
1047 # If login delaying is enabled then create the flag file
1048 # which prevents logins before startup is complete
1050 case "$DELAYLOGIN" in
1052 echo "System bootup in progress - please wait" > /var/lib/initscripts/nologin
1056 # Create /var/run/utmp so we can login.
1058 if grep -q ^utmp: /etc/group
1060 chmod 664 /var/run/utmp
1061 chgrp utmp /var/run/utmp
1064 # Set pseudo-terminal access permissions.
1065 if [ ! -e /dev/.devfsd ] && [ -c /dev/ttyp0 ]
1067 chmod -f 666 /dev/tty[p-za-e][0-9a-f]
1068 chown -f root:tty /dev/tty[p-za-e][0-9a-f]
1072 uname -snrvm > /var/run/motd
1073 [ -f /etc/motd.tail ] && cat /etc/motd.tail >> /var/run/motd
1075 # Save kernel messages in /var/log/dmesg
1076 if which dmesg >/dev/null 2>&1
1078 savelog -q -p -c 5 /var/log/dmesg
1079 dmesg -s 524288 > /var/log/dmesg
1080 chgrp adm /var/log/dmesg || :
1081 elif [ -c /dev/klog ]
1083 savelog -q -p -c 5 /var/log/dmesg
1084 dd if=/dev/klog of=/var/log/dmesg &
1087 [ -f /var/log/dmesg ] && { chgrp adm /var/log/dmesg || : ; }
1090 # Remove bootclean's flag files.
1091 # Don't run bootclean again after this!
1099 restart|reload|force-reload)
1100 echo "Error: argument '$1' not supported" >&2
1107 echo "Usage: bootmisc.sh [start|stop]" >&2
1116 # Required-Start: modutils checkroot
1118 # Should-Start: lvm cryptdisks
1122 # Short-Description: Check all filesystems.
1126 FSCK_LOGFILE=/var/log/fsck/checkfs
1127 [ "$FSCKFIX" ] || FSCKFIX=no
1129 . /lib/init/usplash-fsck-functions.sh
1131 . /lib/lsb/init-functions
1133 # Always output fsck progress
1134 stdin=`readlink /proc/self/fd/0`
1135 if [ "${stdin#/dev/null}" != "$stdin" ]; then
1136 exec </dev/console >/dev/console 2>&1
1140 # See if we're on AC Power
1141 # If not, we're not gonna run our check
1142 if which on_ac_power >/dev/null 2>&1
1144 on_ac_power >/dev/null 2>&1
1147 [ "$VERBOSE" = no ] || log_success_msg "Running on battery power, so skipping file system check."
1153 # Check the rest of the file systems.
1155 if [ ! -f /fastboot ] && [ ! "$BAT" ] && [ "$FSCKTYPES" != "none" ]
1157 if [ -f /forcefsck ]
1163 if [ "$FSCKFIX" = yes ]
1171 dumb|network|unknown|"")
1175 [ "$(uname -m)" = s390 ] && spinner="" # This should go away
1177 [ "$FSCKTYPES" ] && FSCKTYPES_OPT="-t $FSCKTYPES"
1178 handle_failed_fsck() {
1179 log_failure_msg "File system check failed.
1180 A log is being saved in ${FSCK_LOGFILE} if that location is writable.
1181 Please repair the file system manually."
1182 log_warning_msg "A maintenance shell will now be started.
1183 CONTROL-D will terminate this shell and resume system boot."
1184 # Start a single user shell on the console
1185 if ! sulogin $CONSOLE
1187 log_failure_msg "Attempt to start maintenance shell failed.
1188 Continuing with system boot in 5 seconds."
1192 if [ "$VERBOSE" = no ]
1194 log_action_begin_msg "Checking file systems"
1195 if pidof usplash; then
1196 PROGRESS_FILE=`mktemp` || exit 1
1198 logsave -s $FSCK_LOGFILE fsck -C3 -R -A $fix $force $FSCKTYPES_OPT >/dev/console 2>&1 3>$PROGRESS_FILE &
1200 usplash_progress "$PROGRESS_FILE"
1201 rm -f $PROGRESS_FILE
1203 logsave -s $FSCK_LOGFILE fsck $spinner -R -A $fix $force $FSCKTYPES_OPT
1207 if [ "$FSCKCODE" -gt 1 ]
1209 log_action_end_msg 1 "code $FSCKCODE"
1212 log_action_end_msg 0
1217 log_action_msg "Will now check all file systems of types $FSCKTYPES"
1219 log_action_msg "Will now check all file systems"
1221 logsave -s $FSCK_LOGFILE fsck $spinner -V -R -A $fix $force $FSCKTYPES_OPT
1223 if [ "$FSCKCODE" -gt 1 ]
1227 log_success_msg "Done checking file systems.
1228 A log is being saved in ${FSCK_LOGFILE} if that location is writable."
1232 rm -f /fastboot /forcefsck
1239 restart|reload|force-reload)
1240 echo "Error: argument '$1' not supported" >&2
1247 echo "Usage: checkfs.sh [start|stop]" >&2
1255 # Provides: checkroot
1256 # Required-Start: mountdevsubfs
1258 # Should-Start: keymap hwclockfirst
1262 # Short-Description: Check to root file system.
1265 PATH=/lib/init:/sbin:/bin
1266 FSCK_LOGFILE=/var/log/fsck/checkroot
1267 [ "$FSCKFIX" ] || FSCKFIX=no
1268 [ "$SULOGIN" ] || SULOGIN=no
1270 . /lib/init/usplash-fsck-functions.sh
1272 . /lib/lsb/init-functions
1274 # Always output fsck progress
1275 stdin=`readlink /proc/self/fd/0`
1276 if [ "${stdin#/dev/null}" != "$stdin" ]; then
1277 exec </dev/console >/dev/console 2>&1
1282 # Set SULOGIN in /etc/default/rcS to yes if you want a sulogin to
1283 # be spawned from this script *before anything else* with a timeout,
1286 [ "$SULOGIN" = yes ] && sulogin -t 30 $CONSOLE
1288 KERNEL="$(uname -s)"
1289 MACHINE="$(uname -m)"
1292 # Read /etc/fstab, looking for:
1293 # 1) The root filesystem, resolving LABEL=*|UUID=* entries to the
1295 # 2) Swap that is on a md device or a file that may be on a md
1297 # 3) The mount parameters for a devfs filesystem.
1300 exec 9<&0 </etc/fstab
1312 while read DEV MTPT FSTYPE OPTS DUMP PASS JUNK
1319 [ "$FSTYPE" = "swap" ] && swap_on_lv=yes
1324 if [ "$MTPT" = "/" ] && which findfs >/dev/null 2>&1
1326 DEV="$(findfs "$DEV")"
1330 [ "$FSTYPE" = "swap" ] && swap_on_file=yes
1333 # Devfs definition ?
1334 if [ "$FSTYPE" = "devfs" ] && [ "$MTPT" = "/dev" ] && mountpoint -q /dev
1336 devfs="-t $FSTYPE $DEV $MTPT"
1340 [ "$MTPT" != "/" ] && continue
1345 ( [ "$PASS" != 0 ] && [ "$PASS" != "" ] ) && rootcheck=yes
1346 ( [ "$FSTYPE" = "nfs" ] || [ "$FSTYPE" = "nfs4" ] ) && rootcheck=no
1348 ro|ro,*|*,ro|*,ro,*)
1357 # Activate the swap device(s) in /etc/fstab. This needs to be done
1358 # before fsck, since fsck can be quite memory-hungry.
1363 if [ "$swap_on_lv" = yes ]
1365 [ "$VERBOSE" = no ] || log_warning_msg "Not activating swap on logical volume."
1366 elif [ "$swap_on_file" = yes ]
1368 [ "$VERBOSE" = no ] || log_warning_msg "Not activating swap on swapfile."
1377 if [ "$ENABLE_SWAP" = yes ]
1379 if [ "$VERBOSE" = no ]
1381 log_action_begin_msg "Activating swap"
1382 swapon -a -e >/dev/null 2>&1
1383 log_action_end_msg $?
1385 log_action_msg "Will now activate swap"
1390 log_success_msg "Done activating swap."
1392 log_failure_msg "Swap activation failed with error code ${ES}."
1398 # Does the root device in /etc/fstab match with the actual device ?
1399 # If not we try to use the /dev/root alias device, and if that
1400 # fails we create a temporary node in /dev/shm.
1402 if [ "$rootcheck" = yes ]
1404 ddev="$(mountpoint -qx $rootdev)"
1405 rdev="$(mountpoint -d /)"
1406 if [ "$ddev" != "$rdev" ] && [ "$ddev" != "4:0" ]
1408 if [ "$(mountpoint -qx /dev/root)" = "4:0" ]
1413 rm -f /dev/shm/root \
1414 && mknod -m 600 /dev/shm/root b ${rdev%:*} ${rdev#*:} \
1415 && [ -e /dev/shm/root ]
1417 rootdev=/dev/shm/root
1426 # Bother, said Pooh.
1428 if [ "$rootfatal" = yes ]
1430 log_failure_msg "The device node $rootdev for the root filesystem is missing or incorrect
1431 or there is no entry for the root filesystem listed in /etc/fstab.
1432 The system is also unable to create a temporary node in /dev/shm.
1433 This means you have to fix the problem manually."
1434 log_warning_msg "A maintenance shell will now be started.
1435 CONTROL-D will terminate this shell and restart the system."
1436 # Start a single user shell on the console
1437 if ! sulogin $CONSOLE
1439 log_failure_msg "Attempt to start maintenance shell failed.
1440 Will restart in 5 seconds."
1443 [ "$VERBOSE" = no ] || log_action_msg "Will now restart"
1447 # See if we're on AC Power
1448 # If not, we're not gonna run our check
1449 if which on_ac_power >/dev/null 2>&1 && [ "$rootcheck" = yes ]
1451 if [ -d /proc/acpi ]; then
1452 modprobe ac >/dev/null 2>&1
1454 on_ac_power >/dev/null 2>&1
1457 log_warning_msg "On battery power, so skipping file system check."
1463 # See if we want to check the root file system.
1468 [ "$rootcheck" = yes ] && log_warning_msg "Fast boot enabled, so skipping file system check."
1472 if [ "$rootcheck" = yes ]
1475 # Ensure that root is quiescent and read-only before fsck'ing.
1477 # mount -n -o remount,ro / would be the correct syntax but
1478 # mount can get confused when there is a "bind" mount defined
1479 # in fstab that bind-mounts "/" somewhere else.
1481 # So we use mount -n -o remount,ro $rootdev / but that can
1482 # fail on older kernels on sparc64/alpha architectures due
1483 # to a bug in sys_mount().
1485 # As a compromise we try both.
1488 ! mount -n -o remount,ro $rootdev / \
1489 && ! mount -n -o remount,ro -t dummytype $rootdev / 2>/dev/null \
1490 && ! mount -n -o remount,ro / 2>/dev/null
1492 log_failure_msg "Cannot check root file system because it is not mounted read-only."
1498 # The actual checking is done here.
1500 if [ "$rootcheck" = yes ]
1502 if [ -f /forcefsck ]
1509 if [ "$FSCKFIX" = yes ]
1518 dumb|network|unknown|"")
1521 # This Linux/s390 special case should go away.
1522 if [ "${KERNEL}:${MACHINE}" = Linux:s390 ]
1527 if [ "$VERBOSE" = no ]
1529 log_action_begin_msg "Checking root file system"
1530 if [ "$roottype" = "ext2" -o "$roottype" = "ext3" ] && pidof usplash; then
1531 PROGRESS_FILE=`mktemp -p /var/run` || PROGRESS_FILE=/var/run/checkroot_fsck
1533 logsave -s $FSCK_LOGFILE fsck -C3 $force $fix -t $roottype $rootdev >/dev/console 2>&1 3>$PROGRESS_FILE &
1535 usplash_progress "$PROGRESS_FILE"
1536 rm -f $PROGRESS_FILE
1538 logsave -s $FSCK_LOGFILE fsck $spinner $force $fix -t $roottype $rootdev
1541 if [ "$FSCKCODE" = 0 ]
1543 log_action_end_msg 0
1545 log_action_end_msg 1 "code $FSCKCODE"
1548 log_action_msg "Will now check root file system"
1549 logsave -s $FSCK_LOGFILE fsck $spinner $force $fix -V -t $roottype $rootdev
1551 if [ "$FSCKCODE" = 0 ]
1553 log_success_msg "Done checking root file system.
1554 A log will be saved in ${FSCK_LOGFILE} if that location is writable."
1556 log_failure_msg "Root file system check failed with error code ${FSCKCODE}.
1557 A log is being saved in ${FSCK_LOGFILE} if that location is writable."
1563 # If there was a failure, drop into single-user mode.
1565 # NOTE: "failure" is defined as exiting with a return code of
1566 # 4 or larger. A return code of 1 indicates that file system
1567 # errors were corrected but that the boot may proceed. A return
1568 # code of 2 or 3 indicates that the system should immediately reboot.
1570 if [ "$FSCKCODE" -gt 3 ]
1572 # Surprise! Re-directing from a HERE document (as in "cat << EOF")
1573 # does not work because the root is currently read-only.
1574 log_failure_msg "An automatic file system check (fsck) of the root filesystem failed.
1575 A manual fsck must be performed, then the system restarted.
1576 The fsck should be performed in maintenance mode with the
1577 root filesystem mounted in read-only mode."
1578 log_warning_msg "The root filesystem is currently mounted in read-only mode.
1579 A maintenance shell will now be started.
1580 After performing system maintenance, press CONTROL-D
1581 to terminate the maintenance shell and restart the system."
1582 # Start a single user shell on the console
1583 if ! sulogin $CONSOLE
1585 log_failure_msg "Attempt to start maintenance shell failed.
1586 Will restart in 5 seconds."
1589 [ "$VERBOSE" = no ] || log_action_msg "Will now restart"
1591 elif [ "$FSCKCODE" -gt 1 ]
1593 log_failure_msg "The file system check corrected errors on the root partition
1594 but requested that the system be restarted."
1595 log_warning_msg "The system will be restarted in 5 seconds."
1597 [ "$VERBOSE" = no ] || log_action_msg "Will now restart"
1602 # Remount root to final mode (rw or ro).
1604 # See the comments above at the previous "mount -o remount"
1605 # for an explanation why we try this twice.
1607 if ! mount -n -o remount,$rootopts,$rootmode $fstabroot / 2>/dev/null
1609 mount -n -o remount,$rootopts,$rootmode /
1613 # We only create/modify /etc/mtab if the location where it is
1614 # stored is writable. If /etc/mtab is a symlink into /proc/
1615 # then it is not writable.
1618 MTAB_PATH="$(readlink -f /etc/mtab || :)"
1619 case "$MTAB_PATH" in
1623 if touch "$MTAB_PATH" >/dev/null 2>&1
1631 [ -L /etc/mtab ] && MTAB_PATH="$(readlink /etc/mtab)"
1634 log_failure_msg "Cannot initialize ${MTAB_PATH}."
1636 log_failure_msg "Cannot initialize /etc/mtab."
1640 log_failure_msg "Illegal mtab location '${MTAB_PATH}'."
1644 if [ "$INIT_MTAB_FILE" = yes ]
1646 [ "$roottype" != none ] &&
1647 mount -f -o $rootopts -t $roottype $fstabroot /
1648 [ "$devfs" ] && mount -f $devfs
1652 # Remove /dev/shm/root if we created it.
1661 restart|reload|force-reload)
1662 echo "Error: argument '$1' not supported" >&2
1669 echo "Usage: checkroot.sh [start|stop]" >&2
1677 # This file was automatically customized by debmake on Fri, 6 Nov 1998 23:00:08 -0600
1679 # Written by Miquel van Smoorenburg <miquels@drinkel.ow.org>.
1680 # Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>.
1681 # Modified for Debian by Christoph Lameter <clameter@debian.org>
1682 # Modified for chrony by John Hasler <jhasler@debian.org> 10 Nov 1998
1684 PATH=/bin:/usr/bin:/sbin:/usr/sbin
1685 DAEMON=/usr/sbin/chronyd
1690 test -f $DAEMON || exit 0
1694 start-stop-daemon --start --verbose --exec $DAEMON
1697 start-stop-daemon --stop --verbose --oknodo --exec $DAEMON
1699 restart|force-reload)
1701 # If the "reload" option is implemented, move the "force-reload"
1702 # option to the "reload" entry above. If not, "force-reload" is
1703 # just the same as "restart".
1705 echo -n "Restarting $DESC: "
1706 start-stop-daemon --stop --quiet --exec $DAEMON
1708 start-stop-daemon --start --quiet --exec $DAEMON -- -r
1712 echo "Usage: /etc/init.d/chrony {start|stop|restart|force-reload}"
1720 # Provides: console-screen
1721 # Required-Start: $local_fs $remote_fs
1722 # Required-Stop: $local_fs $remote_fs
1723 # Default-Start: S 2 3 4 5
1724 # Default-Stop: 0 1 6
1725 # Should-Start: $syslog
1727 # Description: Set console screen modes and fonts
1728 # Short-Description: Prepare console
1732 # This is the boot script for the `console-tools' package.
1734 # It loads parameters from /etc/console-tools/config, maybe loads
1735 # default screen-font, screen font-map, and application charset-map,
1736 # and maybe start "vcstime"
1738 # (c) 1997 Yann Dirson
1740 # If setupcon is present, then we've been superseded by console-setup.
1741 if type setupcon >/dev/null 2>&1; then
1745 # check if usplash is runing and skip this, we'll get run again later
1746 if pidof usplash > /dev/null; then
1750 if [ -r /etc/console-tools/config ] ; then
1751 . /etc/console-tools/config
1754 if [ -d /etc/console-tools/config.d ]; then
1755 for i in `run-parts --list /etc/console-tools/config.d `; do
1760 . /lib/lsb/init-functions
1762 PATH=/sbin:/bin:/usr/sbin:/usr/bin
1763 SETFONT="/usr/bin/consolechars"
1765 CHARSET="/usr/bin/charset"
1766 VCSTIME="/usr/sbin/vcstime"
1768 # Different device name for 2.6 kernels and devfs
1769 if [ `uname -r | cut -f 2 -d .` = 6 ] && [ -e /dev/.devfsd ]; then
1770 VCSTIME_OPT="-2 /dev/vcsa0"
1777 # set DEVICE_PREFIX depending on devfs/udev
1778 if [ -d /dev/vc ]; then
1779 DEVICE_PREFIX="/dev/vc/"
1781 DEVICE_PREFIX="/dev/tty"
1784 reset_vga_palette ()
1786 if [ -f /proc/fb ]; then
1787 # They have a framebuffer device.
1788 # That means we have work to do...
1795 # be sure the main program is installed
1796 [ -x "${SETFONT}" ] || return 0
1799 # If we can't access the console, quit
1800 CONSOLE_TYPE=`fgconsole 2>/dev/null` || return 0
1802 if [ ! $CONSOLE_TYPE = "serial" ] ; then
1803 readlink /proc/self/fd/0 | grep -q -e /dev/vc -e '/dev/tty[^p]' -e /dev/console
1804 if [ $? -eq 0 ] ; then
1810 [ $VT = "no" ] && return 0
1813 if [ "${DO_VCSTIME}" = "yes" -a -x ${VCSTIME} ] ; then
1814 [ "$VERBOSE" != "no" ] && log_action_begin_msg "Starting clock on text console"
1815 ${VCSTIME} ${VCSTIME_OPT} &
1816 [ "$VERBOSE" != "no" ] && log_action_end_msg 0
1820 # Global default font+sfm
1821 if [ "${SCREEN_FONT}" ]
1823 [ "$VERBOSE" != "no" ] && log_action_begin_msg "Setting up general console font"
1824 SCREEN_FONT="-f ${SCREEN_FONT}"
1826 # maybe use an external SFM
1827 [ "${SCREEN_FONT_MAP}" ] && SCREEN_FONT_MAP="-u ${SCREEN_FONT_MAP}"
1829 # Try to be cleverer and run for all consoles, but this is run
1830 # _before_ getty and so only one console running. So,
1831 # Set for the first 6 VCs (as they are allocated in /etc/inittab)
1832 NUM_CONSOLES=`fgconsole --next-available`
1833 NUM_CONSOLES=$(($NUM_CONSOLES - 1))
1834 [ ${NUM_CONSOLES} -eq 1 ] && NUM_CONSOLES=6
1836 while [ $i -le $NUM_CONSOLES ]
1838 if ! ${SETFONT} --tty=${DEVICE_PREFIX}$i ${SETFONT_OPT} ${SCREEN_FONT} ${SCREEN_FONT_MAP} ; then
1839 [ "$VERBOSE" != "no" ] && log_action_end_msg 1
1841 elif [ "$i" -eq "$NUM_CONSOLES" ]; then
1842 [ "$VERBOSE" != "no" ] && log_action_end_msg 0
1850 VCS="`set | grep '^SCREEN_FONT_vc[0-9]*=' | sed -e 's/^SCREEN_FONT_vc//' -e 's/=.*//'`"
1853 [ "$VERBOSE" != "no" ] && log_action_begin_msg "Setting up per-VC fonts"
1856 # extract FONTNAME info from variable setting
1857 eval font=\$SCREEN_FONT_vc$vc
1858 # eventually find an associated SFM
1859 eval sfm=\${SCREEN_FONT_MAP_vc${vc}}
1860 [ "$sfm" ] && sfm="-u $sfm"
1862 ${SETFONT} --tty=${DEVICE_PREFIX}$vc ${SETFONT_OPT} -f $font $sfm
1864 [ "$VERBOSE" != "no" ] && log_action_end_msg 0
1869 [ "${APP_CHARSET_MAP}" ] && ${CHARSET} G0 ${APP_CHARSET_MAP}
1873 VCS="`set | grep '^APP_CHARSET_MAP_vc[0-9]*=' | sed -e 's/^APP_CHARSET_MAP_vc//' -e 's/=.*//'`"
1876 [ "$VERBOSE" != "no" ] && log_action_begin_msg "Setting up per-VC ACM\'s"
1879 # extract FONTNAME info from variable setting
1880 eval acm=\$APP_CHARSET_MAP_vc$vc
1881 ${CHARSET} --tty="${DEVICE_PREFIX}$vc" G0 "$acm"
1883 [ "$VERBOSE" != "no" ] && log_action_end_msg 0
1887 # Go to UTF-8 mode as necessary
1890 [ -r /etc/environment ] && ENV_FILE="/etc/environment"
1891 [ -r /etc/default/locale ] && ENV_FILE="/etc/default/locale"
1892 [ "$ENV_FILE" ] && CHARMAP=$(set -a && . "$ENV_FILE" && locale charmap)
1893 if test "$CHARMAP" = "UTF-8"
1895 unicode_start 2> /dev/null || true
1897 unicode_stop 2> /dev/null|| true
1902 if [ "$BLANK_TIME" ]; then
1903 setterm_args="$setterm_args -blank $BLANK_TIME"
1905 if [ "$BLANK_DPMS" ]; then
1906 setterm_args="$setterm_args -powersave $BLANK_DPMS"
1908 if [ "$POWERDOWN_TIME" ]; then
1909 setterm_args="$setterm_args -powerdown $POWERDOWN_TIME"
1911 if [ "$setterm_args" ]; then
1912 setterm $setterm_args
1915 # Keyboard rate and delay
1917 if [ -n "$KEYBOARD_RATE" ]; then
1918 KBDRATE_ARGS="-r $KEYBOARD_RATE"
1920 if [ -n "$KEYBOARD_DELAY" ]; then
1921 KBDRATE_ARGS="$KBDRATE_ARGS -d $KEYBOARD_DELAY"
1923 if [ -n "$KBDRATE_ARGS" ]; then
1924 [ "$VERBOSE" != "no" ] && log_action_begin_msg "Setting keyboard rate and delay"
1925 kbdrate -s $KBDRATE_ARGS
1926 [ "$VERBOSE" != "no" ] && log_action_end_msg 0
1929 # Inform gpm if present, of potential changes.
1930 if [ -f /var/run/gpm.pid ]; then
1931 kill -WINCH `cat /var/run/gpm.pid` 2> /dev/null
1934 # Allow user to remap keys on the console
1935 if [ -r /etc/console-tools/remap ]
1937 dumpkeys < ${DEVICE_PREFIX}1 | sed -f /etc/console-tools/remap | loadkeys --quiet
1940 if [ "$LEDS" != "" ]
1943 while [ $i -le $NUM_CONSOLES ]
1945 setleds -D $LEDS < $DEVICE_PREFIX$i
1952 start|reload|restart|force-reload)
1953 log_action_msg "Setting console screen modes and fonts"
1963 # Start/stop the cron daemon.
1967 # Required-Start: $syslog $time
1968 # Required-Stop: $syslog $time
1969 # Default-Start: 2 3 4 5
1970 # Default-Stop: 0 1 6
1971 # Short-Description: Regular background program processing daemon
1972 # Description: cron is a standard UNIX program that runs user-specified
1973 # programs at periodic scheduled times. vixie cron adds a
1974 # number of features to the basic UNIX cron, including better
1975 # security and more powerful configuration options.
1979 test -f /usr/sbin/cron || exit 0
1981 #LSBNAMES='-l' # Uncomment for LSB name support in /etc/cron.d/
1983 . /lib/lsb/init-functions
1986 start) log_daemon_msg "Starting periodic command scheduler" "crond"
1987 start-stop-daemon --start --quiet --pidfile /var/run/crond.pid --name cron --startas /usr/sbin/cron -- $LSBNAMES
1990 stop) log_daemon_msg "Stopping periodic command scheduler" "crond"
1991 start-stop-daemon --stop --quiet --pidfile /var/run/crond.pid --name cron
1994 restart) log_daemon_msg "Restarting periodic command scheduler" "crond"
1995 start-stop-daemon --stop --retry 5 --quiet --pidfile /var/run/crond.pid --name cron
1996 start-stop-daemon --start --quiet --pidfile /var/run/crond.pid --name cron --startas /usr/sbin/cron -- $LSBNAMES
1999 reload|force-reload) log_daemon_msg "Reloading configuration files for periodic command scheduler" "crond"
2000 # cron reloads automatically
2003 *) log_action_msg "Usage: /etc/init.d/cron {start|stop|restart|reload|force-reload}"
2011 # Required-Start: $remote_fs $syslog
2012 # Required-Stop: $remote_fs $syslog
2013 # Default-Start: 2 3 4 5
2015 # Short-Description: D-Bus systemwide message bus
2016 # Description: D-Bus is a simple interprocess messaging system, used
2017 # for sending messages between applications.
2019 # -*- coding: utf-8 -*-
2020 # Debian init.d script for D-BUS
2021 # Copyright © 2003 Colin Walters <walters@debian.org>
2022 # Copyright © 2005 Sjoerd Simons <sjoerd@debian.org>
2026 DAEMON=/usr/bin/dbus-daemon
2027 UUIDGEN=/usr/bin/dbus-uuidgen
2028 UUIDGEN_OPTS=--ensure
2030 DAEMONUSER=messagebus
2031 PIDDIR=/var/run/dbus
2033 DESC="system message bus"
2034 EVENTDIR=/etc/dbus-1/event.d
2036 test -x $DAEMON || exit 0
2038 . /lib/lsb/init-functions
2040 # Source defaults file; edit that file to configure this script.
2042 if [ -e /etc/default/dbus ]; then
2046 if [ -n "$ENABLED" ]; then
2047 log_warning_msg "The ENABLED option in /etc/default/$NAME has been deprecated."
2048 log_warning_msg "Please remove this setting from the configuration file."
2049 log_warning_msg "To disable the service use a runlevel editor like sysv-rc-conf or bum instead."
2052 create_machineid() {
2053 # Create machine-id file
2054 if [ -x $UUIDGEN ]; then
2055 $UUIDGEN $UUIDGEN_OPTS
2059 dependent_services()
2061 # Do nothing if we are called by init
2062 [ ! -z $runlevel ] && return
2064 # Determine current runlevel
2065 r=$(/sbin/runlevel) || true
2068 # Do nothing if we can't determine the runlevel (e.g. inside chroots)
2069 [ "$r" = "unknown" ] && return
2071 if [ "$1" = "stop" ] ; then
2079 # Get the list of services active in this runlevel
2080 if [ -d /etc/rc${r}.d/ ] ; then # sysv-rc
2081 services=$(grep -s -l "^# Required-Start:.*dbus" /etc/rc${r}.d/S??* | sort $param)
2082 elif [ -f /etc/runlevel.conf ] ; then # file-rc
2083 list=$(grep -s -l "^# Required-Start:.*dbus" /etc/init.d/* || true)
2084 services=$( for i in $list ; do
2085 grep -E "^[[:digit:]]{2}[[:space:]]+([0-9,S]+|[-])[[:space:]]+.*$r.*[[:space:]]+$i$" /etc/runlevel.conf
2086 done | sort $param | awk '{print $4}' )
2089 log_warning_msg "Unable to determine dependent services: unknown init system"
2092 # Start the services in the correct order
2093 for i in $services ; do
2094 service=$(basename $i)
2095 service=${service#S??}
2096 invoke-rc.d $service $action || true
2104 if [ ! -d $PIDDIR ]; then
2106 chown $DAEMONUSER $PIDDIR
2107 chgrp $DAEMONUSER $PIDDIR
2110 if ! mountpoint -q /proc/ ; then
2111 log_failure_msg "Can't start $DESC - /proc is not mounted"
2115 if [ -e $PIDFILE ]; then
2116 PIDDIR=/proc/$(cat $PIDFILE)
2117 if [ -d ${PIDDIR} -a "$(readlink -f ${PIDDIR}/exe)" = "${DAEMON}" ]; then
2118 log_success_msg "$DESC already started; not starting."
2121 log_success_msg "Removing stale PID file $PIDFILE."
2128 log_daemon_msg "Starting $DESC" "$NAME"
2129 start-stop-daemon --start --quiet --pidfile $PIDFILE \
2130 --user $DAEMONUSER --exec $DAEMON -- --system $PARAMS
2132 if [ -d $EVENTDIR ]; then
2133 run-parts --arg=start $EVENTDIR || true
2135 dependent_services start
2140 dependent_services stop
2141 if [ -d $EVENTDIR ]; then
2142 run-parts --reverse --arg=stop $EVENTDIR || true
2144 log_daemon_msg "Stopping $DESC" "$NAME"
2145 start-stop-daemon --stop --retry 5 --quiet --oknodo --pidfile $PIDFILE \
2147 # We no longer include these arguments so that start-stop-daemon
2148 # can do its job even given that we may have been upgraded.
2149 # We rely on the pidfile being sanely managed
2150 # --exec $DAEMON -- --system $PARAMS
2158 log_action_begin_msg "Reloading $DESC config"
2159 dbus-send --print-reply --system --type=method_call \
2160 --dest=org.freedesktop.DBus \
2161 / org.freedesktop.DBus.ReloadConfig > /dev/null
2162 # hopefully this is enough time for dbus to reload it's config file.
2163 log_action_end_msg $?
2173 reload|force-reload)
2181 echo "Usage: /etc/init.d/$NAME {start|stop|reload|restart|force-reload}" >&2
2188 # $Id: dns-clean,v 1.1.1.1 2004/05/07 03:12:59 john Exp $
2190 # dns-clean by John Hasler 1999-2003
2191 # Any possessor of a copy of this program may treat it as if it
2192 # were in the public domain. I waive all rights.
2194 # This script should be run at bootup to clean up any mess left by 0dns-up.
2195 # It should be run before ppp is started.
2196 # It should never be run while ppp is up.
2199 # Provides: dns-clean
2200 # Required-Start: $local_fs
2201 # Required-Stop: $local_fs
2204 # Short-Description: Cleans up any mess left by 0dns-up
2205 # Description: 0dns-up often leaves behind some cruft. This Script is meant
2206 # to clean up any such mess.
2209 PATH=/sbin:/bin:/usr/sbin:/usr/bin
2211 test -f /usr/sbin/pppconfig || exit 0
2212 # We might have a tmpfs /var/run.
2213 mkdir /var/run/pppconfig >/dev/null 2>&1 || true
2214 test -f /etc/ppp/ip-down.d/0dns-down || exit 0
2216 . /lib/lsb/init-functions
2221 [ "$VERBOSE" != no ] && log_begin_msg "Restoring resolver state..."
2222 /etc/ppp/ip-down.d/0dns-down "0dns-clean"
2223 [ "$VERBOSE" != no ] && log_end_msg $?
2225 stop|restart|force-reload)
2237 # evms Enterprise Volume Management System
2239 # Written by Miquel van Smoorenburg <miquels@cistron.nl>.
2240 # Modified for Debian GNU/Linux
2241 # by Ian Murdock <imurdock@gnu.ai.mit.edu>.
2242 # Modified for evms package
2243 # by Matt Zimmerman <mdz@debian.org>
2248 # Default-Start: 2 3 4 5
2249 # Default-Stop: 0 1 6
2252 # Short-Description: Activates EVMS volumes
2253 # Description: Activates any EVMS volumes that are left unactivated
2254 # by the initramfs for some reason (or if the user does
2255 # not use initramfs). This possibly includes setting up
2256 # RAID, LVM, snapshots, BBR etc., but does not start a
2260 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
2262 DESC="Enterprise Volume Management System"
2264 test -x /sbin/evms_activate || exit 0
2266 . /lib/lsb/init-functions
2272 start|reload|restart|force-reload)
2273 log_begin_msg "Starting $DESC..."
2275 if [ "$VERBOSE" != no ]; then
2276 evms_activate || status=$?
2278 # Messages are still written to the log
2279 evms_activate >/dev/null 2>&1 || status=$?
2286 echo "no daemons started by this script"
2291 log_success_msg "Usage: $N {start|stop|restart|reload|force-reload|status}"
2299 # Originally based on:
2300 # Version: @(#)skeleton 1.8 03-Mar-1998 miquels@cistron.nl
2302 # Modified for gdm, Steve Haslam <steve@arise.dmeon.co.uk> 14mar99
2303 # modified to remove --exec, as it does not work on upgrades. 18jan2000
2304 # modified to use --name, to detect stale PID files 18mar2000
2305 # sleep until gdm dies, then restart it 16jul2000
2306 # get along with other display managers (Branden Robinson, Ryan Murray) 05sep2001
2310 # To start gdm even if it is not the default display manager, change
2311 # HEED_DEFAULT_DISPLAY_MANAGER to "false."
2312 HEED_DEFAULT_DISPLAY_MANAGER=true
2313 DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
2314 PATH=/sbin:/bin:/usr/sbin:/usr/bin
2315 DAEMON=/usr/sbin/gdm
2316 PIDFILE=/var/run/gdm.pid
2317 UPGRADEFILE=/var/run/gdm.upgrade
2319 if [ -e $UPGRADEFILE -a "$1" != "restart" -a "$1" != "force-reload" ]; then
2320 SSD_ARG="--startas $DAEMON"
2323 SSD_ARG="--exec $DAEMON"
2326 # Allow cdd to override the config
2327 if [ -f /etc/gdm/gdm-cdd.conf ]; then
2328 CONFIG_FILE="--config=/etc/gdm/gdm-cdd.conf"
2331 test -x $DAEMON || exit 0
2333 if [ -r /etc/environment ]; then
2334 if LANG=$(pam_getenv -l LANG); then
2337 if LANGUAGE=$(pam_getenv -l LANGUAGE); then
2343 . /lib/lsb/init-functions
2347 if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" -a "$HEED_DEFAULT_DISPLAY_MANAGER" = "true" -a "$(cat $DEFAULT_DISPLAY_MANAGER_FILE 2>/dev/null)" != "$DAEMON" ]; then
2348 log_warning_msg "Not starting GNOME Display Manager (gdm); it is not the default display manager."
2350 # if usplash is runing, make sure to stop it now, yes "start" kills it.
2351 if pidof usplash > /dev/null; then
2352 /etc/init.d/usplash start
2354 log_begin_msg "Starting GNOME Display Manager..."
2355 start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --name gdm $SSD_ARG -- $CONFIG_FILE >/dev/null 2>&1 || log_end_msg 1
2360 log_begin_msg "Stopping GNOME Display Manager..."
2361 start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --name gdm $SSD_ARG --retry 30 >/dev/null 2>&1
2365 log_begin_msg "Reloading GNOME Display Manager configuration..."
2366 log_warning_msg "Changes will take effect when all current X sessions have ended."
2367 start-stop-daemon --stop --signal USR1 --quiet --pidfile \
2368 $PIDFILE --name gdm $SSD_ARG >/dev/null 2>&1
2371 restart|force-reload)
2376 log_success_msg "Usage: /etc/init.d/gdm {start|stop|restart|reload|force-reload}"
2393 # This script detects deprecated kernel versions incompatible with
2394 # the current version of the glibc
2396 # glibc kernel version check: KERNEL_VERSION_CHECK
2397 linux_compare_versions () {
2398 verA=$(($(echo "$1" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 10000 + \2 \* 100 + \3/')))
2399 verB=$(($(echo "$3" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 10000 + \2 \* 100 + \3/')))
2401 test $verA -$2 $verB
2404 kfreebsd_compare_versions () {
2405 verA=$(($(echo "$1" | sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \* 100 + \2/')))
2406 verB=$(($(echo "$3" | sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \* 100 + \2/')))
2408 test $verA -$2 $verB
2413 echo "The installation of a 2.6 kernel _could_ ask you to install a new libc"
2414 echo "first, this is NOT a bug, and should *NOT* be reported. In that case,"
2415 echo "please add etch sources to your /etc/apt/sources.list and run:"
2416 echo " apt-get install -t etch linux-image-2.6"
2417 echo "Then reboot into this new kernel, and proceed with your upgrade"
2426 if [ "$system" = "Linux" ]
2428 # Test to make sure z < 255, in x.y.z-n form of kernel version
2429 # Also make sure we don't trip on x.y.zFOO-n form
2430 #kernel_rev=$(uname -r | tr -- - . | cut -d. -f3 | tr -d '[:alpha:]')
2431 kernel_rev=$(uname -r | sed 's/\([0-9]*\.[0-9]*\.\)\([0-9]*\)\(.*\)/\2/')
2432 if [ "$kernel_rev" -ge 255 ]
2434 echo "WARNING: Your kernel version indicates a revision number"
2435 echo "of 255 or greater. Glibc has a number of built in"
2436 echo "assumptions that this revision number is less than 255."
2437 echo "If you\'ve built your own kernel, please make sure that any"
2438 echo "custom version numbers are appended to the upstream"
2439 echo "kernel number with a dash or some other delimiter."
2444 # sanity checking for the appropriate kernel on each architecture.
2446 kernel_ver=`uname -r`
2448 # convert "armv4l" and similar to just "arm", and "mips64" and similar
2451 arm*) realarch="arm";;
2452 mips*) realarch="mips";;
2456 # From glibc 2.3.5-7 real-i386 is dropped.
2457 if [ "$realarch" = i386 ]
2459 echo "WARNING: This machine has real i386 class processor."
2460 echo "Debian etch and later does not support such old hardware"
2462 echo "The reason is that \"bswap\" instruction is not supported"
2463 echo "on i386 class processors, and some core libraries have"
2464 echo "such instruction. You\'ll see illegal instruction error"
2465 echo "when you upgrade your Debian system."
2469 # arm boxes require __ARM_NR_set_tls in the kernel to function properly.
2470 if [ "$realarch" = arm ]
2472 if linux_compare_versions "$kernel_ver" lt 2.6.12
2474 echo WARNING: This version of glibc requires that you be running
2475 echo kernel version 2.6.12 or later. Earlier kernels contained
2476 echo bugs that may render the system unusable if a modern version
2477 echo of glibc is installed.
2483 # Alpha and HPPA boxes require latest fixes in the kernel to function properly.
2484 if [ "$realarch" = parisc -o "$realarch" = alpha ]
2486 if linux_compare_versions "$kernel_ver" lt 2.6.9
2488 echo WARNING: This version of glibc requires that you be running
2489 echo kernel version 2.6.9 or later. Earlier kernels contained
2490 echo bugs that may render the system unusable if a modern version
2491 echo of glibc is installed.
2497 # sh4 boxes require kernel version 2.6.11 minimum
2498 if [ "$realarch" = sh4 ]
2500 if linux_compare_versions "$kernel_ver" lt 2.6.11
2502 echo WARNING: This version of glibc requires that you be running
2503 echo kernel version 2.6.11 or later. Earlier kernels contained
2504 echo bugs that may render the system unusable if a modern version
2505 echo of glibc is installed.
2511 # The GNU libc requires 2.6 kernel (except on m68k) because we drop to
2512 # support linuxthreads
2513 if [ "$realarch" != m68k ]
2515 if linux_compare_versions "$kernel_ver" lt 2.6.8
2517 echo WARNING: POSIX threads library NPTL requires kernel version
2518 echo 2.6.8 or later. If you use a kernel 2.4, please upgrade it
2519 echo before installing glibc.
2525 # The GNU libc is now built with --with-kernel= >= 2.4.1 on m68k
2526 if [ "$realarch" = m68k ]
2528 if linux_compare_versions "$kernel_ver" lt 2.4.1
2530 echo WARNING: This version of glibc requires that you be running
2531 echo kernel version 2.4.1 or later. Earlier kernels contained
2532 echo bugs that may render the system unusable if a modern version
2533 echo of glibc is installed.
2539 # From glibc 2.6-3 SPARC V8 support is dropped.
2540 if [ "$realarch" = sparc ]
2542 # The process could be run using linux32, check for /proc.
2543 if [ -f /proc/cpuinfo ]
2545 case "$(sed '/^type/!d;s/^type.*: //g' /proc/cpuinfo)" in
2553 echo "WARNING: This machine has a SPARC V8 or earlier class processor."
2554 echo "Debian lenny and later does not support such old hardware"
2561 elif [ $system = "GNU/kFreeBSD" ] ; then
2562 kernel_ver=`uname -r`
2563 if kfreebsd_compare_versions "$kernel_ver" lt 6.0
2565 echo WARNING: This version of glibc uses UMTX_OP_WAIT and UMTX_OP_WAKE
2566 echo syscalls that are not present in the current running kernel. They
2567 echo have been added in kFreeBSD 6.0. Your system should still work,
2568 echo but it is recommended to upgrade to a more recent version.
2576 # Required-Start: umountroot
2578 # Should-Start: lvm raid2
2582 # Short-Description: Execute the halt command.
2586 PATH=/usr/sbin:/usr/bin:/sbin:/bin
2587 [ -f /etc/default/halt ] && . /etc/default/halt
2589 . /lib/lsb/init-functions
2592 if [ "$INIT_HALT" = "" ]
2607 # See if we need to cut the power.
2608 if [ "$INIT_HALT" = "POWEROFF" ] && [ -x /etc/init.d/ups-monitor ]
2610 /etc/init.d/ups-monitor poweroff
2613 # Don't shut down drives if we're using RAID.
2615 if grep -qs '^md.*active' /proc/mdstat
2620 # If INIT_HALT=HALT don't poweroff.
2622 if [ "$INIT_HALT" = "HALT" ]
2627 log_action_msg "Will now halt"
2629 halt -d -f -i $poweroff $hddown
2636 restart|reload|force-reload)
2637 echo "Error: argument '$1' not supported" >&2
2644 echo "Usage: $0 start|stop" >&2
2652 # Provides: hostname
2657 # Short-Description: Set hostname.
2664 . /lib/lsb/init-functions
2667 [ -f /etc/hostname ] && HOSTNAME="$(cat /etc/hostname)"
2669 # Keep current name if /etc/hostname is missing.
2670 [ -z "$HOSTNAME" ] && HOSTNAME="$(hostname)"
2672 # And set it to 'localhost' if no setting was found
2673 [ -z "$HOSTNAME" ] && HOSTNAME=localhost
2675 [ "$VERBOSE" != no ] && log_action_begin_msg "Setting hostname to '$HOSTNAME'"
2676 hostname "$HOSTNAME"
2678 [ "$VERBOSE" != no ] && log_action_end_msg $ES
2685 restart|reload|force-reload)
2686 echo "Error: argument '$1' not supported" >&2
2693 echo "Usage: hostname.sh [start|stop]" >&2
2698 # hwclock.sh Set and adjust the CMOS clock, according to the UTC
2699 # setting in /etc/default/rcS (see also rcS(5)).
2701 # Version: @(#)hwclock.sh 2.00 14-Dec-1998 miquels@cistron.nl
2704 # 2000-01-30 Henrique M. Holschuh <hmh@rcm.org.br>
2705 # - Minor cosmetic changes in an attempt to help new
2706 # users notice something IS changing their clocks
2707 # during startup/shutdown.
2708 # - Added comments to alert users of hwclock issues
2709 # and discourage tampering without proper doc reading.
2711 # WARNING: Please read /usr/share/doc/util-linux/README.Debian.hwclock
2712 # before changing this file. You risk serious clock
2713 # misbehaviour otherwise.
2716 # Provides: hwclockfirst
2717 # Required-Start: mountdevsubfs
2718 # Required-Stop: umountroot
2723 FIRST=yes # debian/rules sets this to 'yes' when creating hwclockfirst.sh
2725 # Set this to any options you might need to give to hwclock, such
2726 # as machine hardware clock type for Alphas.
2731 [ ! -x /sbin/hwclock ] && return 0
2734 . /lib/lsb/init-functions
2735 verbose_log_action_msg() { [ "$VERBOSE" = no ] || log_action_msg "$@"; }
2737 [ "$GMT" = "-u" ] && UTC="yes"
2739 no|"") GMT="--localtime"
2741 if [ "X$FIRST" = "Xyes" ] && [ ! -r /etc/localtime ]; then
2742 if [ -z "$TZ" ]; then
2743 log_action_msg "System clock was not updated at this time"
2751 *) log_action_msg "Unknown UTC setting: \"$UTC\""; return 1 ;;
2755 no|"") BADYEAR="" ;;
2756 yes) BADYEAR="--badyear" ;;
2757 *) log_action_msg "unknown BADYEAR setting: \"$BADYEAR\""; return 1 ;;
2762 if [ -w /etc ] && [ ! -f /etc/adjtime ] && [ ! -e /etc/adjtime ]; then
2763 echo "0.0 0 0.0" > /etc/adjtime
2766 if [ ! -w /etc/adjtime ]; then
2772 if [ "$FIRST" != yes ]; then
2773 # Uncomment the hwclock --adjust line below if you want
2774 # hwclock to try to correct systematic drift errors in the
2777 # WARNING: If you uncomment this option, you must either make
2778 # sure *nothing* changes the Hardware Clock other than
2779 # hwclock --systohc, or you must delete /etc/adjtime
2780 # every time someone else modifies the Hardware Clock.
2782 # Common "vilains" are: ntp, MS Windows, the BIOS Setup
2785 # WARNING: You must remember to invalidate (delete)
2786 # /etc/adjtime if you ever need to set the system clock
2787 # to a very different value and hwclock --adjust is being
2790 # Please read /usr/share/doc/util-linux/README.Debian.hwclock
2791 # before enabling hwclock --adjust.
2793 #/sbin/hwclock --adjust $GMT $BADYEAR
2797 if [ "$HWCLOCKACCESS" != no ]; then
2798 log_action_msg "Setting the system clock"
2800 # Copies Hardware Clock time to System Clock using the correct
2801 # timezone for hardware clocks in local time, and sets kernel
2802 # timezone. DO NOT REMOVE.
2803 if /sbin/hwclock --hctosys $GMT $HWCLOCKPARS $BADYEAR $NOADJ; then
2804 # Announce the local time.
2805 verbose_log_action_msg "System Clock set to: `date $UTC`"
2807 log_warning_msg "Unable to set System Clock to: `date $UTC`"
2810 verbose_log_action_msg "Not setting System Clock"
2813 stop|restart|reload|force-reload)
2815 # Updates the Hardware Clock with the System Clock time.
2816 # This will *override* any changes made to the Hardware Clock.
2818 # WARNING: If you disable this, any changes to the system
2819 # clock will not be carried across reboots.
2821 if [ "$HWCLOCKACCESS" != no ]; then
2822 log_action_msg "Saving the system clock"
2823 if [ "$GMT" = "-u" ]; then
2826 if /sbin/hwclock --systohc $GMT $HWCLOCKPARS $BADYEAR; then
2827 verbose_log_action_msg "Hardware Clock updated to `date`"
2830 verbose_log_action_msg "Not saving System Clock"
2834 if [ "$HWCLOCKACCESS" != no ]; then
2835 /sbin/hwclock --show $GMT $HWCLOCKPARS $BADYEAR
2839 log_success_msg "Usage: hwclock.sh {start|stop|reload|force-reload|show}"
2840 log_success_msg " start sets kernel (system) clock from hardware (RTC) clock"
2841 log_success_msg " stop and reload set hardware (RTC) clock from kernel (system) clock"
2849 # hwclock.sh Set and adjust the CMOS clock, according to the UTC
2850 # setting in /etc/default/rcS (see also rcS(5)).
2852 # Version: @(#)hwclock.sh 2.00 14-Dec-1998 miquels@cistron.nl
2855 # 2000-01-30 Henrique M. Holschuh <hmh@rcm.org.br>
2856 # - Minor cosmetic changes in an attempt to help new
2857 # users notice something IS changing their clocks
2858 # during startup/shutdown.
2859 # - Added comments to alert users of hwclock issues
2860 # and discourage tampering without proper doc reading.
2862 # WARNING: Please read /usr/share/doc/util-linux/README.Debian.hwclock
2863 # before changing this file. You risk serious clock
2864 # misbehaviour otherwise.
2868 # Required-Start: mountdevsubfs
2869 # Required-Stop: $local_fs
2874 FIRST=no # debian/rules sets this to 'yes' when creating hwclockfirst.sh
2876 # Set this to any options you might need to give to hwclock, such
2877 # as machine hardware clock type for Alphas.
2882 [ ! -x /sbin/hwclock ] && return 0
2885 . /lib/lsb/init-functions
2886 verbose_log_action_msg() { [ "$VERBOSE" = no ] || log_action_msg "$@"; }
2888 [ "$GMT" = "-u" ] && UTC="yes"
2890 no|"") GMT="--localtime"
2892 if [ "X$FIRST" = "Xyes" ] && [ ! -r /etc/localtime ]; then
2893 if [ -z "$TZ" ]; then
2894 log_action_msg "System clock was not updated at this time"
2902 *) log_action_msg "Unknown UTC setting: \"$UTC\""; return 1 ;;
2906 no|"") BADYEAR="" ;;
2907 yes) BADYEAR="--badyear" ;;
2908 *) log_action_msg "unknown BADYEAR setting: \"$BADYEAR\""; return 1 ;;
2913 if [ -w /etc ] && [ ! -f /etc/adjtime ] && [ ! -e /etc/adjtime ]; then
2914 echo "0.0 0 0.0" > /etc/adjtime
2917 if [ ! -w /etc/adjtime ]; then
2923 if [ "$FIRST" != yes ]; then
2924 # Uncomment the hwclock --adjust line below if you want
2925 # hwclock to try to correct systematic drift errors in the
2928 # WARNING: If you uncomment this option, you must either make
2929 # sure *nothing* changes the Hardware Clock other than
2930 # hwclock --systohc, or you must delete /etc/adjtime
2931 # every time someone else modifies the Hardware Clock.
2933 # Common "vilains" are: ntp, MS Windows, the BIOS Setup
2936 # WARNING: You must remember to invalidate (delete)
2937 # /etc/adjtime if you ever need to set the system clock
2938 # to a very different value and hwclock --adjust is being
2941 # Please read /usr/share/doc/util-linux/README.Debian.hwclock
2942 # before enabling hwclock --adjust.
2944 #/sbin/hwclock --adjust $GMT $BADYEAR
2948 if [ "$HWCLOCKACCESS" != no ]; then
2949 log_action_msg "Setting the system clock"
2951 # Copies Hardware Clock time to System Clock using the correct
2952 # timezone for hardware clocks in local time, and sets kernel
2953 # timezone. DO NOT REMOVE.
2954 if /sbin/hwclock --hctosys $GMT $HWCLOCKPARS $BADYEAR $NOADJ; then
2955 # Announce the local time.
2956 verbose_log_action_msg "System Clock set to: `date $UTC`"
2958 log_warning_msg "Unable to set System Clock to: `date $UTC`"
2961 verbose_log_action_msg "Not setting System Clock"
2964 stop|restart|reload|force-reload)
2966 # Updates the Hardware Clock with the System Clock time.
2967 # This will *override* any changes made to the Hardware Clock.
2969 # WARNING: If you disable this, any changes to the system
2970 # clock will not be carried across reboots.
2972 if [ "$HWCLOCKACCESS" != no ]; then
2973 log_action_msg "Saving the system clock"
2974 if [ "$GMT" = "-u" ]; then
2977 if /sbin/hwclock --systohc $GMT $HWCLOCKPARS $BADYEAR; then
2978 verbose_log_action_msg "Hardware Clock updated to `date`"
2981 verbose_log_action_msg "Not saving System Clock"
2985 if [ "$HWCLOCKACCESS" != no ]; then
2986 /sbin/hwclock --show $GMT $HWCLOCKPARS $BADYEAR
2990 log_success_msg "Usage: hwclock.sh {start|stop|reload|force-reload|show}"
2991 log_success_msg " start sets kernel (system) clock from hardware (RTC) clock"
2992 log_success_msg " stop and reload set hardware (RTC) clock from kernel (system) clock"
3002 # Required-Start: mountdevsubfs
3006 # Short-Description: Set keymap
3007 # Description: Set the Console keymap
3010 # If setupcon is present, then we've been superseded by console-setup.
3011 if type setupcon >/dev/null 2>&1; then
3015 . /lib/lsb/init-functions
3018 # Load the keymaps *as soon as possible*
3021 # Don't fail on error
3022 CONSOLE_TYPE=`fgconsole 2>/dev/null` || CONSOLE_TYPE="unknown"
3024 # Don't fail on serial consoles
3027 # fail silently if loadkeys not present (yet).
3028 command -v loadkeys >/dev/null 2>&1 || QUIT=1
3030 CONFDIR=/etc/console
3031 CONFFILEROOT=boottime
3033 CONFFILE=${CONFDIR}/${CONFFILEROOT}.${EXT}.gz
3037 # On Mac PPC machines, we may need to set kernel vars first
3038 # We need to mount /proc to do that; not optimal, as its going to
3039 # be mounted in S10checkroot, but we need it set up before sulogin
3040 # may be run in checkroot, which will need the keyboard to log in...
3041 [ -x /sbin/sysctl ] || return
3042 [ -r /etc/sysctl.conf ] || return
3043 grep -v '^\#' /etc/sysctl.conf | grep -q keycodes
3044 if [ "$?" = "0" ] ; then
3045 grep keycodes /etc/sysctl.conf | grep -v "^#" | while read d ; do
3046 /sbin/sysctl -w $d 2> /dev/null || true
3051 unicode_start_stop()
3053 # Switch unicode mode by checking the locale.
3054 # This will be needed before loading the keymap.
3055 [ -x /usr/bin/unicode_start ] || [ -x /bin/unicode_start ] || return
3056 [ -x /usr/bin/unicode_stop ] || [ -x /bin/unicode_stop ] || return
3059 [ -r /etc/environment ] && ENV_FILE="/etc/environment"
3060 [ -r /etc/default/locale ] && ENV_FILE="/etc/default/locale"
3061 [ $ENV_FILE = none ] && return
3063 for var in LANG LC_ALL LC_CTYPE; do
3064 value=$(egrep "^[^#]*${var}=" $ENV_FILE | tail -n1 | cut -d= -f2)
3068 CHARMAP=`LANG=$LANG LC_ALL=$LC_ALL LC_CTYPE=$LC_CTYPE locale charmap`
3069 if [ "$CHARMAP" = "UTF-8" ]; then
3070 unicode_start 2> /dev/null || true
3072 unicode_stop 2> /dev/null || true
3076 if [ ! $QUIT = '1' ] ; then
3079 start | restart | force-reload | reload)
3081 # Set kernel variables if required
3084 # First mount /proc if necessary...and if it is there (#392798)
3086 if [ -d /proc ]; then
3087 if [ ! -x /proc/$$ ]; then
3093 if [ -f /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes ] ; then
3094 linux_keycodes=`cat /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes`
3103 if [ $linux_keycodes -gt 0 ] ; then
3104 if [ -r ${CONFFILE} ] ; then
3106 # Switch console mode to UTF-8 or ASCII as necessary
3109 if [ $CONSOLE_TYPE = "serial" ] ; then
3110 loadkeys -q ${CONFFILE} 2>&1 > /dev/null
3112 loadkeys -q ${CONFFILE}
3116 # if we've a serial console, we may not have a keyboard, so don't
3117 # complain if we fail.
3118 if [ ! $CONSOLE_TYPE = "serial" ]; then
3119 log_warning_msg "Problem when loading ${CONFDIR}/${CONFFILEROOT}.${EXT}.gz, use install-keymap"
3126 # unmount /proc if we mounted it
3127 [ "$unmount_proc" = "no" ] || umount -n /proc
3135 log_warning_msg "Usage: $0 {start|stop|restart|reload|force-reload}"
3142 # Provides: killprocs
3143 # Required-Start: $local_fs
3147 # Short-Description: executed by init(8) upon entering runlevel 1 (single).
3150 PATH=/usr/sbin:/usr/bin:/sbin:/bin
3152 . /lib/lsb/init-functions
3155 # Kill all processes.
3156 log_action_begin_msg "Sending all processes the TERM signal"
3158 log_action_end_msg 0
3160 log_action_begin_msg "Sending all processes the KILL signal"
3162 log_action_end_msg 0
3164 # We start update here, since we just killed it.
3165 if [ -x /sbin/update ] && [ "$(uname -s)" = Linux ]
3167 case "$(uname -r)" in
3179 restart|reload|force-reload)
3180 echo "Error: argument '$1' not supported" >&2
3187 echo "Usage: $0 start|stop" >&2
3192 # /etc/init.d/klogd: start the kernel log daemon.
3196 # Required-Start: syslog
3197 # Required-Stop: syslog
3198 # Default-Start: S 1 2 3 4 5
3200 # Short-Description: Kernel logger
3203 PATH=/bin:/usr/bin:/sbin:/usr/sbin
3205 pidfile=/var/run/klogd/klogd.pid
3206 kmsgpipe=/var/run/klogd/kmsg
3207 kmsgpidfile=/var/run/klogd/kmsgpipe.pid
3210 test -f $binpath || exit 0
3211 . /lib/lsb/init-functions
3213 # Use KLOGD="-k /boot/System.map-$(uname -r)" to specify System.map
3215 KLOGD="-P $kmsgpipe"
3217 test ! -r /etc/default/klogd || . /etc/default/klogd
3219 . /lib/lsb/init-functions
3223 log_begin_msg "Starting kernel log daemon..."
3224 # create klog-writeable pid and fifo directory
3225 mkdir -p /var/run/klogd
3226 chown klog:klog /var/run/klogd
3227 mkfifo -m 700 $kmsgpipe
3228 chown klog:klog $kmsgpipe
3230 # shovel /proc/kmsg to pipe readable by klogd user
3231 start-stop-daemon --start --pidfile $kmsgpidfile --exec /bin/dd -b -m -- bs=1 if=/proc/kmsg of=$kmsgpipe
3233 # start klogd as non-root with reading from kmsgpipe
3234 start-stop-daemon --start --quiet --chuid klog --exec $binpath -- $KLOGD
3238 log_begin_msg "Stopping kernel log daemon..."
3239 start-stop-daemon --stop --quiet --retry 3 --oknodo --exec $binpath --pidfile $pidfile
3241 start-stop-daemon --stop --quiet --oknodo --pidfile $kmsgpidfile
3242 rm -f $kmsgpidfile $kmsgpipe
3245 restart|force-reload)
3251 log_success_msg "Usage: /etc/init.d/klogd {start|stop|restart|force-reload}"
3258 # chkconfig: - 20 90
3259 # description: Starts and stops "laptop-mode" - tweaks system behavior
3260 # to extend battery life.
3262 # config: /etc/laptop-mode/laptop-mode.conf
3265 # Provides: laptop-mode
3266 # Should-Start: $all
3267 # Required-Start: $local_fs
3268 # Required-Stop: $local_fs
3269 # Default-Start: 2 3 4 5
3270 # Default-Stop: 0 1 6
3271 # Short-Description: Enable laptop-mode-tools power management functions
3272 # Description: Enable laptop-mode-tools power management functions
3276 test -f /usr/sbin/laptop_mode || exit 0
3278 . /lib/lsb/init-functions
3281 if [ -f /etc/default/laptop-mode ]; then
3282 . /etc/default/laptop-mode;
3284 if [ -f /etc/default/acpi-support ]; then
3285 . /etc/default/acpi-support;
3288 if [ x$ENABLE_LAPTOP_MODE = xfalse ]; then
3292 # Enable laptop mode when the system is booted when running on battery.
3296 log_action_begin_msg "Enabling laptop mode"
3297 mkdir -p /var/run/laptop-mode-tools
3298 touch /var/run/laptop-mode-tools/enabled
3299 /usr/sbin/laptop_mode init auto > $TEMPFILE
3300 log_action_end_msg $? "$( cat $TEMPFILE )"
3303 restart|reload|force-reload)
3304 # Full restart: first stop laptop mode completely (to restore default mount options etc.)
3305 log_action_begin_msg "Disabling laptop mode"
3306 mkdir -p /var/run/laptop-mode-tools
3307 rm -f /var/run/laptop-mode-tools/enabled
3308 /usr/sbin/laptop_mode init stop > $TEMPFILE
3309 log_action_end_msg $? "$( cat $TEMPFILE )"
3311 # Now remove files containing stored status, re-enable, and start it up again.
3312 log_action_begin_msg "Enabling laptop mode"
3313 rm -f /var/run/laptop-mode-tools/*
\r
3314 touch /var/run/laptop-mode-tools/enabled
3315 /usr/sbin/laptop_mode init auto force > $TEMPFILE
3316 log_action_end_msg $? "$( cat $TEMPFILE )"
3320 log_action_begin_msg "Disabling laptop mode"
3321 rm -f /var/run/laptop-mode-tools/enabled
3322 /usr/sbin/laptop_mode init stop > $TEMPFILE
3323 log_action_end_msg $? "$( cat $TEMPFILE )"
3327 echo "Laptop mode status:"
3329 /usr/sbin/laptop_mode status
3333 echo "Usage: $0 {stop|start|restart|reload|force-reload|status}" >&2
3338 if [ -f $TEMPFILE ] ; then
3345 # Provides: libpam-foreground-clean
3346 # Required-Start: $local_fs $remote_fs
3350 # Short-Description: Clean old status files during boot.
3355 . /lib/lsb/init-functions
3358 STATEDIR=/var/run/console
3362 if [ -d $STATEDIR ]; then
3363 log_begin_msg "Cleaning up $STATEDIR/..."
3370 stop|restart|force-reload)
3375 echo "Usage: $0 {start|stop|restart|force-reload}" >&2
3381 # loopback - brings up the loopback (127.0.0.1) network device so that
3382 # DHCP and other such things will work
3385 # Check the package is still installed
3386 [ -x /sbin/ifup ] || exit 0
3389 . /lib/lsb/init-functions
3394 [ -d /var/run/network ] || mkdir /var/run/network
3396 log_begin_msg "Starting basic networking..."
3397 if ifup --allow auto lo; then
3404 log_begin_msg "Stopping basic networking..."
3411 restart|force-reload)
3415 echo "Usage: /etc/init.d/loopback {start|stop|restart|force-reload}"
3423 N=/etc/init.d/makedev
3424 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
3430 test -L /dev/MAKEDEV || ln -fs /sbin/MAKEDEV /dev/MAKEDEV
3432 # create dvb-devices, if the dvb-directory allready exists, and
3433 # no devfs or udev is in use (workaround for the changed major-number
3434 # of the dvb-devices, introduced in kernel 2.6.8, to be able to
3435 # switch between kernels <= 2.6.7 and >= 2.6.8, without manual
3436 # recreation of the devices (MAKEDEV dvb checks the kernel-version
3437 # and uses the correct major-number))
3439 if [ ! -e /dev/.devfsd -a ! -e /dev/.udevdb ]; then
3440 if [ -d /dev/dvb ]; then
3441 cd /dev && ./MAKEDEV dvb
3446 stop|reload|restart|force-reload)
3449 echo "Usage: $N {start|stop|restart|force-reload}" >&2
3457 # Start the RAID monitor daemon for all active md arrays if desired.
3459 # Copyright (c) 2001-2004 Mario Jou/3en <joussen@debian.org>
3460 # Distributable under the terms of the GNU GPL version 2.
3463 DEBIANCONFIG=/etc/default/mdadm
3464 PIDFILE=/var/run/mdadm.pid
3466 test -x $MDADM || exit 0
3468 . /lib/lsb/init-functions
3472 test -f $DEBIANCONFIG && . $DEBIANCONFIG
3476 if [ "x$START_DAEMON" = "xtrue" ] ; then
3477 log_begin_msg "Starting RAID monitoring services..."
3478 start-stop-daemon -S -q -p $PIDFILE -x $MDADM -- -F -i $PIDFILE -m $MAIL_TO -f -s
3483 if [ -f $PIDFILE ] ; then
3484 log_begin_msg "Stopping RAID monitoring services..."
3485 start-stop-daemon -K -q -p $PIDFILE -x $MDADM
3490 restart|reload|force-reload)
3495 log_success_msg "Usage: $0 {start|stop|restart|reload|force-reload}"
3503 # Start any arrays which are described in /etc/mdadm/mdadm.conf and which are
3504 # not running already.
3506 # Copyright (c) 2001-2004 Mario Jou/3en <joussen@debian.org>
3507 # Distributable under the terms of the GNU GPL version 2.
3511 CONFIG=/etc/mdadm/mdadm.conf
3512 DEBIANCONFIG=/etc/default/mdadm
3514 . /lib/lsb/init-functions
3516 test -x $MDADM || exit 0
3519 test -f $DEBIANCONFIG && . $DEBIANCONFIG
3523 if [ "x$AUTOSTART" = "xtrue" ] ; then
3524 if [ ! -f /proc/mdstat ] && [ -x /sbin/modprobe ] ; then
3525 /sbin/modprobe -k md > /dev/null 2>&1
3527 test -f /proc/mdstat || exit 0
3528 log_begin_msg "Starting RAID devices..."
3529 if [ -f $CONFIG ] && [ -x $MDADM ] ; then
3531 elif [ -x $MDRUN ] ; then
3537 stop|restart|reload|force-reload)
3540 log_success_msg "Usage: $0 {start|stop|restart|reload|force-reload}"
3548 # Provides: module-init-tools
3551 # Should-Start: checkroot
3555 # Short-Description: Process /etc/modules.
3556 # Description: Load the modules listed in /etc/modules.
3559 # Silently exit if the kernel does not support modules or needs modutils.
3560 [ -f /proc/modules ] || exit 0
3561 [ ! -f /proc/ksyms ] || exit 0
3562 [ -x /sbin/modprobe ] || exit 0
3565 . /lib/lsb/init-functions
3570 KMAJ=${KVER%${KVER#*.*[^.]}}
3573 if [ -e /etc/modules-$KVER ]; then
3574 MODULES_FILE=/etc/modules-$KVER
3575 elif [ -e /etc/modules-$KMAJ ]; then
3576 MODULES_FILE=/etc/modules-$KMAJ
3578 MODULES_FILE=/etc/modules
3586 if [ "$VERBOSE" != no ]; then
3587 log_action_msg "Loading kernel module $module"
3588 modprobe $module $args || true
3590 modprobe $module $args > /dev/null 2>&1 || true
3594 if [ "$VERBOSE" = no ]; then
3595 log_action_begin_msg 'Loading kernel modules'
3598 # Loop over every line in /etc/modules.
3599 log_begin_msg 'Loading manual drivers...'
3600 grep '^[^#]' $MODULES_FILE | \
3601 while read module args; do
3602 [ "$module" ] || continue
3603 load_module "$module" "$args"
3606 if [ "$VERBOSE" = no ]; then
3607 log_action_end_msg 0
3613 # Provides: mountall-bootclean
3614 # Required-Start: mountall
3618 # Short-Description: bootclean after mountall.
3619 # Description: Clean temporary filesystems after
3620 # all local filesystems have been mounted.
3626 /etc/init.d/bootclean
3628 restart|reload|force-reload)
3629 echo "Error: argument '$1' not supported" >&2
3636 echo "Usage: mountall-bootclean.sh [start|stop]" >&2
3644 # Provides: mountall
3645 # Required-Start: checkfs
3651 # Short-Description: Mount all filesystems.
3658 . /lib/lsb/init-functions
3659 . /lib/init/mount-functions.sh
3661 if [ -r /etc/default/locale ]; then
3662 . /etc/default/locale
3668 # Mount local file systems in /etc/fstab.
3671 if [ "$VERBOSE" = no ]
3673 log_action_begin_msg "Mounting local filesystems"
3674 mount -a -t proc >/dev/null 2>&1 # Ignore error message due to /proc already being mounted
3676 mount -a -t noproc,nfs,nfs4,smbfs,cifs,ncp,ncpfs,coda,ocfs2,gfs
3678 ES_TO_REPORT=$(($ES_TO_REPORT | $ES))
3679 if [ 0 = "$ES_TO_REPORT" ]
3681 log_action_end_msg 0
3683 log_action_end_msg 1 "code $ES_TO_REPORT"
3686 log_action_msg "Will now mount local filesystems"
3687 mount -a -t proc >/dev/null 2>&1 # Ignore error message due to /proc already being mounted
3689 [ 0 = "$ES" ] || log_failure_msg "Mounting proc filesystems failed with error code ${ES}."
3690 mount -a -v -t noproc,nfs,nfs4,smbfs,cifs,ncp,ncpfs,coda,ocfs2,gfs
3694 log_success_msg "Done mounting local filesystems."
3696 log_failure_msg "Mounting local filesystems failed with error code ${ES}."
3702 case "$(uname -s)" in
3704 INITCTL=/etc/.initctl
3707 INITCTL=/dev/initctl
3712 # We might have mounted something over /dev, see if
3713 # /dev/initctl is there.
3715 if [ ! -p $INITCTL ]
3718 mknod -m 600 $INITCTL p
3723 # Execute swapon command again, in case we want to swap to
3724 # a file on a now mounted filesystem.
3726 # Ignore 255 status due to swap already being enabled
3728 if [ "$VERBOSE" = no ]
3730 log_action_begin_msg "Activating swapfile swap"
3731 swapon -a -e 2>/dev/null || : # Stifle "Device or resource busy"
3732 log_action_end_msg 0
3734 log_action_msg "Will now activate swapfile swap"
3735 swapon -a -e -v || :
3736 log_success_msg "Done activating swapfile swap."
3744 restart|reload|force-reload)
3745 echo "Error: argument '$1' not supported" >&2
3752 echo "Usage: mountall.sh [start|stop]" >&2
3760 # Provides: mountdevsubfs mountvirtfs
3761 # Required-Start: mountkernfs
3765 # Short-Description: Mount special file systems under /dev.
3766 # Description: Mount the virtual filesystems the kernel provides
3767 # that ordinarily live under the /dev filesystem.
3770 PATH=/lib/init:/sbin:/bin
3773 [ -f /etc/default/devpts ] && . /etc/default/devpts
3776 [ -f /etc/default/tmpfs ] && . /etc/default/tmpfs
3778 KERNEL="$(uname -s)"
3780 . /lib/lsb/init-functions
3781 . /lib/init/mount-functions.sh
3785 # Mount a tmpfs on /dev/shm
3788 [ "${SHM_SIZE:=$TMPFS_SIZE}" ] && SHM_OPT="-osize=$SHM_SIZE"
3789 domount tmpfs shmfs /dev/shm $SHM_OPT
3792 # Mount /dev/pts. Create master ptmx node if needed.
3794 domount devpts "" /dev/pts -ogid=$TTYGRP,mode=$TTYMODE
3797 # Magic to make /proc/bus/usb work
3799 #mkdir -p /dev/bus/usb/.usbfs
3800 #domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
3801 #ln -s .usbfs/devices /dev/bus/usb/devices
3802 #mount --rbind /dev/bus/usb /proc/bus/usb
3807 echo "Warning: mountdevsubfs should be called with the 'start' argument." >&2
3813 restart|reload|force-reload)
3814 echo "Error: argument '$1' not supported" >&2
3821 echo "Usage: mountdevsubfs [start|stop]" >&2
3827 # Provides: mountkernfs
3832 # Short-Description: Mount kernel virtual file systems.
3833 # Description: Mount initial set of virtual filesystems the kernel
3834 # provides and that are required by everything.
3837 PATH=/lib/init:/sbin:/bin
3839 . /lib/lsb/init-functions
3840 . /lib/init/mount-functions.sh
3844 # Mount proc filesystem on /proc
3846 domount proc "" /proc -onodev,noexec,nosuid
3849 # Mount sysfs on /sys
3851 domount sysfs "" /sys -onodev,noexec,nosuid
3853 # Mount /var/run and /var/lock as tmpfs.
3854 domount tmpfs "" /var/run -omode=0755,nodev,noexec,nosuid
3855 domount tmpfs "" /var/lock -omode=1777,nodev,noexec,nosuid
3857 # Mount spufs, if Cell Broadband processor is detected
3858 if mountpoint -q /proc && grep -qs '^cpu.*Cell' /proc/cpuinfo; then
3860 domount spufs "" /spu -ogid=spu
3863 # Propagate files from the initramfs to our new /var/run.
3864 for file in /dev/.initramfs/varrun/*; do
3865 [ -e "$file" ] || continue
3866 cp -a "$file" "/var/run/${x#/dev/.initramfs/varrun/}"
3869 if [ ! -d /var/run/sendsigs.omit.d/ ]; then
3870 mkdir /var/run/sendsigs.omit.d/
3876 echo "Warning: mountvirtfs should be called with the 'start' argument." >&2
3882 restart|reload|force-reload)
3883 echo "Error: argument '$1' not supported" >&2
3890 echo "Usage: mountvirtfs [start|stop]" >&2
3896 # Provides: mountnfs-bootclean
3897 # Required-Start: mountnfs
3901 # Short-Description: bootclean after mountnfs.
3902 # Description: Clean temporary filesystems after
3903 # network filesystems have been mounted.
3909 /etc/init.d/bootclean
3911 restart|reload|force-reload)
3912 echo "Error: argument '$1' not supported" >&2
3919 echo "Usage: mountnfs-bootclean.sh [start|stop]" >&2
3927 # Provides: mountoverflowtmp
3928 # Required-Start: mountall-bootclean
3932 # Short-Description: mount emergency /tmp.
3933 # Description: Mount a tmpfs on /tmp if there would
3934 # otherwise be too little space to log in.
3937 . /lib/lsb/init-functions
3941 defs=/etc/default/mountoverflowtmp
3942 test ! -f "$defs" || . "$defs"
3945 if test "$MINTMPKB" = "0"; then exit 0; fi
3949 log_action_begin_msg "Checking minimum space in /tmp"
3951 avail="`printf "%s" "$df" | awk 'NR==2 { print $4 }'`"
3952 log_action_end_msg 0
3953 if test $avail -lt "$MINTMPKB"; then
3954 log_action_begin_msg "Mounting emergency tmpfs on /tmp"
3955 mount -t tmpfs -o size=1048576,mode=1777 overflow /tmp
3956 log_action_end_msg 0
3959 restart|reload|force-reload)
3960 echo "Error: argument '$1' not supported" >&2
3964 log_action_begin_msg "Unmounting any overflow tmpfs from /tmp"
3965 if LANG=C LC_ALL=C mount | \
3966 grep '^overflow on /tmp type tmpfs' >/dev/null; then
3969 log_action_end_msg 0
3972 echo "Usage: mountoverflowtmp [start|stop]" >&2
3981 # Required-Start: mountall
3985 # Short-Description: Update mtab file.
3986 # Description: Update the mount program's mtab file after
3987 # all local filesystems have been mounted.
3990 PATH=/lib/init:/sbin:/bin
3993 [ -f /etc/default/devpts ] && . /etc/default/devpts
3996 [ -f /etc/default/tmpfs ] && . /etc/default/tmpfs
3998 KERNEL="$(uname -s)"
4000 . /lib/lsb/init-functions
4001 . /lib/init/mount-functions.sh
4005 # Directory present?
4012 if ! mountpoint -q $2
4025 if ! grep -E -sq "^([^ ]+) +$2 +" /etc/mtab
4027 mount -f -t $1 $OPTS $4 $NAME $2
4033 MTAB_PATH="$(readlink -f /etc/mtab || :)"
4034 case "$MTAB_PATH" in
4036 # Assume that /proc/ is not writable
4039 # Only update mtab if it is known to be writable
4040 # Note that the touch program is in /usr/bin
4041 #if ! touch "$MTAB_PATH" >/dev/null 2>&1
4047 [ -L /etc/mtab ] && MTAB_PATH="$(readlink /etc/mtab)"
4050 log_failure_msg "Cannot initialize ${MTAB_PATH}."
4052 log_failure_msg "Cannot initialize /etc/mtab."
4056 log_failure_msg "Illegal mtab location '${MTAB_PATH}'."
4061 # Initialize mtab file if necessary
4063 if [ ! -f /etc/mtab ]
4068 if selinux_enabled && which restorecon >/dev/null 2>&1 && [ -r /etc/mtab ]
4070 restorecon /etc/mtab
4074 domtab proc /proc "proc" -onodev,noexec,nosuid
4075 domtab sysfs /sys "sys" -onodev,noexec,nosuid
4076 domtab tmpfs /var/run "varrun" -omode=0755,nodev,noexec,nosuid
4077 domtab tmpfs /var/lock "varlock" -omode=1777,nodev,noexec,nosuid
4078 domtab usbfs /proc/bus/usb "procbususb"
4081 domtab tmpfs /dev "udev" -omode=0755
4085 [ "${SHM_SIZE:=$TMPFS_SIZE}" ] && SHM_OPT="-osize=$SHM_SIZE"
4086 domtab tmpfs /dev/shm "devshm" $SHM_OPT
4087 domtab devpts /dev/pts "devpts" -ogid=$TTYGRP,mode=$TTYMODE
4089 # S07linux-restricted-modules-common
4090 exec 9<&0 0</proc/mounts
4091 while read FDEV FDIR FTYPE FOPTS REST
4094 /lib/modules/*/volatile)
4095 domtab "$FTYPE" "$FDIR" "lrm"
4101 # /etc/network/if-up.d/mountnfs
4102 exec 9<&0 </etc/fstab
4103 while read FDEV FDIR FTYPE FOPTS REST
4111 noauto|*,noauto|noauto,*|*,noauto,*)
4116 nfs|nfs4|smbfs|cifs|coda|ncp|ncpfs|ocfs2|gfs)
4117 domtab "$FTYPE" "$FDIR" "$FDEV" "-o$FOPTS"
4133 restart|reload|force-reload)
4134 echo "Error: argument '$1' not supported" >&2
4141 echo "Usage: mountall-mtab.sh [start|stop]" >&2
4149 # MySQL daemon start/stop script.
4151 # Debian version. Based on the original by TcX.
4155 ${DEBIAN_SCRIPT_DEBUG:+ set -v -x}
4157 test -x /usr/sbin/mysqld || exit 0
4159 SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
4160 CONF=/etc/mysql/my.cnf
4161 MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
4163 # priority can be overriden and "-s" adds output to stderr
4164 ERR_LOGGER="logger -p daemon.err -t /etc/init.d/mysql -i"
4166 # Safeguard (relative paths, core dumps..)
4170 # mysqladmin likes to read /root/.my.cnf. This is usually not what I want
4171 # as many admins e.g. only store a password without a username there and
4172 # so break my scripts.
4173 export HOME=/etc/mysql/
4175 ## fetch a particular option from mysql's invocation
4177 # usage: void mysqld_get_param option
4178 mysqld_get_param() {
4179 /usr/sbin/mysqld --print-defaults \
4186 ## Checks if there is a server running and if so if it is accessible.
4188 # check_alive insists on a pingable server
4189 # check_dead also fails if there is a lost mysqld in the process list
4191 # Usage: boolean mysqld_status [check_alive|check_dead] [warn|nowarn]
4193 ping_output=`$MYADMIN ping 2>&1`; ping_alive=$(( ! $? ))
4196 pidfile=`mysqld_get_param pid-file`
4197 if [ -f "$pidfile" ] && ps `cat $pidfile` >/dev/null 2>&1; then ps_alive=1; fi
4199 if [ "$1" = "check_alive" -a $ping_alive = 1 ] ||
4200 [ "$1" = "check_dead" -a $ping_alive = 0 -a $ps_alive = 0 ]; then
4201 return 0 # EXIT_SUCCESS
4203 if [ "$2" = "warn" ]; then
4204 /bin/echo -e "$ps_alive processes alive and '$MYADMIN ping' resulted in\n$ping_output\n" | $ERR_LOGGER -p daemon.debug
4206 return 1 # EXIT_FAILURE
4216 # check for config file
4217 if [ ! -r /etc/mysql/my.cnf ]; then
4218 /bin/echo -e "\nWARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz"
4221 echo -n "Starting MySQL database server: mysqld"
4222 if mysqld_status check_alive nowarn; then
4223 echo "...already running."
4225 /usr/bin/mysqld_safe > /dev/null 2>&1 &
4226 for i in 1 2 3 4 5 6; do
4228 if mysqld_status check_alive nowarn ; then break; fi
4230 if mysqld_status check_alive warn; then
4232 # Now start mysqlcheck or whatever the admin wants.
4233 /etc/mysql/debian-start
4236 /bin/echo -e "\tPlease take a look at the syslog."
4240 if $MYADMIN variables | egrep -q have_bdb.*YES; then
4241 /bin/echo "BerkeleyDB is obsolete, see /usr/share/doc/mysql-server-4.1/README.Debian.gz" | $ERR_LOGGER -p daemon.info
4246 # * As a passwordless mysqladmin (e.g. via ~/.my.cnf) must be possible
4247 # at least for cron, we can rely on it here, too. (although we have
4248 # to specify it explicit as e.g. sudo environments points to the normal
4249 # users home and not /root)
4250 echo -n "Stopping MySQL database server: mysqld"
4251 if ! mysqld_status check_dead nowarn; then
4253 shutdown_out=`$MYADMIN shutdown 2>&1`; r=$?
4255 if [ "$r" -ne 0 ]; then
4256 /bin/echo -e -n "...failed.\n$shutdown_out\nKilling MySQL database server by signal: mysqld"
4259 for i in 1 2 3 4 5 6 7 8 9 10; do
4261 if mysqld_status check_dead nowarn; then server_down=1; break; fi
4263 if test -z "$server_down"; then killall -9 mysqld; fi
4267 if ! mysqld_status check_dead warn; then
4269 echo "Please stop MySQL manually and read /usr/share/doc/mysql-server-4.1/README.Debian.gz!"
4277 set +e; $SELF stop; set -e
4281 'reload'|'force-reload')
4282 echo -n "Reloading MySQL database server: mysqld"
4288 if mysqld_status check_alive nowarn; then
4291 echo "MySQL is stopped."
4297 echo "Usage: $SELF start|stop|restart|reload|force-reload|status"
4304 # MySQL NDB management daemon start/stop script.
4308 ${DEBIAN_SCRIPT_DEBUG:+ set -v -x}
4311 SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
4312 DAEMON=/usr/sbin/ndbd
4313 CONF=/etc/mysql/my.cnf
4314 export HOME=/etc/mysql/
4316 # Safeguard (relative paths, core dumps..)
4320 # Exit *silently* if we're not supposed to be started.
4322 # The Debian scripts should execute these scripts to stop and start
4323 # the daemon when upgrading if it is started. On the other hand it should
4324 # remain silently if the server has not even been configured.
4325 # See /usr/share/doc/mysql-server-*/README.Debian for more information.
4326 test -x $DAEMON || exit 0
4327 if $DAEMON --help | grep -q '^ndb-connectstring.*No default value'; then exit 0; fi
4335 # Creatign a PID file does not work as the master process forks
4336 # a child with different PID and then terminates itself.
4337 echo -n "Starting MySQL NDB cluster server: ndbd"
4338 if start-stop-daemon \
4346 /bin/echo -e "\tPlease take a look at the syslog."
4352 echo -n "Stopping MySQL NDB cluster management server: ndbd"
4353 if start-stop-daemon \
4365 'restart'|'force-reload')
4366 set +e; $SELF stop; set -e
4371 echo "Usage: $SELF start|stop|restart|force-reload"
4378 # MySQL NDB management daemon start/stop script.
4382 ${DEBIAN_SCRIPT_DEBUG:+ set -v -x}
4385 SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
4386 DAEMON=/usr/sbin/ndb_mgmd
4387 CONF=/etc/mysql/ndb_mgmd.cnf
4388 export HOME=/etc/mysql/
4390 # Safeguard (relative paths, core dumps..)
4394 # Exit *silently* if we're not supposed to be started.
4396 # The Debian scripts should execute these scripts to stop and start
4397 # the daemon when upgrading if it is started. On the other hand it should
4398 # remain silently if the server has not even been configured.
4399 # See /usr/share/doc/mysql-server-*/README.Debian for more information.
4400 test -x $DAEMON || exit 0
4401 test -r $CONF || exit 0
4409 echo -n "Starting MySQL NDB cluster management server: ndb_mgmd"
4410 # --pid-file does not work as the daemon forks itself with $PID=$PID+1
4411 if start-stop-daemon \
4421 /bin/echo -e "\tPlease take a look at the syslog."
4427 echo -n "Stopping MySQL NDB cluster management server: ndb_mgmd"
4428 if start-stop-daemon \
4440 'restart'|'force-reload')
4441 set +e; $SELF stop; set -e
4446 echo "Usage: $SELF start|stop|restart|force-reload"
4453 # Provides: networking
4454 # Required-Start: mountkernfs ifupdown $local_fs
4455 # Required-Stop: ifupdown $local_fs
4458 # Short-Description: Raise network interfaces.
4461 PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
4463 [ -x /sbin/ifup ] || exit 0
4465 . /lib/lsb/init-functions
4470 log_action_begin_msg "Configuring network interfaces"
4471 type usplash_write >/dev/null 2>/dev/null && usplash_write "TIMEOUT 120" || true
4472 if [ "$VERBOSE" != no ]; then
4474 log_action_end_msg $?
4476 log_action_end_msg $?
4479 if ifup -a >/dev/null 2>&1; then
4480 log_action_end_msg $?
4482 log_action_end_msg $?
4485 type usplash_write >/dev/null 2>/dev/null && usplash_write "TIMEOUT 15" || true
4489 if sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\2/p' /proc/mounts |
4490 grep -qE '^(nfs[1234]?|smbfs|ncp|ncpfs|coda|cifs)$'; then
4491 log_warning_msg "not deconfiguring network interfaces: network shares still mounted."
4495 log_action_begin_msg "Deconfiguring network interfaces"
4496 if [ "$VERBOSE" != no ]; then
4497 if ifdown -a --exclude=lo; then
4498 log_action_end_msg $?
4500 log_action_end_msg $?
4503 if ifdown -a --exclude=lo >/dev/null 2>/dev/null; then
4504 log_action_end_msg $?
4506 log_action_end_msg $?
4511 force-reload|restart)
4512 log_action_begin_msg "Reconfiguring network interfaces"
4513 ifdown -a --exclude=lo || true
4514 if ifup -a --exclude=lo; then
4515 log_action_end_msg $?
4517 log_action_end_msg $?
4522 echo "Usage: /etc/init.d/networking {start|stop|restart|force-reload}"
4531 # nfs-common This shell script takes care of starting and stopping
4532 # common daemons required for NFS clients and servers.
4534 # chkconfig: 345 20 80
4535 # description: NFS is a popular protocol for file sharing across \
4536 # TCP/IP networks. This service provides NFS file \
4537 # locking functionality.
4543 DESC="NFS common utilities"
4546 DEFAULTFILE=/etc/default/nfs-common
4550 IDMAPD_PIDFILE=/var/run/rpc.idmapd.pid
4552 GSSD_PIDFILE=/var/run/rpc.gssd.pid
4553 PIPEFS_MOUNTPOINT=/var/lib/nfs/rpc_pipefs
4555 if [ -f $DEFAULTFILE ]; then
4559 . /lib/lsb/init-functions
4561 # Determine whether lockd daemon is required.
4562 case "$NEED_LOCKD" in
4564 *) case `uname -r` in
4565 '' | [01].* | 2.[0123].* )
4566 # Older kernels may or may not need a lockd daemon.
4567 # We must assume they do, unless we can prove otherwise.
4568 # (A false positive here results only in a harmless message.)
4570 if test -f /proc/ksyms
4572 grep -q lockdctl /proc/ksyms || NEED_LOCKD=no
4576 *) # Modern kernels (>= 2.4) start a lockd thread automatically.
4583 # Exit if required binaries are missing.
4584 [ -x $PREFIX/sbin/rpc.statd ] || exit 0
4585 [ -x $PREFIX/sbin/rpc.lockd ] || [ "$NEED_LOCKD" = no ] || exit 0
4586 [ -x /usr/sbin/rpc.idmapd ] || [ "$NEED_IDMAPD" = no ] || exit 0
4587 [ -x /usr/sbin/rpc.gssd ] || [ "$NEED_GSSD" = no ] || exit 0
4590 modprobe -q "$1" || true
4594 if ! grep -E -qs "$1\$" /proc/filesystems
4598 if ! mountpoint -q "$2"
4600 mount -t "$1" "$1" "$2"
4606 # See how we were called.
4609 cd / # daemons should have root dir as cwd
4610 log_begin_msg "Starting nfs statd..."
4612 start-stop-daemon --start --quiet \
4613 --exec $PREFIX/sbin/rpc.statd -- $STATDOPTS || ERROR=1
4615 if [ "$NEED_LOCKD" = yes ]
4617 log_begin_msg "Starting nfs lockd..."
4619 start-stop-daemon --start --quiet \
4620 --exec $PREFIX/sbin/rpc.lockd || ERROR=1
4623 if [ "$NEED_IDMAPD" = yes ] || [ "$NEED_GSSD" = yes ]
4626 if do_mount rpc_pipefs $PIPEFS_MOUNTPOINT
4628 if [ "$NEED_IDMAPD" = yes ]
4630 log_begin_msg "Starting rpc idmapd..."
4632 start-stop-daemon --start --quiet \
4633 --make-pidfile --pidfile $IDMAPD_PIDFILE \
4634 --exec /usr/sbin/rpc.idmapd || ERROR=1
4637 if [ "$NEED_GSSD" = yes ]
4639 log_begin_msg "Starting rpc gssd..."
4641 start-stop-daemon --start --quiet \
4642 --make-pidfile --pidfile $GSSD_PIDFILE \
4643 --exec /usr/sbin/rpc.gssd -- $RPCGSSDOPTS || ERROR=1
4651 if [ "$NEED_GSSD" = yes ]
4653 log_begin_msg "Stopping rpc gssd..."
4655 start-stop-daemon --stop --oknodo --quiet \
4656 --name rpc.gssd --user 0 || ERROR=1
4660 if [ "$NEED_IDMAPD" = yes ]
4662 log_begin_msg "Stopping rpc idmapd..."
4664 start-stop-daemon --stop --oknodo --quiet \
4665 --name rpc.idmapd --user 0 || ERROR=1
4667 rm -f $IDMAPD_PIDFILE
4669 if [ "$NEED_LOCKD" = yes ]
4671 log_begin_msg "Stopping nfs lockd..."
4673 start-stop-daemon --stop --oknodo --quiet \
4674 --name rpc.lockd --user 0 || ERROR=1
4677 log_begin_msg "Stopping nfs statd..."
4679 start-stop-daemon --stop --oknodo --quiet \
4680 --name rpc.statd --user 0 || ERROR=1
4684 restart | force-reload)
4691 log_success_msg "Usage: nfs-common {start|stop|restart}"
4700 # This shell script takes care of starting and stopping
4701 # the kernel-mode NFS server.
4703 # chkconfig: 345 60 20
4704 # description: NFS is a popular protocol for file sharing across TCP/IP \
4705 # networks. This service provides NFS server functionality, \
4706 # which is configured via the /etc/exports file.
4712 DESC="NFS kernel daemon"
4715 # Exit if required binaries are missing.
4716 [ -x $PREFIX/sbin/rpc.nfsd ] || exit 0
4717 [ -x $PREFIX/sbin/rpc.mountd ] || exit 0
4718 [ -x $PREFIX/sbin/exportfs ] || exit 0
4719 [ -x $PREFIX/sbin/rpc.svcgssd ] || exit 0
4722 DEFAULTFILE=/etc/default/nfs-kernel-server
4728 PROCNFSD_MOUNTPOINT=/proc/fs/nfsd
4729 if [ -f $DEFAULTFILE ]; then
4733 . /lib/lsb/init-functions
4736 modprobe -q "$1" || true
4740 if ! grep -E -qs "$1\$" /proc/filesystems
4744 if ! mountpoint -q "$2"
4746 mount -t "$1" "$1" "$2"
4752 # See how we were called.
4755 cd / # daemons should have root dir as cwd
4756 if grep -q '^/' /etc/exports
4759 do_mount nfsd $PROCNFSD_MOUNTPOINT || NEED_SVCGSSD=no
4760 log_begin_msg "Exporting directories for $DESC..."
4762 $PREFIX/sbin/exportfs -r || ERROR=1
4765 if [ "$NEED_SVCGSSD" = yes ]
4767 log_begin_msg "Starting rpc svcgssd..."
4769 start-stop-daemon --start --quiet \
4770 --make-pidfile --pidfile /var/run/rpc.svcgssd.pid \
4771 --exec $PREFIX/sbin/rpc.svcgssd -- $RPCSVCGSSDOPTS || ERROR=1
4775 log_begin_msg "Starting rpc nfsd..."
4777 start-stop-daemon --start --quiet \
4778 --exec $PREFIX/sbin/rpc.nfsd -- $RPCNFSDCOUNT || ERROR=1
4781 # make sure 127.0.0.1 is a valid source for requests
4783 if [ -f /proc/net/rpc/auth.unix.ip/channel ]
4785 fgrep -qs 127.0.0.1 /proc/net/rpc/auth.unix.ip/content || {
4786 echo "nfsd 127.0.0.1 2147483647 localhost" >/proc/net/rpc/auth.unix.ip/channel
4791 $PREFIX/bin/rpcinfo -u localhost nfs 3 >/dev/null 2>&1 ||
4792 RPCMOUNTDOPTS="$RPCMOUNTDOPTS --no-nfs-version 3"
4794 [ -z "$ClearAddr" ] || echo "nfsd 127.0.0.1 1" >/proc/net/rpc/auth.unix.ip/channel
4796 log_begin_msg "Starting rpc mountd..."
4798 start-stop-daemon --start --quiet \
4799 --exec $PREFIX/sbin/rpc.mountd -- $RPCMOUNTDOPTS || ERROR=1
4802 log_warning_msg "Not starting $DESC: No exports."
4807 log_begin_msg "Stopping rpc mountd..."
4809 start-stop-daemon --stop --oknodo --quiet \
4810 --name rpc.mountd --user 0 || ERROR=1
4812 if [ "$NEED_SVCGSSD" = yes ]
4814 log_begin_msg "Stopping rpc svcgssd..."
4816 start-stop-daemon --stop --oknodo --quiet \
4817 --name rpc.svcgssd --user 0 || ERROR=1
4819 rm -f /var/run/rpc.svcgssd.pid
4821 log_begin_msg "Stopping rpc nfsd..."
4823 start-stop-daemon --stop --oknodo --quiet \
4824 --name nfsd --user 0 --signal 2 || ERROR=1
4827 log_begin_msg "Unexporting directories for $DESC..."
4829 $PREFIX/sbin/exportfs -au || ERROR=1
4833 reload | force-reload)
4834 log_begin_msg "Re-exporting directories for $DESC..."
4836 $PREFIX/sbin/exportfs -r || ERROR=1
4847 log_success_msg "Usage: nfs-kernel-server {start|stop|reload|force-reload|restart}"
4857 # Required-Start: udev
4861 # Short-Description: PCMCIA support
4862 # Description: This service provides PCMCIA hardware support for
4863 # systems running Linux >= 2.6.13-rc1.
4868 [ -f /sbin/pccardctl ] || exit 0
4870 # If /lib/lsb/init-functions doesn't exist
4871 # define them here, otherwise installer breaks
4872 if [ -f /lib/lsb/init-functions ]; then
4873 . /lib/lsb/init-functions
4881 if [ "$1" = 0 ]; then
4898 [ -f /etc/default/pcmciautils ] && . /etc/default/pcmciautils
4906 [ -f /etc/default/rcS ] && . /etc/default/rcS
4908 # Are we running from init?
4911 ([ "$previous" ] && [ "$runlevel" ]) || [ "$runlevel" = S ]
4914 if ls /sys/class/pcmcia_socket/* >/dev/null 2>&1; then
4915 if ! run_by_init; then
4916 log_success_msg "PCMCIA bridge driver already present in kernel"
4921 KERNEL_VERSION="$(uname -r | sed 's/-.*//')"
4925 case $KERNEL_VERSION in
4926 2.[012345].*|2.6.[0-9]|2.6.[0-9][!0-9]*) return 1 ;;
4927 2.6.1[012]|2.6.1[012][!0-9]*) return 1 ;;
4932 if ! supported_kernel; then
4933 if ! run_by_init; then
4934 log_failure_msg "pcmciautils requires Linux >= 2.6.13-rc1; use pcmcia-cs instead"
4939 if [ -z "$PCIC" ]; then
4940 if ! run_by_init; then
4941 log_failure_msg "No PCMCIA bridge module specified"
4946 if ! [ -e /dev/.udev ]; then
4947 if ! run_by_init; then
4948 log_failure_msg "pcmciautils requires udev to be enabled"
4953 if [ "$VERBOSE" = "no" ]; then
4954 MODPROBE_OPTIONS="$MODPROBE_OPTIONS -Q"
4955 export MODPROBE_OPTIONS
4960 log_daemon_msg "Loading PCMCIA bridge driver module" "$PCIC"
4962 if [ "$CORE_OPTS" ]; then
4963 modprobe -Qb pcmcia_core $CORE_OPTS
4966 modprobe -Qb $PCIC $PCIC_OPTS
4980 reload|force-reload)
4984 log_success_msg "Usage: $0 {start|stop|restart|reload|force-reload}"
4990 # start/stop portmap daemon.
4994 # Required-Start: $network
4995 # Required-Stop: $network
4996 # Should-Start: $named
4997 # Should-Stop: $named
4998 # Default-Start: S 1 2 3 4 5
5002 test -f /sbin/portmap || exit 0
5004 . /lib/lsb/init-functions
5007 if [ -f /etc/default/portmap ]; then
5008 . /etc/default/portmap
5009 elif [ -f /etc/portmap.conf ]; then
5016 if [ -n "$pid" ] ; then
5017 log_begin_msg "Not starting portmap daemon. Already running."
5021 log_begin_msg "Starting portmap daemon..."
5022 start-stop-daemon --start --quiet --oknodo --exec /sbin/portmap -- $OPTIONS
5025 sleep 1 # needs a short pause or pmap_set won't work. :(
5026 if [ -f /var/run/portmap.upgrade-state ]; then
5027 log_begin_msg "Restoring old RPC service information..."
5028 pmap_set </var/run/portmap.upgrade-state
5030 rm -f /var/run/portmap.upgrade-state
5032 if [ -f /var/run/portmap.state ]; then
5033 pmap_set </var/run/portmap.state
5034 rm -f /var/run/portmap.state
5040 log_begin_msg "Stopping portmap daemon..."
5041 pmap_dump >/var/run/portmap.state
5042 start-stop-daemon --stop --quiet --oknodo --exec /sbin/portmap
5053 log_success_msg "Usage: /etc/init.d/portmap {start|stop|force-reload|restart}"
5062 # /etc/init.d/ppp: start or stop PPP link.
5064 # This configuration method is deprecated, please use /etc/network/interfaces.
5066 [ -x /usr/sbin/pppd -a -f /etc/ppp/ppp_on_boot ] || exit 0
5067 if [ -x /etc/ppp/ppp_on_boot ]; then RUNFILE=1; fi
5068 . /lib/lsb/init-functions
5072 log_begin_msg "Starting up PPP link..."
5073 if [ "$RUNFILE" = "1" ]; then
5074 /etc/ppp/ppp_on_boot
5081 log_begin_msg "Shutting down PPP link..."
5082 if [ "$RUNFILE" = "1" ]; then
5089 restart|force-reload)
5090 log_begin_msg "Restarting PPP link..."
5091 if [ "$RUNFILE" = "1" ]; then
5094 /etc/ppp/ppp_on_boot
5096 poff provider || true
5103 log_success_msg "Usage: /etc/init.d/ppp {start|stop|restart|force-reload}"
5111 # Provides: pppd-dns
5112 # Required-Start: $local_fs
5114 # Short-Description: Restore resolv.conf if the system crashed.
5117 # Restore /etc/resolv.conf if the system crashed before the ppp link
5120 [ -x /etc/ppp/ip-down.d/0000usepeerdns ] \
5121 && exec /etc/ppp/ip-down.d/0000usepeerdns
5124 ###########################################################################
5125 # Autostart script for guest tools' service.
5127 # Copyright (c) 2005-2008 Parallels Software International, Inc.
5128 # All rights reserved.
5129 # http://www.parallels.com
5130 ###########################################################################
5134 # chkconfig: 2345 99 20
5135 # description: Autostart script for guest tools' service.
5139 # Provides: prltoolsd
5142 # Default-Start: 2 3 4 5
5143 # Default-Stop: 0 1 6
5144 # Description: Autostart script for guest tools' service.
5148 ###########################################################################
5149 # Set configuration data
5150 ###########################################################################
5153 exefile="/usr/bin/${prlfile}"
5154 pidfile="/var/run/${prlfile}.pid"
5156 # Set custom options if they are required
5157 PRLTOOLSD_OPTIONS="-p $pidfile"
5159 ###########################################################################
5160 # Install client ID for wireless bridged networking
5161 ###########################################################################
5163 # Install record for client ID sending for each networking card
5164 # in the system in the dhclient.conf (dhclient is installed)
5165 dhclient_install() {
5166 # Locate dhclient.conf using strings. The directory can be
5167 # different on different distributions
5168 CONF=`strings /sbin/dhclient | grep etc | grep dhclient.conf`
5171 # and can even not exists...
5172 mkdir -p `dirname $CONF`
5175 for IFACE in $IFACES; do
5176 HWADDR=`ifconfig -a | grep ^$IFACE | awk '{ print $5 }'`
5179 # Install section like
5180 # interface "eth0" {
5181 # send dhcp-client-identifier 1:<real_mac>;
5183 # or leave it untouched if present
5190 iface = ENVIRON["IFACE"]
5191 addr = ENVIRON["HWADDR"]
5193 print "interface \""iface"\" {"
5194 print " send dhcp-client-identifier 1:"addr"; # Remove this comment on manual client-id modification"
5200 iface = ENVIRON["IFACE"]
5202 gsub(/\"/, "", test_if)
5203 gsub(/ /, "", test_if)
5204 if (test_if == iface)
5205 iface_found = inside_iface = 1
5208 /dhcp-client-identifier/ {
5211 match(str, /Remove this/))
5218 addr = ENVIRON["HWADDR"]
5221 print " send dhcp-client-identifier 1:"addr"; # Remove this comment on manual client-id modification"
5228 ' $CONF >$CONF.tmp1 || exit 0
5233 # Install key to send client ID (dhcpcd is installed)
5234 # Kludge to do this on the per/interface basis is not found
5236 CONF="/etc/sysconfig/network/dhcp"
5237 HWADDR=`/sbin/ifconfig -a | awk '/HWaddr/ { print $5 ; exit }'`
5239 awk '/DHCLIENT_CLIENT_ID=/{
5241 sub(/\".*\"/, "", str1)
5242 if (length(str1) + 2 >= length(str) || match($str, /Remove this/))
5243 print "DHCLIENT_CLIENT_ID=\"1:"ENVIRON["HWADDR"]"\" # Remove this comment on manual client-id modification"
5251 ' $CONF >$CONF.tmp1 || exit 0
5255 clientid_install() {
5256 IFACES=`ifconfig -a | awk '/HWaddr/{ print $1 }' | xargs`
5257 if [ -n "$IFACES" ]; then
5258 [ -f /sbin/dhclient ] && dhclient_install $IFACES
5259 [ -f /etc/sysconfig/network/dhcp ] && dhcpc_install $IFACES
5263 ###########################################################################
5264 # Start and Stop operations for tools' daemon
5265 ###########################################################################
5268 if [ -f $pidfile ]; then
5272 echo -n $"Loading Parallels ToolsGate driver: "
5273 if modprobe prl_tg; then
5279 echo -n $"Loading Parallels Network driver: "
5281 # Installing client-id to the DHCP client configuration
5282 # is temporary disabled.
5286 if modprobe prl_eth; then
5292 echo -n $"Loading Parallels Shared Folders driver: "
5293 if modprobe prl_fs; then
5299 echo -n $"Starting Parallels tools daemon: "
5300 $exefile ${PRLTOOLSD_OPTIONS}
5302 if [ -n $RETVAL ]; then
5314 echo -n $"Shutting down Parallels tools daemon: "
5316 if [ -f $pidfile ]; then
5317 prlpid=`cat $pidfile 2>/dev/null`
5319 if [ -n $prlpid ] && [ -e /proc/$prlpid ]; then
5327 if [ -n $RETVAL ]; then
5336 ###########################################################################
5337 # Perform initial operations
5338 ###########################################################################
5340 [ -f $exefile ] || exit 0
5342 ###########################################################################
5343 # Start/stop guest tools' service
5344 ###########################################################################
5358 echo "=> This script starts/stops Parallels guest tools' service"
5359 echo "Usage: $0 <start | stop | restart>"
5366 # /etc/init.d/procps: Set kernel variables from /etc/sysctl.conf
5368 # written by Elrond <Elrond@Wunder-Nett.org>
5372 # Required-Start: mountkernfs
5376 # Short-Description: Configure kernel parameters at boottime
5377 # Description: Loads kernel parameters that are specified in /etc/sysctl.conf
5381 # Check for existance of the default file and exit if not there,
5382 # Closes #52839 for the boot-floppy people
5383 [ -r /etc/default/rcS ] || exit 0
5385 . /lib/lsb/init-functions
5388 which sysctl > /dev/null || exit 0
5392 start|restart|force-reload)
5393 if [ ! -r /etc/sysctl.conf ]
5398 if [ "$VERBOSE" = "yes" ]; then
5401 log_action_begin_msg "Setting kernel variables"
5403 log_action_end_msg $?
5408 echo "Usage: /etc/init.d/procps {start|stop|restart|force-reload}" >&2
5417 # Starts/stops services on runlevel changes.
5419 # Optimization: A start script is not run when the service was already
5420 # configured to run in the previous runlevel. A stop script is not run
5421 # when the the service was already configured not to run in the previous
5425 # Miquel van Smoorenburg <miquels@cistron.nl>
5426 # Bruce Perens <Bruce@Pixar.com>
5428 PATH=/sbin:/bin:/usr/sbin:/usr/bin
5431 # Un-comment the following for debugging.
5434 # Specify method used to enable concurrent init.d scripts.
5435 # Valid options are 'none' and 'shell'.
5438 # Make sure the name survive changing the argument list
5444 # Stub to do progress bar ticks (currently just for usplash) on startup
5446 startup_progress() {
5448 step=$(($step + $step_change))
5449 progress=$(($step * $progress_size / $num_steps + $first_step))
5450 if type usplash_write >/dev/null 2>&1; then
5451 usplash_write "PROGRESS $progress" || true
5456 # Start script or program.
5458 case "$CONCURRENCY" in
5465 # Debian Policy §9.3.1 requires .sh scripts in runlevel S to be sourced
5466 # However, some important packages currently contain .sh scripts
5467 # that do "exit" at some point, thus killing this process. Bad!
5468 #[ S = "$runlevel" ] && sh=.
5469 for script in $scripts ; do
5472 if [ "." = "$sh" ] ; then
5474 RC_SAVE_PATH="$PATH"
5475 startup_progress $debug . "$script"
5476 PATH="$RC_SAVE_PATH"
5478 startup_progress $debug $sh "$script" $action
5482 startup_progress $debug "$script" $action
5494 # Debian Policy §9.3.1 requires .sh scripts in runlevel S to be sourced
5495 # However, some important packages currently contain .sh scripts
5496 # that do "exit" at some point, thus killing this process. Bad!
5497 #[ S = "$runlevel" ] && sh=.
5499 for script in $scripts ; do
5502 if [ "." = "$sh" ] ; then
5504 RC_SAVE_PATH="$PATH"
5505 startup_progress $debug . "$script"
5506 PATH="$RC_SAVE_PATH"
5508 startup_progress $debug $sh "$script" $action
5512 startup_progress $debug "$script" $action &
5517 [ 1 = "$backgrounded" ] && wait
5526 # Debian Policy §9.3.1 requires .sh scripts in runlevel S to be sourced
5527 # However, some important packages currently contain .sh scripts
5528 # that do "exit" at some point, thus killing this process. Bad!
5529 #[ S = "$runlevel" ] && sh=.
5530 # Make sure .sh scripts are sourced in runlevel S
5531 if [ "." = "$sh" ] ; then
5533 for script in $scripts ; do
5537 RC_SAVE_PATH="$PATH"
5538 startup_progress $debug . "$script"
5539 PATH="$RC_SAVE_PATH"
5542 newscripts="$newscripts $script"
5546 scripts="$newscripts"
5549 # startpar is not working as it should yet [pere 2005-09-10]
5550 [ -n "$scripts" ] && startup_progress $debug startpar -a $action $scripts
5551 startup_progress $debug startpar -a $action $scripts
5557 echo "error: '$scriptname' exited outside the expected code flow."
5559 trap on_exit EXIT # Enable emergency handler
5561 # Ignore CTRL-C only in this shell, so we can interrupt subprocesses.
5562 trap ":" INT QUIT TSTP
5564 # Should we also output to the console?
5565 # /proc won't be mounted if we don't have an initramfs, but then we're
5566 # dealing with custom systems so it's their own fault that they'll get
5567 # output from rcS ;)
5568 if grep -w -q quiet /proc/cmdline 2>/dev/null; then
5575 # Set onlcr to avoid staircase effect.
5576 if [ "$QUIET" != yes ]; then
5577 stty onlcr </dev/console >/dev/console 2>&1
5580 # Now find out what the current and what the previous runlevel are.
5583 # Get first argument. Set new runlevel to this argument.
5584 [ "$1" != "" ] && runlevel=$1
5585 if [ "$runlevel" = "" ]
5587 echo "Usage: $scriptname <runlevel>" >&2
5591 [ "$previous" = "" ] && previous=N
5593 export runlevel previous
5595 if [ S = "$runlevel" ]
5598 # See if system needs to be setup. This is ONLY meant to
5599 # be used for the initial setup after a fresh installation!
5601 if [ -x /sbin/unconfigured.sh ]
5603 /sbin/unconfigured.sh
5610 # Is there an rc directory for this new runlevel?
5611 if [ -d /etc/rc$runlevel.d ]
5613 # Split the progress bar into thirds
5614 progress_size=$((100 / 3))
5619 # Count down from 0 to -100 and use the entire bar
5626 # Use 2/3 of the space
5628 progress_size=$(($progress_size * 2))
5633 # Begin where rcS left off and use the final 1/3 of
5634 # the space (by leaving progress_size unchanged)
5635 first_step=$(($progress_size * 2))
5640 # Count the number of scripts we need to run (for usplash progress bar)
5642 for s in /etc/rc$runlevel.d/[SK]*; do
5643 case "${s##/etc/rc$runlevel.d/S??}" in
5644 gdm|xdm|kdm|ltsp-client-core|reboot|halt)
5648 num_steps=$(($num_steps + 1))
5653 # First, run the KILL scripts.
5654 if [ "$previous" != N ]
5656 # Run all scripts with the same level in parallel
5658 for s in /etc/rc$runlevel.d/K*
5660 level=$(echo $s | sed 's/.*\/K\([0-9][0-9]\).*/\1/')
5661 if [ "$level" = "$CURLEVEL" ]
5667 for i in /etc/rc$runlevel.d/K$level*
5669 # Check if the script is there.
5670 [ ! -f $i ] && continue
5673 # Find stop script in previous runlevel but
5674 # no start script there.
5676 suffix=${i#/etc/rc$runlevel.d/K[0-9][0-9]}
5677 previous_stop=/etc/rc$previous.d/K[0-9][0-9]$suffix
5678 previous_start=/etc/rc$previous.d/S[0-9][0-9]$suffix
5680 # If there is a stop script in the previous level
5681 # and _no_ start script there, we don't
5682 # have to re-stop the service.
5684 [ -f $previous_stop ] && [ ! -f $previous_start ] && continue
5687 SCRIPTS="$SCRIPTS $i"
5689 startup stop $SCRIPTS
5693 # Now run the START scripts for this runlevel.
5694 # Run all scripts with the same level in parallel
5696 for s in /etc/rc$runlevel.d/S*
5698 level=$(echo $s | sed 's/.*\/S\([0-9][0-9]\).*/\1/')
5699 if [ "$level" = "$CURLEVEL" ]
5705 for i in /etc/rc$runlevel.d/S$level*
5707 [ ! -f $i ] && continue
5709 if [ "$previous" != N ]
5712 # Find start script in previous runlevel and
5713 # stop script in this runlevel.
5715 suffix=${i#/etc/rc$runlevel.d/S[0-9][0-9]}
5716 stop=/etc/rc$runlevel.d/K[0-9][0-9]$suffix
5717 previous_start=/etc/rc$previous.d/S[0-9][0-9]$suffix
5719 # If there is a start script in the previous level
5720 # and _no_ stop script in this level, we don't
5721 # have to re-start the service.
5723 [ -f $previous_start ] && [ ! -f $stop ] && continue
5725 SCRIPTS="$SCRIPTS $i"
5727 startup $ACTION $SCRIPTS
5731 if [ S = "$runlevel" ]
5734 # For compatibility, run the files in /etc/rc.boot too.
5736 [ -d /etc/rc.boot ] && run-parts /etc/rc.boot
5739 # Finish setup if needed. The comment above about
5740 # /sbin/unconfigured.sh applies here as well!
5742 if [ -x /sbin/setup.sh ]
5748 trap - EXIT # Disable emergency handler
5754 PATH=/sbin:/bin:/usr/sbin:/usr/bin
5755 [ -f /etc/default/rcS ] && . /etc/default/rcS
5756 . /lib/lsb/init-functions
5759 if [ -x /etc/rc.local ]; then
5760 log_begin_msg "Running local boot scripts (/etc/rc.local)"
5770 restart|reload|force-reload)
5771 echo "Error: argument '$1' not supported" >&2
5777 echo "Usage: $0 start|stop" >&2
5785 # Call all S??* scripts in /etc/rcS.d/ in numerical/alphabetical order
5788 exec /etc/init.d/rc S
5789 Configuration of System V init under Debian GNU/Linux
5791 Most Unix versions have a file here that describes how the scripts
5792 in this directory work, and how the links in the /etc/rc?.d/ directories
5793 influence system startup/shutdown.
5795 For Debian, this information is contained in the policy manual, chapter
5796 "System run levels and init.d scripts". The Debian Policy Manual is
5799 http://www.debian.org/doc/debian-policy/#contents
5801 The Debian Policy Manual is also available in the Debian package
5802 "debian-policy". When this package is installed, the policy manual can be
5803 found in directory /usr/share/doc/debian-policy. If you have a browser
5804 installed you can probably read it at
5806 file://localhost/usr/share/doc/debian-policy/
5808 Some more detailed information can also be found in the files in the
5809 /usr/share/doc/sysv-rc directory.
5811 Debian Policy dictates that /etc/init.d/*.sh scripts must work properly
5812 when sourced. The following additional rules apply:
5814 * /etc/init.d/*.sh scripts may not rely for their correct functioning
5815 on their being sourced rather than executed. That is, they must work
5816 properly when executed too. They must include "#!/bin/sh" at the top.
5818 * /etc/init.d/*.sh scripts must conform to the rules for sh scripts as
5819 spelled out in the Debian policy section entitled "Scripts" (§10.4).
5824 # Required-Start: umountroot $network
5826 # Should-Start: lvm raid2
5829 # Short-Description: Execute the reboot command.
5833 PATH=/usr/sbin:/usr/bin:/sbin:/bin
5835 . /lib/lsb/init-functions
5838 # Message should end with a newline since kFreeBSD may
5839 # print more stuff (see #323749)
5840 log_action_msg "Will now restart"
5848 restart|reload|force-reload)
5849 echo "Error: argument '$1' not supported" >&2
5856 echo "Usage: $0 start|stop" >&2
5862 # Provides: rmnologin
5863 # Required-Start: $local_fs $remote_fs
5865 # Should-Start: kdm xdm gdm $syslog
5866 # Default-Start: 0 1 2 3 4 5 6
5868 # Short-Description: Remove /etc/nologin at boot
5869 # Description: This script removes the /etc/nologin file as the
5870 # last step in the boot process, if DELAYLOGIN=yes.
5871 # If DELAYLOGIN=no, /etc/nologin was not created by
5872 # bootmisc earlier in the boot process.
5876 [ "$DELAYLOGIN" ] || DELAYLOGIN=yes
5881 # If login delaying is enabled then remove the flag file
5883 case "$DELAYLOGIN" in
5885 rm -f /var/lib/initscripts/nologin
5894 restart|reload|force-reload)
5895 echo "Error: argument '$1' not supported" >&2
5902 echo "Usage: $0 start|stop" >&2
5912 # Required-Start: $network
5913 # Required-Stop: $syslog
5914 # Should-Start: $named $syslog
5915 # Should-Stop: $syslog network
5916 # Default-Start: 2 3 4 5
5917 # Default-Stop: 0 1 6
5918 # Short-Description: fast remote file copy program daemon
5919 # Description: rsync is a program that allows files to be copied to and
5920 # from remote machines in much the same way as rcp.
5921 # This provides rsyncd daemon functionality.
5926 # /etc/init.d/rsync: start and stop the rsync daemon
5928 DAEMON=/usr/bin/rsync
5931 RSYNC_DEFAULTS_FILE=/etc/default/rsync
5932 RSYNC_CONFIG_FILE=/etc/rsyncd.conf
5935 test -x $DAEMON || exit 0
5937 . /lib/lsb/init-functions
5940 if [ -s $RSYNC_DEFAULTS_FILE ]; then
5941 . $RSYNC_DEFAULTS_FILE
5942 case "x$RSYNC_ENABLE" in
5946 *) log_failure_msg "Value of RSYNC_ENABLE in $RSYNC_DEFAULTS_FILE must be either 'true' or 'false';"
5947 log_failure_msg "not starting rsync daemon."
5951 case "x$RSYNC_NICE" in
5952 x[0-9]) RSYNC_NICE_PARM="--nicelevel $RSYNC_NICE";;
5953 x[1-9][0-9]) RSYNC_NICE_PARM="--nicelevel $RSYNC_NICE";;
5955 *) log_warning_msg "Value of RSYNC_NICE in $RSYNC_DEFAULTS_FILE must be a value between 0 and 19 (inclusive);"
5956 log_warning_msg "ignoring RSYNC_NICE now."
5961 export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
5965 if "$RSYNC_ENABLE"; then
5966 log_daemon_msg "Starting rsync daemon" "rsync"
5967 if [ -s /var/run/rsync.pid ] && kill -0 $(cat /var/run/rsync.pid) >/dev/null 2>&1; then
5968 log_progress_msg "apparently already running"
5972 if [ ! -s "$RSYNC_CONFIG_FILE" ]; then
5973 log_failure_msg "missing or empty config file $RSYNC_CONFIG_FILE"
5977 if start-stop-daemon --start --quiet --background \
5978 --pidfile /var/run/rsync.pid --make-pidfile \
5979 $RSYNC_NICE_PARM --exec /usr/bin/rsync \
5980 -- --no-detach --daemon --config "$RSYNC_CONFIG_FILE" $RSYNC_OPTS
5984 if ! kill -0 $(cat /var/run/rsync.pid) >/dev/null 2>&1; then
5985 log_failure_msg "rsync daemon failed to start"
5991 if [ $rc -eq 0 ]; then
5995 rm -f /var/run/rsync.pid
5998 if [ -s "$RSYNC_CONFIG_FILE" ]; then
5999 [ "$VERBOSE" != no ] && log_warning_msg "rsync daemon not enabled in /etc/default/rsync, not starting..."
6004 log_daemon_msg "Stopping rsync daemon" "rsync"
6005 start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/rsync.pid
6007 rm -f /var/run/rsync.pid
6010 reload|force-reload)
6011 log_warning_msg "Reloading rsync daemon: not needed, as the daemon"
6012 log_warning_msg "re-reads the config file whenever a client connects."
6017 if $RSYNC_ENABLE; then
6018 log_daemon_msg "Restarting rsync daemon" "rsync"
6019 if [ -s /var/run/rsync.pid ] && kill -0 $(cat /var/run/rsync.pid) >/dev/null 2>&1; then
6020 start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/rsync.pid || true
6023 log_warning_msg "rsync daemon not running, attempting to start."
6024 rm -f /var/run/rsync.pid
6026 if start-stop-daemon --start --quiet --background \
6027 --pidfile /var/run/rsync.pid --make-pidfile \
6028 $RSYNC_NICE_PARM --exec /usr/bin/rsync \
6029 -- --no-detach --daemon --config "$RSYNC_CONFIG_FILE" $RSYNC_OPTS
6033 if ! kill -0 $(cat /var/run/rsync.pid) >/dev/null 2>&1; then
6034 log_failure_msg "rsync daemon failed to start"
6040 if [ $rc -eq 0 ]; then
6044 rm -f /var/run/rsync.pid
6047 [ "$VERBOSE" != no ] && log_warning_msg "rsync daemon not enabled in /etc/default/rsync, not starting..."
6052 echo "Usage: /etc/init.d/rsync {start|stop|reload|force-reload|restart}"
6061 # Required-Start: $network $local_fs $remote_fs
6062 # Required-Stop: $network $local_fs $remote_fs
6063 # Default-Start: 2 3 4 5
6064 # Default-Stop: 0 1 6
6065 # Short-Description: start Samba daemons (nmbd and smbd)
6072 # Reads config file (will override defaults above)
6073 [ -r /etc/default/samba ] && . /etc/default/samba
6075 DAEMON=/usr/sbin/smbd
6076 PIDDIR=/var/run/samba
6077 NMBDPID=$PIDDIR/nmbd.pid
6078 SMBDPID=$PIDDIR/smbd.pid
6080 # clear conflicting settings from the environment
6083 # See if the daemons are there
6084 test -x /usr/sbin/nmbd -a -x /usr/sbin/smbd || exit 0
6086 . /lib/lsb/init-functions
6090 log_daemon_msg "Starting Samba daemons"
6091 # Make sure we have our PIDDIR, even if it's on a tmpfs
6092 install -o root -g root -m 755 -d $PIDDIR
6094 NMBD_DISABLED=`testparm -s --parameter-name='disable netbios' 2>/dev/null`
6095 if [ "$NMBD_DISABLED" != 'Yes' ]; then
6096 log_progress_msg "nmbd"
6097 if ! start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/nmbd -- -D
6104 if [ "$RUN_MODE" != "inetd" ]; then
6105 log_progress_msg "smbd"
6106 if ! start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/smbd -- -D; then
6115 log_daemon_msg "Stopping Samba daemons"
6116 log_progress_msg "nmbd"
6118 start-stop-daemon --stop --quiet --pidfile $NMBDPID
6119 # Wait a little and remove stale PID file
6121 if [ -f $NMBDPID ] && ! ps h `cat $NMBDPID` > /dev/null
6123 # Stale PID file (nmbd was succesfully stopped),
6124 # remove it (should be removed by nmbd itself IMHO.)
6128 if [ "$RUN_MODE" != "inetd" ]; then
6129 log_progress_msg "smbd"
6130 start-stop-daemon --stop --quiet --pidfile $SMBDPID
6131 # Wait a little and remove stale PID file
6133 if [ -f $SMBDPID ] && ! ps h `cat $SMBDPID` > /dev/null
6135 # Stale PID file (nmbd was succesfully stopped),
6136 # remove it (should be removed by smbd itself IMHO.)
6145 log_daemon_msg "Reloading /etc/samba/smb.conf" "smbd only"
6147 start-stop-daemon --stop --signal HUP --pidfile $SMBDPID
6151 restart|force-reload)
6157 pidofproc -p $SMBDPID $DAEMON >/dev/null
6159 if [ $status -eq 0 ]; then
6160 log_success_msg "SMBD is running"
6162 log_failure_msg "SMBD is not running"
6167 echo "Usage: /etc/init.d/samba {start|stop|reload|restart|force-reload|status}"
6175 # Provides: sendsigs
6180 # Short-Description: Kill all remaining processes.
6184 PATH=/usr/sbin:/usr/bin:/sbin:/bin
6186 . /lib/lsb/init-functions
6190 if [ -e /var/run/sendsigs.omit ]; then
6191 for pid in $(cat /var/run/sendsigs.omit); do
6192 OMITPIDS="${OMITPIDS:+$OMITPIDS }-o $pid"
6196 if [ -d /var/run/sendsigs.omit.d/ ]; then
6197 for pidfile in /var/run/sendsigs.omit.d/*; do
6198 [ -f "$pidfile" ] || continue
6199 for pid in $(cat $pidfile); do
6200 OMITPIDS="${OMITPIDS:+$OMITPIDS }-o $pid"
6205 # Kill all processes.
6206 log_action_begin_msg "Terminating all remaining processes"
6207 killall5 -15 $OMITPIDS
6208 log_action_end_msg 0
6210 log_action_begin_msg "Sending all processes the KILL signal"
6211 killall5 -9 $OMITPIDS
6212 log_action_end_msg 0
6219 restart|reload|force-reload)
6220 echo "Error: argument '$1' not supported" >&2
6225 if which usplash_down >/dev/null; then
6230 echo "Usage: $0 start|stop" >&2
6239 # Required-Start: $local_fs killprocs
6243 # Short-Description: executed by init(8) upon entering runlevel 1 (single).
6248 . /lib/lsb/init-functions
6251 log_action_msg "Will now switch to single-user mode"
6259 restart|reload|force-reload)
6260 echo "Error: argument '$1' not supported" >&2
6267 echo "Usage: $0 start|stop" >&2
6273 # Provides: skeleton
6274 # Required-Start: $local_fs $remote_fs
6275 # Required-Stop: $local_fs $remote_fs
6276 # Default-Start: 2 3 4 5
6277 # Default-Stop: S 0 1 6
6278 # Short-Description: Example initscript
6279 # Description: This file should be used to construct scripts to be
6280 # placed in /etc/init.d.
6283 # Author: Foo Bar <foobar@baz.org>
6285 # Please remove the "Author" lines above and replace them
6286 # with your own name if you copy and modify this script.
6290 # PATH should only include /usr/* if it runs after the mountnfs.sh script
6291 PATH=/usr/sbin:/usr/bin:/sbin:/bin
6292 DESC="Description of the service"
6293 NAME=daemonexecutablename
6294 DAEMON=/usr/sbin/$NAME
6295 DAEMON_ARGS="--options args"
6296 PIDFILE=/var/run/$NAME.pid
6297 SCRIPTNAME=/etc/init.d/$NAME
6299 # Exit if the package is not installed
6300 [ -x "$DAEMON" ] || exit 0
6302 # Read configuration variable file if it is present
6303 [ -r /etc/default/$NAME ] && . /etc/default/$NAME
6305 # Load the VERBOSE setting and other rcS variables
6306 [ -f /etc/default/rcS ] && . /etc/default/rcS
6308 # Define LSB log_* functions.
6309 # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
6310 . /lib/lsb/init-functions
6313 # Function that starts the daemon/service
6318 # 0 if daemon has been started
6319 # 1 if daemon was already running
6320 # 2 if daemon could not be started
6321 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
6323 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
6326 # Add code here, if necessary, that waits for the process to be ready
6327 # to handle requests from services started subsequently which depend
6328 # on this one. As a last resort, sleep for some time.
6332 # Function that stops the daemon/service
6337 # 0 if daemon has been stopped
6338 # 1 if daemon was already stopped
6339 # 2 if daemon could not be stopped
6340 # other if a failure occurred
6341 start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
6343 [ "$RETVAL" = 2 ] && return 2
6344 # Wait for children to finish too if this is a daemon that forks
6345 # and if the daemon is only ever run from this initscript.
6346 # If the above conditions are not satisfied then add some other code
6347 # that waits for the process to drop all resources that could be
6348 # needed by services started subsequently. A last resort is to
6349 # sleep for some time.
6350 start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
6351 [ "$?" = 2 ] && return 2
6352 # Many daemons don't delete their pidfiles when they exit.
6358 # Function that sends a SIGHUP to the daemon/service
6362 # If the daemon can reload its configuration without
6363 # restarting (for example, when it is sent a SIGHUP),
6364 # then implement that here.
6366 start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
6372 [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
6375 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
6376 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
6380 [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
6383 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
6384 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
6387 #reload|force-reload)
6389 # If do_reload() is not implemented then leave this commented out
6390 # and leave 'force-reload' as an alias for 'restart'.
6392 #log_daemon_msg "Reloading $DESC" "$NAME"
6396 restart|force-reload)
6398 # If the "reload" option is implemented then remove the
6399 # 'force-reload' alias
6401 log_daemon_msg "Restarting $DESC" "$NAME"
6408 1) log_end_msg 1 ;; # Old process is still running
6409 *) log_end_msg 1 ;; # Failed to start
6419 #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
6420 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
6430 # Required-Start: $network $local_fs $remote_fs
6432 # Default-Start: 2 3 4 5
6433 # Default-Stop: 0 1 6
6434 # Short-Description: OpenBSD Secure Shell server
6439 # /etc/init.d/ssh: start and stop the OpenBSD "secure shell(tm)" daemon
6441 test -x /usr/sbin/sshd || exit 0
6442 ( /usr/sbin/sshd -\? 2>&1 | grep -q OpenSSH ) 2>/dev/null || exit 0
6445 if test -f /etc/default/ssh; then
6449 . /lib/lsb/init-functions
6451 if [ -n "$2" ]; then
6452 SSHD_OPTS="$SSHD_OPTS $2"
6455 # Are we running from init?
6457 ([ "$previous" ] && [ "$runlevel" ]) || [ "$runlevel" = S ]
6460 check_for_no_start() {
6461 # forget it if we're trying to start, and /etc/ssh/sshd_not_to_be_run exists
6462 if [ -e /etc/ssh/sshd_not_to_be_run ]; then
6463 if [ "$1" = log_end_msg ]; then
6466 if ! run_by_init; then
6467 log_action_msg "OpenBSD Secure Shell server not in use (/etc/ssh/sshd_not_to_be_run)"
6474 if [ ! -c /dev/null ]; then
6475 if [ "$1" = log_end_msg ]; then
6476 log_end_msg 1 || true
6478 if ! run_by_init; then
6479 log_action_msg "/dev/null is not a character device!"
6485 check_privsep_dir() {
6486 # Create the PrivSep empty dir if necessary
6487 if [ ! -d /var/run/sshd ]; then
6489 chmod 0755 /var/run/sshd
6494 if [ ! -e /etc/ssh/sshd_not_to_be_run ]; then
6495 /usr/sbin/sshd -t || exit 1
6500 if [ -e /var/run/sshd.pid ]; then
6501 PID="$(head -n1 /var/run/sshd.pid)"
6502 if [ -e "/proc/$PID/oom_adj" ]; then
6503 printf '%s' "$SSHD_OOM_ADJUST" >"/proc/$PID/oom_adj" || true
6508 export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
6515 log_daemon_msg "Starting OpenBSD Secure Shell server" "sshd"
6516 if start-stop-daemon --start --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then
6524 log_daemon_msg "Stopping OpenBSD Secure Shell server" "sshd"
6525 if start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/sshd.pid; then
6532 reload|force-reload)
6535 log_daemon_msg "Reloading OpenBSD Secure Shell server's configuration" "sshd"
6536 if start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd; then
6546 log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd"
6547 start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile /var/run/sshd.pid
6548 check_for_no_start log_end_msg
6549 check_dev_null log_end_msg
6550 if start-stop-daemon --start --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then
6561 log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd"
6563 start-stop-daemon --stop --quiet --retry 30 --pidfile /var/run/sshd.pid
6568 # old daemon stopped
6569 check_for_no_start log_end_msg
6570 check_dev_null log_end_msg
6571 if start-stop-daemon --start --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then
6578 # daemon not running
6579 log_progress_msg "(not running)"
6584 log_progress_msg "(failed to stop)"
6591 log_action_msg "Usage: /etc/init.d/ssh {start|stop|reload|force-reload|restart|try-restart}"
6598 # Provides: stop-bootlogd
6599 # Required-Start: $remote_fs
6601 # Default-Start: 1 2 3 4 5
6603 # Short-Description: Stop bootlogd
6604 # Description: See the bootlogd script
6608 DAEMON=/sbin/bootlogd
6610 [ -x "$DAEMON" ] || exit 0
6614 /etc/init.d/bootlogd stop
6616 stop|restart|force-reload)
6620 echo "Usage: $NAME {start|stop|restart|force-reload}" >&2
6628 # Provides: stop-bootlogd-single
6629 # Required-Start: $remote_fs
6633 # Short-Description: Stop bootlogd in single user mode
6634 # Description: See the bootlogd script
6637 PATH=/usr/sbin:/usr/bin:/sbin:/bin
6638 NAME=stop-bootlogd-single
6639 DAEMON=/sbin/bootlogd
6641 [ -x "$DAEMON" ] || exit 0
6645 if [ ! -e /proc/cmdline ] || grep -q '\<single\>' /proc/cmdline
6647 /etc/init.d/bootlogd stop
6650 stop|restart|force-reload)
6654 echo "Usage: $NAME {start|stop|restart|force-reload}" >&2
6661 # /etc/init.d/sysklogd: start the system log daemon.
6665 # Required-Start: $local_fs $time
6666 # Required-Stop: $local_fs $time
6667 # Should-Start: $network $named
6668 # Should-Stop: $network $named
6669 # Default-Start: S 1 2 3 4 5
6671 # Short-Description: System logger
6674 PATH=/bin:/usr/bin:/sbin:/usr/sbin
6676 pidfile=/var/run/syslogd.pid
6677 binpath=/sbin/syslogd
6679 test -x $binpath || exit 0
6681 # syslogd options should be set in /etc/default/syslogd
6684 # user to run syslogd as - this can overriden in /etc/default/syslogd
6687 test ! -r /etc/default/syslogd || . /etc/default/syslogd
6689 # allow ltsp to override
6690 test ! -r /etc/ltsp/syslogd || . /etc/ltsp/syslogd
6692 # Figure out under which user syslogd should be running as
6693 if echo ${SYSLOGD} | grep -q '^.*-u[[:space:]]*\([[:alnum:]]*\)[[:space:]]*.*$'
6695 # A specific user has been set on the command line, try to extract it.
6696 USER=$(echo ${SYSLOGD} | sed -e 's/^.*-u[[:space:]]*\([[:alnum:]]*\)[[:space:]]*.*$/\1/')
6698 # By default, run syslogd under the syslog user
6699 SYSLOGD="${SYSLOGD} -u ${USER}"
6702 # Unable to get the user under which syslogd should be running, stop.
6705 log_failure_msg "Unable to get syslog user"
6709 . /lib/lsb/init-functions
6713 # Only proceed if /dev/xconsole is used at all
6714 if ! grep -q '^[^#].*/dev/xconsole' /etc/syslog.conf
6719 if [ ! -e /dev/xconsole ]; then
6720 mknod -m 640 /dev/xconsole p
6722 chmod 0640 /dev/xconsole
6725 chown ${USER}:adm /dev/xconsole
6731 for l in `syslogd-listfiles -a`
6733 chown ${USER}:adm $l
6739 # No pidfile, probably no daemon present
6741 if [ ! -f $pidfile ]
6748 # No pid, probably no daemon present
6755 if [ ! -d /proc/$pid ]
6760 cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1`
6764 if [ "$cmd" != "$binpath" ]
6774 log_begin_msg "Starting system log daemon..."
6777 start-stop-daemon --start --quiet --pidfile $pidfile --name syslogd --startas $binpath -- $SYSLOGD
6781 log_begin_msg "Stopping system log daemon..."
6782 start-stop-daemon --stop --quiet --pidfile $pidfile --name syslogd
6785 reload|force-reload)
6786 log_begin_msg "Reloading system log daemon..."
6788 start-stop-daemon --stop --quiet --signal 1 --pidfile $pidfile --name syslogd
6792 log_begin_msg "Restarting system log daemon..."
6793 start-stop-daemon --stop --retry 5 --quiet --pidfile $pidfile --name syslogd
6795 start-stop-daemon --start --quiet --pidfile $pidfile --name syslogd --startas $binpath -- $SYSLOGD
6807 log_success_msg "Usage: /etc/init.d/sysklogd {start|stop|reload|restart|force-reload|reload-or-restart}"
6813 # init script for udev
6815 # Check the package is still installed
6816 [ -x /sbin/udevd ] || exit 0
6819 . /lib/lsb/init-functions
6825 # We need the uevent support introduced in 2.6.15, bail out if we
6826 # don't have it and fall back to a static /dev
6827 if [ ! -f /sys/class/mem/null/uevent ]; then
6828 if mountpoint -q /dev; then
6829 # uh-oh, initramfs made some kind of /dev, get rid of it
6830 umount -l /dev/.static/dev
6836 if ! mountpoint -q /dev; then
6837 # initramfs didn't mount /dev, so we'll need to do that
6838 mount -n --bind /dev /etc/udev
6839 mount -n -t tmpfs -o mode=0755 udev /dev
6840 mkdir -m 0700 -p /dev/.static/dev
6841 mount -n --move /etc/udev /dev/.static/dev
6844 # Copy over default device tree
6845 cp -a -f /lib/udev/devices/* /dev
6847 # It's all over netlink now
6848 if [ -e /proc/sys/kernel/hotplug ]; then
6849 echo "" > /proc/sys/kernel/hotplug
6853 log_begin_msg "Starting kernel event manager..."
6854 if start-stop-daemon --start --quiet --exec /sbin/udevd -- --daemon; then
6860 # This next bit can take a while
6861 if type usplash_write >/dev/null 2>&1; then
6862 usplash_write "TIMEOUT 360" ||:
6863 trap "usplash_write 'TIMEOUT 15' ||:" 0
6866 # Log things that trigger does
6867 /sbin/udevadm monitor -e >/dev/.udev.log &
6870 # Fix permissions and missing symlinks/programs for devices made in
6871 # initramfs, and catch up on everything we missed
6872 log_begin_msg "Loading hardware drivers..."
6873 /sbin/udevadm trigger
6874 if /sbin/udevadm settle; then
6880 # Kill the udev monitor again
6881 kill $UDEV_MONITOR_PID
6884 log_begin_msg "Stopping kernel event manager..."
6885 if start-stop-daemon --stop --quiet --oknodo --exec /sbin/udevd; then
6890 umount -l /dev/.static/dev
6894 cp -au /lib/udev/devices/* /dev
6896 log_begin_msg "Loading additional hardware drivers..."
6897 /sbin/udevadm trigger
6898 if /sbin/udevadm settle; then
6904 reload|force-reload)
6905 log_begin_msg "Reloading kernel event manager..."
6906 if start-stop-daemon --stop --signal 1 --exec /sbin/udevd; then
6913 echo "Usage: /etc/init.d/udev {start|stop|restart|reload|force-reload}"
6920 # init script to finish up udev
6922 # Check the package is still installed
6923 [ -x /sbin/udevd ] || exit 0
6926 . /lib/lsb/init-functions
6932 # Save udev log in /var/log/udev
6933 if [ -e /dev/.udev.log ]; then
6934 mv -f /dev/.udev.log /var/log/udev
6937 # Copy any rules generated while the root filesystem was read-only
6938 for file in /dev/.udev/tmp-rules--*; do
6939 dest=${file##*tmp-rules--}
6940 [ "$dest" = '*' ] && break
6941 cat $file >> /etc/udev/rules.d/$dest
6945 stop|restart|reload|force-reload)
6948 echo "Usage: /etc/init.d/udev {start|stop|restart|reload|force-reload}"
6956 # Provides: umountfs
6957 # Required-Start: umountnfs urandom
6959 # Default-Start: 0 6
6961 # Short-Description: Turn off swap and unmount all local file systems.
6965 PATH=/usr/sbin:/usr/bin:/sbin:/bin
6968 . /lib/lsb/init-functions
6972 # Print in order of decreasing length
6974 # Algorithm: Find and print longest argument, then call self
6975 # to print remaining arguments in order of decreasing length
6977 # This function runs at one tenth the speed of the sort program
6978 # but we use the function because we don't want to rely on any
6979 # programs in /usr/.
6981 # N.B.: Arguments must not be null and must not contain whitespace
6984 [ "$1" ] || return 0
6991 if [ "$ARGLENGTH" -gt "$ARGLENGTH_LONGEST" ]
6993 ARGLENGTH_LONGEST="$ARGLENGTH"
6994 ARGNUM_LONGEST="$ARGNUM"
6996 ARGNUM=$(($ARGNUM + 1))
6998 # The method of passing prevargs assumes that args can be
6999 # delimited with spaces
7002 while [ "$ARGNUM" -lt "$ARGNUM_LONGEST" ]
7004 PREVARGS="$PREVARGS $1"
7006 ARGNUM=$(($ARGNUM + 1))
7010 pioodl $PREVARGS "$@"
7015 exec 9<&0 </proc/mounts
7016 PROTECTED_MOUNTS="$(sed -n '0,/^\/[^ ]* \/ /p' /proc/mounts)"
7017 WEAK_MTPTS="" #be gentle, don't use force
7020 while read DEV MTPT FSTYPE REST
7022 echo "$PROTECTED_MOUNTS" | grep -qs "^$DEV $MTPT " && continue
7024 /|/proc|/dev|/.dev|/dev/pts|/dev/shm|/proc/*|/sys|/var/run|/var/lock)
7029 proc|procfs|linprocfs|devfs|sysfs|usbfs|usbdevfs|devpts|securityfs)
7033 if [ -d "$MTPT" ]; then
7034 TMPFS_MTPTS="$TMPFS_MTPTS $MTPT"
7038 REG_MTPTS="$REG_MTPTS $MTPT"
7039 if echo "$PROTECTED_MOUNTS" | grep -qs "^$DEV "; then
7040 WEAK_MTPTS="$WEAK_MTPTS $MTPT "
7049 # Make sure tmpfs file systems are umounted before turning off
7050 # swap, to avoid running out of memory if the tmpfs filesystems
7051 # use a lot of space.
7053 if [ "$TMPFS_MTPTS" ]
7055 if [ "$VERBOSE" = no ]
7057 log_action_begin_msg "Unmounting temporary filesystems"
7059 log_action_end_msg $?
7061 log_action_msg "Will now unmount temporary filesystems"
7062 umount -v $TMPFS_MTPTS
7066 log_success_msg "Done unmounting temporary filesystems."
7068 log_failure_msg "Unmounting temporary filesystems failed with error code ${ES}."
7076 if [ "$VERBOSE" = no ]
7078 log_action_begin_msg "Deactivating swap"
7079 swapoff -a >/dev/null
7080 log_action_end_msg $?
7082 log_action_msg "Will now deactivate swap"
7087 log_success_msg "Done deactivating swap."
7089 log_failure_msg "Swap deactivation failed with error code ${ES}."
7094 # Unmount local filesystems
7096 [ -z "$REG_MTPTS" ] && return
7097 [ "$VERBOSE" = no ] && log_action_begin_msg "Unmounting local filesystems"
7098 REG_MTPTS="$(pioodl $REG_MTPTS)"
7100 for MTPT in $REG_MTPTS; do
7101 if echo "$WEAK_MTPTS" | grep -qs " $MTPT "; then
7106 if [ "$VERBOSE" = no ]; then
7107 umount $FORCE -r -d $MTPT
7109 [ "$ES" != 0 ] && [ "$ES2" = 0 ] && ES2=$ES
7111 log_action_begin_msg "Unmounting local filesystem $MTPT"
7112 umount $FORCE -v -r -d $MTPT
7114 if [ "$ES" = 0 ]; then
7115 log_success_msg "Done unmounting local filesystem $MTPT."
7117 log_failure_msg "Unmounting local filesystem $MTPT failed with error code $ES."
7121 [ "$VERBOSE" = no ] && log_action_end_msg $ES2
7128 restart|reload|force-reload)
7129 echo "Error: argument '$1' not supported" >&2
7136 echo "Usage: $0 start|stop" >&2
7144 # Provides: umountnfs
7145 # Required-Start: sendsigs
7149 # Short-Description: Unmount all network filesystems except the root file system.
7150 # Description: Also unmounts all virtual filesystems (proc, devfs, devpts,
7151 # usbfs, sysfs) that are not mounted at the top level.
7154 PATH=/usr/sbin:/usr/bin:/sbin:/bin
7155 KERNEL="$(uname -s)"
7156 RELEASE="$(uname -r)"
7159 . /lib/lsb/init-functions
7161 case "${KERNEL}:${RELEASE}" in
7162 Linux:[01].*|Linux:2.[01].*)
7165 Linux:2.[23].*|Linux:2.4.?|Linux:2.4.?-*|Linux:2.4.10|Linux:2.4.10-*)
7174 # Write a reboot record to /var/log/wtmp before unmounting
7177 # Remove bootclean flag files (precaution against symlink attacks)
7178 rm -f /tmp/.clean /var/lock/.clean /var/run/.clean
7180 [ "$VERBOSE" = no ] || log_action_begin_msg "Unmounting remote and non-toplevel virtual filesystems"
7183 # Make list of points to unmount in reverse order of their creation
7186 exec 9<&0 </proc/mounts
7189 while read DEV MTPT FSTYPE REST
7192 /|/proc|/dev|/dev/pts|/dev/shm|/proc/*|/sys|/var/run|/var/lock)
7197 nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs)
7200 proc|procfs|linprocfs|devfs|devpts|usbfs|usbdevfs|sysfs)
7214 [ "$VERBOSE" = no ] || log_action_end_msg $ES
7221 restart|reload|force-reload)
7222 echo "Error: argument '$1' not supported" >&2
7229 echo "Usage: umountnfs.sh [start|stop]" >&2
7237 # Provides: umountroot
7238 # Required-Start: umountfs
7239 # Required-Stop: umountfs
7242 # Short-Description: Mount the root filesystem read-only.
7248 . /lib/lsb/init-functions
7252 [ "$VERBOSE" = no ] || log_action_begin_msg "Mounting $MTPT filesystem read-only"
7254 [ "$(uname -s)" = "GNU/kFreeBSD" ] && MOUNT_FORCE_OPT=-f
7256 # mount -n -o remount,ro /
7257 # will act on a bind mount of / if there is one.
7258 # See #339023 and the comment in checkroot.sh
7259 mount $MOUNT_FORCE_OPT -n -o remount,ro -t dummytype dummydev $MTPT 2>/dev/null \
7260 || mount $MOUNT_FORCE_OPT -n -o remount,ro dummydev $MTPT 2>/dev/null \
7261 || mount $MOUNT_FORCE_OPT -n -o remount,ro $MTPT
7263 [ "$VERBOSE" = no ] || log_action_end_msg $ES
7267 # These directories must exist on the root filesystem as they are
7268 # targets for system mountpoints. We've just unmounted all other
7269 # filesystems, so either they are mounted now (in which case the
7270 # mount point exists) or we can make the mountpoint.
7271 for dir in /proc /sys /var/run /var/lock; do
7272 mkdir -p $dir || true
7274 exec 9<&0 < /proc/mounts
7278 while read DEV MTPT FSTYPE REST
7281 /proc|/dev|/.dev|/dev/pts|/dev/shm|/proc/*|/sys|/var/run|/var/lock)
7286 proc|procfs|linprocfs|devfs|sysfs|usbfs|usbdevfs|devpts|tmpfs)
7302 restart|reload|force-reload)
7303 echo "Error: argument '$1' not supported" >&2
7310 echo "Usage: $0 start|stop" >&2
7318 # skeleton example file to build /etc/init.d/ scripts.
7319 # This file should be used to construct scripts for /etc/init.d.
7321 # Written by Miquel van Smoorenburg <miquels@cistron.nl>.
7322 # Modified for Debian
7323 # by Ian Murdock <imurdock@gnu.ai.mit.edu>.
7325 # Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl
7328 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
7329 DAEMON=/usr/sbin/uniconfd
7331 DESC="UniConf daemon"
7333 test -x $DAEMON || exit 0
7335 # Include uniconf defaults if available
7336 if [ -f /etc/default/uniconfd ] ; then
7337 . /etc/default/uniconfd
7340 DAEMON_OPTS="$UNICONFD_OPTS $UNICONFD_MOUNTS"
7344 echo -n "Starting $DESC: "
7345 start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
7346 --make-pidfile --background \
7347 --exec $DAEMON -- -f $DAEMON_OPTS
7348 if [ "$?" != "0" ]; then ERR=$?; echo; exit $ERR; fi
7352 echo -n "Stopping $DESC: "
7353 start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
7355 if [ "$?" != "0" ]; then ERR=$?; echo; exit $ERR; fi
7360 # If the daemon can reload its config files on the fly
7361 # for example by sending it SIGHUP, do it here.
7363 # If the daemon responds to changes in its config file
7364 # directly anyway, make this a do-nothing entry.
7366 # echo "Reloading $DESC configuration files."
7367 # start-stop-daemon --stop --signal 1 --quiet --pidfile \
7368 # /var/run/$NAME.pid --exec $DAEMON
7370 restart|force-reload)
7372 # If the "reload" option is implemented, move the "force-reload"
7373 # option to the "reload" entry above. If not, "force-reload" is
7374 # just the same as "restart".
7376 echo -n "Restarting $DESC: "
7377 start-stop-daemon --stop --quiet --pidfile \
7378 /var/run/$NAME.pid --exec $DAEMON || exit $?
7380 start-stop-daemon --start --quiet --pidfile \
7381 /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
7382 if [ "$?" != "0" ]; then ERR=$?; echo; exit $ERR; fi
7387 # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
7388 echo "Usage: $N {start|stop|restart|force-reload}" >&2
7397 # Required-Start: $local_fs
7398 # Required-Stop: $local_fs
7401 # Short-Description: Save and restore random seed between restarts.
7402 # Description This script saves the random seed between restarts.
7403 # It is called from the boot, halt and reboot scripts.
7406 [ -c /dev/urandom ] || exit 0
7408 PATH=/usr/sbin:/usr/bin:/sbin:/bin
7409 SAVEDFILE=/var/lib/urandom/random-seed
7411 [ -f /proc/sys/kernel/random/poolsize ] && POOLSIZE="$(cat /proc/sys/kernel/random/poolsize)"
7414 . /lib/lsb/init-functions
7418 [ "$VERBOSE" = no ] || log_action_begin_msg "Initializing random number generator"
7419 # Load and then save $POOLSIZE bytes,
7420 # which is the size of the entropy pool
7421 if [ -f "$SAVEDFILE" ]
7423 # Handle locally increased pool size
7424 SAVEDSIZE="$(find "$SAVEDFILE" -printf "%s")"
7425 if [ "$SAVEDSIZE" -gt "$POOLSIZE" ]
7427 [ -w /proc/sys/kernel/random/poolsize ] && echo $POOLSIZE > /proc/sys/kernel/random/poolsize
7430 cat "$SAVEDFILE" >/dev/urandom
7434 dd if=/dev/urandom of=$SAVEDFILE bs=$POOLSIZE count=1 >/dev/null 2>&1
7437 [ "$VERBOSE" = no ] || log_action_end_msg $ES
7440 # Carry a random seed from shut-down to start-up;
7441 # see documentation in linux/drivers/char/random.c
7442 [ "$VERBOSE" = no ] || log_action_begin_msg "Saving random seed"
7444 dd if=/dev/urandom of=$SAVEDFILE bs=$POOLSIZE count=1 >/dev/null 2>&1
7446 [ "$VERBOSE" = no ] || log_action_end_msg $ES
7448 restart|reload|force-reload)
7449 echo "Error: argument '$1' not supported" >&2
7453 echo "Usage: urandom start|stop" >&2
7461 test -x /usr/sbin/vbetool || exit 0
7464 . /lib/lsb/init-functions
7466 test -f /etc/default/rcS && . /etc/default/rcS
7467 test -f /etc/default/acpi-support && . /etc/default/acpi-support
7468 test -f /usr/share/acpi-support/device-funcs && . /usr/share/acpi-support/device-funcs
7472 if laptop-detect > /dev/null; then
7476 if [ x$LAPTOP != xtrue ]; then
7481 log_begin_msg "Saving VESA state..."
7482 if [ "$SAVE_VBE_STATE" = "true" ]; then
7483 if [ "$VERBOSE" = no ]; then
7484 if ! vbetool vbestate save > $VBESTATE 2>/dev/null; then
7489 if ! vbetool vbestate save > $VBESTATE ; then
7504 # Required-Start: $network $local_fs
7508 # Short-Description: Wait for critical network file systems to be mounted
7509 # Description: Network file systems are mounted in the background when
7510 # interfaces are brought up; this script waits for
7511 # those among them which are critical for booting to be
7512 # mounted before carrying on.
7513 # Specifically, it will wait for file systems mounted
7514 # on /usr, /usr/*, /var, /var/*
7515 # This script WILL NOT wait on other network file which are
7516 # mounted elsewhere!
7519 [ -f /etc/default/rcS ] && . /etc/default/rcS
7520 . /lib/lsb/init-functions
7523 [ -f /etc/fstab ] || return
7525 # Read through fstab line by line, building a list of networked
7526 # file systems mounted on /usr* or /var*
7527 # Wait up to a fixed period of time for these file systems to mount
7530 exec 9<&0 </etc/fstab
7533 while read DEV MTPT FSTYPE OPTS REST
7541 noauto|*,noauto|noauto,*|*,noauto,*)
7546 nfs|nfs4|smbfs|cifs|coda|ncp|ncpfs|ocfs2|gfs)
7553 /usr/local|/usr/local/*)
7556 waitnfs="$waitnfs $MTPT"
7559 waitnfs="$waitnfs $MTPT"
7566 # Try mounting all networked filesystems here, just before waiting for
7567 # them; background this call so as not to block startup sequence
7568 /lib/init/mountall-net-fs &
7570 # Wait for each path, the timeout is for all of them as that's
7571 # really the maximum time we have to wait anyway
7573 for mountpt in $waitnfs; do
7574 log_action_begin_msg "Waiting for $mountpt"
7576 while ! mountpoint -q $mountpt; do
7579 TIMEOUT=$(( $TIMEOUT - 1 ))
7580 if [ $TIMEOUT -le 0 ]; then
7581 log_action_end_msg 1
7586 if [ $TIMEOUT -gt 0 ]; then
7587 log_action_end_msg 0
7596 restart|reload|force-reload)
7597 echo "Error: argument '$1' not supported" >&2
7603 echo "Usage: $0 start|stop" >&2
7613 # Required-Start: $network $local_fs $remote_fs
7614 # Required-Stop: $network $local_fs $remote_fs
7615 # Default-Start: 2 3 4 5
7616 # Default-Stop: 0 1 6
7617 # Short-Description: start Winbind daemon
7621 PATH=/sbin:/bin:/usr/sbin:/usr/bin
7623 [ -r /etc/default/winbind ] && . /etc/default/winbind
7625 DAEMON=/usr/sbin/winbindd
7626 PIDDIR=/var/run/samba
7628 # clear conflicting settings from the environment
7631 # See if the daemon is there
7632 test -x $DAEMON || exit 0
7634 . /lib/lsb/init-functions
7638 log_daemon_msg "Starting the Winbind daemon" "winbind"
7640 mkdir -p /var/run/samba/winbindd_privileged || return 1
7641 chgrp winbindd_priv $PIDDIR/winbindd_privileged/ || return 1
7642 chmod 0750 $PIDDIR/winbindd_privileged/ || return 1
7643 start-stop-daemon --start --quiet --oknodo --exec $DAEMON -- $WINBINDD_OPTS
7649 log_daemon_msg "Stopping the Winbind daemon" "winbind"
7650 start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
7654 restart|force-reload)
7655 $0 stop && sleep 2 && $0 start
7659 echo "Usage: /etc/init.d/winbind {start|stop|restart|force-reload}"
7666 # Provides: wpa-ifupdown
7667 # Required-Start: $network
7668 # Required-Stop: $network
7673 # Short-Description: Stop wpa_supplicant processes started via ifupdown
7674 # Description: Run ifdown on interfaces authenticated via
7675 # wpa_supplicant. Sendsigs terminates wpa_supplicant
7676 # processes before networking is stopped causing each
7677 # network interface authenticated via a wpa_supplicant
7678 # daemon to be terminated abrubtly.
7681 PATH=/usr/sbin:/usr/bin:/sbin:/bin
7683 test -d /var/run || exit 0
7685 test -x /sbin/ifdown || exit 0
7687 . /lib/lsb/init-functions
7689 stop_wpa_action () {
7690 test -x /sbin/wpa_action || return
7692 IFACES=$(find /var/run -maxdepth 1 -type f -name 'wpa_action.*.pid' -printf '%P\n' | cut -d'.' -f2)
7693 if test -n "$IFACES"; then
7694 log_daemon_msg "Stopping wpa_action roaming interfaces"
7695 for iface in $IFACES; do
7696 log_progress_msg "$iface"
7697 # wpa_action executes /sbin/ifdown
7698 wpa_action "$iface" stop >/dev/null 2>&1
7704 stop_wpa_supplicant () {
7706 IFACES=$(find /var/run -maxdepth 1 -type f -name 'wpa_supplicant.*.pid' -printf '%P\n' | cut -d'.' -f2)
7707 if test -n "$IFACES"; then
7708 log_daemon_msg "Stopping wpa_supplicant interfaces"
7709 for iface in $IFACES; do
7710 log_progress_msg "$iface"
7711 ifdown $iface >/dev/null 2>&1
7718 start|restart|force-reload)
7726 echo "Usage: $0 {start|stop|restart|force-reload}" >&2
7733 # /etc/init.d/x11-common: set up the X server and ICE socket directories
7735 # Provides: x11-common
7736 # Required-Start: $local_fs $remote_fs
7737 # Required-Stop: $local_fs $remote_fs
7738 # Should-Start: $named
7739 # Should-Stop: $named
7746 PATH=/bin:/usr/bin:/sbin:/usr/sbin
7747 SOCKET_DIR=/tmp/.X11-unix
7748 ICE_DIR=/tmp/.ICE-unix
7750 . /lib/lsb/init-functions
7751 if [ -f /etc/default/rcS ]; then
7756 # Restore file security context (SELinux).
7757 if which restorecon >/dev/null 2>&1; then
7762 set_up_socket_dir () {
7763 if [ "$VERBOSE" != no ]; then
7764 log_begin_msg "Setting up X server socket directory $SOCKET_DIR..."
7766 if [ -e $SOCKET_DIR ] && [ ! -d $SOCKET_DIR ]; then
7767 mv $SOCKET_DIR $SOCKET_DIR.$$
7769 mkdir -p $SOCKET_DIR
7770 chown 0:0 $SOCKET_DIR
7771 chmod 1777 $SOCKET_DIR
7772 do_restorecon $SOCKET_DIR
7773 [ "$VERBOSE" != no ] && log_end_msg 0 || return 0
7777 if [ "$VERBOSE" != no ]; then
7778 log_begin_msg "Setting up ICE socket directory $ICE_DIR..."
7780 if [ -e $ICE_DIR ] && [ ! -d $ICE_DIR ]; then
7781 mv $ICE_DIR $ICE_DIR.$$
7786 do_restorecon $ICE_DIR
7787 [ "$VERBOSE" != no ] && log_end_msg 0 || return 0
7791 if [ -d $ICE_DIR ] && [ -d $SOCKET_DIR ]; then
7804 restart|reload|force-reload)
7805 /etc/init.d/x11-common start
7816 log_success_msg "Usage: /etc/init.d/x11-common {start|stop|status|restart|reload|force-reload}"
7823 # vim:set ai et sts=2 sw=2 tw=0: