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
139 # alsa-utils initscript
142 # Provides: alsa-utils
143 # Required-Start: $remote_fs
144 # Required-Stop: $remote_fs
147 # Short-Description: Restore and store ALSA driver settings
148 # Description: This script stores and restores mixer levels on
149 # shutdown and bootup.On sysv-rc systems: to
150 # disable storing of mixer levels on shutdown,
151 # remove /etc/rc[06].d/K50alsa-utils. To disable
152 # restoring of mixer levels on bootup, rename the
153 # "S50alsa-utils" symbolic link in /etc/rcS.d/ to
157 # Don't use set -e; check exit status instead
159 # Exit silently if package is no longer installed
160 [ -x /sbin/alsactl ] || exit 0
162 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
163 MYNAME=/etc/init.d/alsa-utils
165 . /lib/lsb/init-functions
169 log_action_end_msg_and_exit()
171 log_action_end_msg "$1" ${2:+"$2"}
178 # If which is not available then we must be running before
179 # /usr is mounted on a system that has which in /usr/bin/.
180 # Conclude that $1 is not executable.
181 [ -x /bin/which ] || [ -x /usr/bin/which ] || return 1
182 which "$1" >/dev/null 2>&1
185 # Wait for filesystems to show up
186 while [ ! -d /usr/bin -o ! -d /var/lib/alsa ]; do
190 executable amixer || { echo "${MYNAME}: Error: No amixer program available." >&2 ; exit 1 ; }
192 bugout() { echo "${MYNAME}: Programming error" >&2 ; exit 123 ; }
194 # $1 <card ID> | "all"
197 [ -f /var/lib/alsa/asound.state ] || return 1
199 [ "$1" = all ] && CARD=""
200 # Assume that if alsactl prints a message on stderr
201 # then it failed somehow. This works around the fact
202 # that alsactl doesn't return nonzero status when it
203 # can't restore settings for the card
204 if MSG="$(alsactl restore $CARD 2>&1 >/dev/null)" && [ ! "$MSG" ] ; then
207 # Retry with the "force" option. This restores more levels
208 # but it results in much longer error messages.
209 alsactl -F restore $CARD >/dev/null 2>&1
210 [ -z "$CARD" ] && log_action_cont_msg "warning: 'alsactl restore' failed with error message '$MSG'"
215 # $1 <card ID> | "all"
219 [ "$1" = all ] && CARD=""
220 if MSG="$(alsactl store $CARD 2>&1)" ; then
224 [ -z "$CARD" ] && log_action_cont_msg "warning: 'alsactl store' failed with error message '$MSG'"
231 if [ -f /proc/asound/cards ] ; then
232 sed -n -e's/^[[:space:]]*\([0-7]\)[[:space:]].*/\1/p' /proc/asound/cards
236 filter_amixer_output()
239 -e '/Unable to find simple control/d' \
240 -e '/Unknown playback setup/d' \
244 # The following functions try to set many controls.
245 # No card has all the controls and so some of the attempts are bound to fail.
246 # Because of this, the functions can't return useful status values.
251 unmute_and_set_level()
253 { [ "$2" ] && [ "$CARDOPT" ] ; } || bugout
254 amixer $CARDOPT -q set "$1" "$2" unmute 2>&1 | filter_amixer_output || :
260 mute_and_zero_level()
262 { [ "$1" ] && [ "$CARDOPT" ] ; } || bugout
263 amixer $CARDOPT -q set "$1" "0%" mute 2>&1 | filter_amixer_output || :
272 { [ "$2" ] && [ "$CARDOPT" ] ; } || bugout
273 amixer $CARDOPT -q set "$1" "$2" 2>&1 | filter_amixer_output || :
278 sanify_levels_on_card()
282 unmute_and_set_level "Front" "80%"
283 unmute_and_set_level "Master" "80%"
284 unmute_and_set_level "Master Mono" "80%" # See Bug#406047
285 unmute_and_set_level "Master Digital" "80%" # E.g., cs4237B
286 unmute_and_set_level "Playback" "80%"
287 unmute_and_set_level "Headphone" "70%"
288 unmute_and_set_level "PCM" "80%"
289 unmute_and_set_level "PCM,1" "80%" # E.g., ess1969
290 unmute_and_set_level "DAC" "80%" # E.g., envy24, cs46xx
291 unmute_and_set_level "DAC,0" "80%" # E.g., envy24
292 unmute_and_set_level "DAC,1" "80%" # E.g., envy24
293 unmute_and_set_level "Synth" "80%"
294 unmute_and_set_level "CD" "80%"
296 mute_and_zero_level "Mic"
297 mute_and_zero_level "IEC958" # Ubuntu #19648
299 # Intel P4P800-MX (Ubuntu bug #5813)
300 switch_control "Master Playback Switch" on
301 switch_control "Master Surround" on
303 # Trident/YMFPCI/emu10k1:
304 unmute_and_set_level "Wave" "80%"
305 unmute_and_set_level "Music" "80%"
306 unmute_and_set_level "AC97" "80%"
309 unmute_and_set_level "Dynamic Range Compression" "80%"
311 # Required for HDA Intel (hda-intel):
312 unmute_and_set_level "Front" "80%"
314 # Required for SB Live 7.1/24-bit (ca0106):
315 unmute_and_set_level "Analog Front" "80%"
317 # Required at least for Via 823x hardware on DFI K8M800-MLVF Motherboard with kernels 2.6.10-3/4 (see ubuntu #7286):
318 switch_control "IEC958 Capture Monitor" off
320 # Required for hardware allowing toggles for AC97 through IEC958,
321 # valid values are 0, 1, 2, 3. Needs to be set to 0 for PCM1.
322 unmute_and_set_level "IEC958 Playback AC97-SPSA" "0"
324 # Required for newer Via hardware (see Ubuntu #31784)
325 unmute_and_set_level "VIA DXS,0" "80%"
326 unmute_and_set_level "VIA DXS,1" "80%"
327 unmute_and_set_level "VIA DXS,2" "80%"
328 unmute_and_set_level "VIA DXS,3" "80%"
330 # Required on some notebooks with ICH4:
331 switch_control "Headphone Jack Sense" off
332 switch_control "Line Jack Sense" off
334 # Some machines need one or more of these to be on;
335 # others need one or more of these to be off:
337 # switch_control "External Amplifier" on
338 switch_control "Audigy Analog/Digital Output Jack" on
339 switch_control "SB Live Analog/Digital Output Jack" on
341 # D1984 -- Thinkpad T61/X61
342 switch_control "Speaker" on
343 switch_control "Headphone" on
345 # HDA-Intel w/ "Digital" capture mixer (See Ubuntu #193823)
346 unmute_and_set_level "Digital" "80%"
351 # $1 <card ID> | "all"
354 TTSDML_RETURNSTATUS=0
357 for CARD in $(echo_card_indices) ; do
358 sanify_levels_on_card "$CARD" || TTSDML_RETURNSTATUS=1
362 sanify_levels_on_card "$1" || TTSDML_RETURNSTATUS=1
365 return $TTSDML_RETURNSTATUS
369 preinit_levels_on_card()
373 # Silly dance to activate internal speakers by default on PowerMac
374 # Snapper and Tumbler
375 id=`cat /proc/asound/card$1/id 2>/dev/null`
376 if [ "$id" = "Snapper" -o "$id" = "Tumbler" ]; then
377 switch_control "Auto Mute" off
378 switch_control "PC Speaker" off
379 switch_control "Auto Mute" on
383 # $1 <card ID> | "all"
386 TTSDML_RETURNSTATUS=0
389 for CARD in $(echo_card_indices) ; do
390 preinit_levels_on_card "$CARD" || TTSDML_RETURNSTATUS=1
394 preinit_levels_on_card "$1" || TTSDML_RETURNSTATUS=1
397 return $TTSDML_RETURNSTATUS
401 mute_and_zero_levels_on_card()
423 mute_and_zero_level "$CTL"
426 # "Audigy Analog/Digital Output Jack" \
427 # "SB Live Analog/Digital Output Jack"
429 # switch_control "$CTL" off
434 # $1 <card ID> | "all"
435 mute_and_zero_levels()
440 for CARD in $(echo_card_indices) ; do
441 mute_and_zero_levels_on_card "$CARD" || TTZML_RETURNSTATUS=1
445 mute_and_zero_levels_on_card "$1" || TTZML_RETURNSTATUS=1
448 return $TTZML_RETURNSTATUS
452 # $1 <card ID> | "all"
456 if [ "$1" = all ] ; then
460 [ -d "/proc/asound/card$1" ] || [ -d "/proc/asound/$1" ]
465 # If a card identifier is provided in $2 then regard it as an error
466 # if that card is not present; otherwise don't regard it as an error.
472 case "$TARGET_CARD" in
473 ""|all) TARGET_CARD=all ; log_action_begin_msg "Setting up ALSA" ;;
475 if ! card_OK "$TARGET_CARD"; then
476 [ "$TARGET_CARD" = "all" ] && log_action_end_msg "$( [ ! "$2" ] ; echo $? ; )" "none loaded"
479 preinit_levels "$TARGET_CARD" || EXITSTATUS=1
480 if ! restore_levels "$TARGET_CARD" ; then
481 sanify_levels "$TARGET_CARD" || EXITSTATUS=1
482 restore_levels "$TARGET_CARD" >/dev/null 2>&1 || :
484 [ "$TARGET_CARD" = "all" ] && log_action_end_msg_and_exit "$EXITSTATUS"
490 case "$TARGET_CARD" in
491 ""|all) TARGET_CARD=all ; log_action_begin_msg "Shutting down ALSA" ;;
492 *) log_action_begin_msg "Shutting down ALSA card ${TARGET_CARD}" ;;
494 card_OK "$TARGET_CARD" || log_action_end_msg_and_exit "$( [ ! "$2" ] ; echo $? ; )" "none loaded"
495 store_levels "$TARGET_CARD" || EXITSTATUS=1
496 mute_and_zero_levels "$TARGET_CARD" || EXITSTATUS=1
497 log_action_end_msg_and_exit "$EXITSTATUS"
499 restart|force-reload)
501 $0 stop || EXITSTATUS=1
502 $0 start || EXITSTATUS=1
507 case "$TARGET_CARD" in
508 ""|all) TARGET_CARD=all ; log_action_begin_msg "Resetting ALSA" ;;
509 *) log_action_begin_msg "Resetting ALSA card ${TARGET_CARD}" ;;
511 card_OK "$TARGET_CARD" || log_action_end_msg_and_exit "$( [ ! "$2" ] ; echo $? ; )" "none loaded"
512 preinit_levels "$TARGET_CARD"
513 sanify_levels "$TARGET_CARD"
514 log_action_end_msg_and_exit "$?"
517 echo "Usage: $MYNAME {start [CARD]|stop [CARD]|restart [CARD]|reset [CARD]}" >&2
524 # apache2 This init.d script is used to start apache2.
525 # It basically just calls apache2ctl.
527 ENV="env -i LANG=C PATH=/usr/local/bin:/usr/bin:/bin"
529 #edit /etc/default/apache2 to change this.
533 if [ -x /usr/sbin/apache2 ] ; then
539 . /lib/lsb/init-functions
541 test -f /etc/default/rcS && . /etc/default/rcS
542 test -f /etc/default/apache2 && . /etc/default/apache2
543 if [ "$NO_START" != "0" -a "$1" != "stop" ]; then
544 [ "$VERBOSE" != "no" ] && log_warning_msg "Not starting apache2 - edit /etc/default/apache2 and change NO_START to be 0.";
548 APACHE2="$ENV /usr/sbin/apache2"
549 APACHE2CTL="$ENV /usr/sbin/apache2ctl"
554 AP_CONF=/etc/apache2/apache2.conf
556 # apache2 allows more than PidFile entry in the config but only the
557 # last found in the config is used; we attempt to follow includes
558 # here, but only first-level includes are supported, not nested ones
560 for i in $AP_CONF `awk '$1 ~ /^\s*[Ii]nclude$/ && $2 ~ /^\// {print $2}' $AP_CONF`; do
561 PIDFILE=`grep -i ^PidFile $i | tail -n 1 | awk '{print $2}'`
562 if [ -e "$PIDFILE" ]; then
567 errors=`$APACHE2 -t 2>&1`
569 # if the config is ok than we just stop normaly
580 [ ! -d /proc/$PID ] && break
584 if [ "$VERBOSE" != "no" ]; then
586 echo "Apache2 failed to honor the stop command, please investigate the situation by hand."
594 if [ "$VERBOSE" != "no" ]; then
595 echo -n " ... no pidfile found! not running?"
600 [ "$VERBOSE" != "no" ] && echo "$errors"
602 # if we are here something is broken and we need to try
603 # to exit as nice and clean as possible
605 # if pidof is null for some reasons the script exits automagically
606 # classified as good/unknown feature
607 PIDS=`pidof apache2` || true
610 # if there is a pid we need to verify that belongs to apache2
613 if [ "$i" = "$PID" ]; then
614 # in this case the pid stored in the
615 # pidfile matches one of the pidof apache
616 # so a simple kill will make it
621 if [ $REALPID = 1 ]; then
622 # in this case everything is nice and dandy
623 # and we kill apache2
626 # this is the worst situation... just kill all of them
630 # Except, we can't do that, because it's very, very bad
631 if [ "$PIDS" ] && [ "$VERBOSE" != "no" ]; then
633 echo "You may still have some apache2 processes running. There are"
634 echo "processes named 'apache2' which do not match your pid file,"
635 echo "and in the name of safety, we've left them alone. Please review"
636 echo "the situation by hand."
643 # Stupid hack to keep lintian happy. (Warrk! Stupidhack!).
646 [ -f /etc/apache2/httpd.conf ] || touch /etc/apache2/httpd.conf
647 # ssl_scache shouldn't be here if we're just starting up.
648 [ -f /var/run/apache2/ssl_scache ] && rm -f /var/run/apache2/*ssl_scache*
649 # /var/run and /var/lock could be on a tmpfs
650 [ ! -d /var/run/apache2 ] && mkdir /var/run/apache2
651 [ ! -d /var/lock/apache2 ] && mkdir /var/lock/apache2
652 # Make sure /var/lock/apache2 has the correct permissions
653 chown www-data /var/lock/apache2
655 log_begin_msg "Starting apache 2.0 web server..."
656 if $APACHE2CTL startssl; then
663 log_begin_msg "Stopping apache 2.0 web server..."
671 log_begin_msg "Reloading apache 2.0 configuration..."
672 if $APACHE2CTL graceful $2 ; then
678 restart | force-reload)
679 log_begin_msg "Forcing reload of apache 2.0 web server..."
680 if ! apache_stop; then
683 if $APACHE2CTL startssl; then
693 echo "Usage: /etc/init.d/apache2 start|stop|restart|reload|force-reload" >&2
700 # Required-Start: $syslog $time $local_fs $remote_fs
701 # Required-Stop: $syslog $time $local_fs $remote_fs
702 # Default-Start: 2 3 4 5
703 # Default-Stop: S 0 1 6
704 # Short-Description: Deferred execution scheduler
705 # Description: Debian init script for the atd deferred executions
709 # Author: Ryan Murray <rmurray@debian.org>
713 PATH=/bin:/usr/bin:/sbin:/usr/sbin
716 test -x $DAEMON || exit 0
718 . /lib/lsb/init-functions
722 log_daemon_msg "Starting deferred execution scheduler" "atd"
727 log_daemon_msg "Stopping deferred execution scheduler" "atd"
731 force-reload|restart)
736 echo "Usage: /etc/init.d/atd {start|stop|restart|force-reload}"
744 # Provides: binfmt-support
745 # Required-Start: $local_fs $remote_fs
746 # Required-Stop: $local_fs $remote_fs
747 # Default-Start: 2 3 4 5
748 # Default-Stop: 0 1 6
749 # Short-Description: Support for extra binary formats
750 # Description: Enable support for extra binary formats using the Linux
751 # kernel's binfmt_misc facility.
754 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
756 DESC="additional executable binary formats"
758 test -x /usr/sbin/update-binfmts || exit 0
760 . /lib/lsb/init-functions
768 log_daemon_msg "Enabling $DESC" "$NAME"
769 update-binfmts --enable || CODE=$?
775 log_daemon_msg "Disabling $DESC" "$NAME"
776 update-binfmts --disable || CODE=$?
781 restart|force-reload)
788 echo "Usage: $N {start|stop|restart|force-reload}" >&2
800 # DO NOT RUN AFTER S:55bootmisc.sh and do not run this script directly
801 # in runlevel S. Instead write an initscript to call it.
806 . /lib/lsb/init-functions
808 # Should be called outside verbose message block
811 # Prevent symlink attack (See #264234.)
812 [ -L "$1" ] && log_warning_msg "bootclean: Deleting symbolic link '$1'."
813 rm -f "$1" || { log_failure_msg "bootclean: Failure deleting '$1'." ; return 1 ; }
814 # No user processes should be running, so no one should be able to introduce
815 # a symlink here. As an extra precaution, set noclobber.
817 :> "$1" || { log_failure_msg "bootclean: Failure creating '$1'." ; return 1 ; }
822 cd /tmp || { log_failure_msg "bootclean: Could not cd to /tmp." ; return 1 ; }
825 # Only clean out /tmp if it is world-writable. This ensures
826 # it really is a/the temp directory we're cleaning.
828 [ "$(find . -maxdepth 0 -perm -002)" = "." ] || return 0
832 log_warning_msg "Using default TMPTIME 0."
836 [ "$VERBOSE" = no ] || log_action_begin_msg "Cleaning /tmp"
839 # Remove regardless of TMPTIME setting
844 # Don't clean remaining files if TMPTIME is negative or 'infinite'
847 -*|infinite|infinity)
848 [ "$VERBOSE" = no ] || log_action_end_msg 0 "skipped"
854 # Wipe /tmp, excluding system files, but including lost+found
856 # If TMPTIME is set to 0, we do not use any ctime expression
857 # at all, so we can also delete files with timestamps
860 if [ "$TMPTIME" = 0 ]
865 TEXPR="-mtime +$TMPTIME -ctime +$TMPTIME -atime +$TMPTIME"
866 DEXPR="-mtime +$TMPTIME -ctime +$TMPTIME"
870 ! ( -path ./lost+found -uid 0 )
871 ! ( -path ./quota.user -uid 0 )
872 ! ( -path ./aquota.user -uid 0 )
873 ! ( -path ./quota.group -uid 0 )
874 ! ( -path ./aquota.group -uid 0 )
875 ! ( -path ./.journal -uid 0 )
876 ! ( -path ./.clean -uid 0 )
877 ! ( -path './...security*' -uid 0 )'
879 mkflagfile /tmp/.clean || return 1
883 if [ "$VERBOSE" = no ]
885 log_failure_msg "bootclean: Failure cleaning /tmp."
887 log_action_end_msg 1 "bootclean: Failure cleaning /tmp"
892 # First remove all old files...
893 # (Use xargs here so that only one additional process gets created)
895 find . -depth -xdev $TEXPR $EXCEPT ! -type d \
896 -print0 | xargs -0r rm -f -- \
897 || { report_err ; return 1 ; }
900 # ...and then all empty directories
901 # (Don't use xargs here because dirs must be removed one by one from
904 find . -depth -xdev $DEXPR $EXCEPT -type d -empty \
905 -exec rmdir \{\} \; \
906 || { report_err ; return 1 ; }
908 [ "$VERBOSE" = no ] || log_action_end_msg 0
912 which find >/dev/null 2>&1 || exit 1
913 which xargs >/dev/null 2>&1 || exit 1
915 # If there are flag files that have not been created by root
921 which stat >/dev/null 2>&1 && cleanuid="$(stat -c %u $D/.clean)"
922 # Poor's man stat %u, since stat (and /usr) might not be
923 # available in some bootup stages
924 [ "$cleanuid" ] || cleanuid="$(find $D/.clean -printf %U)"
925 [ "$cleanuid" ] || { log_failure_msg "bootclean: Could not stat '$D/.clean'." ; exit 1 ; }
926 if [ "$cleanuid" -ne 0 ]
928 rm -f $D/.clean || { log_failure_msg "bootclean: Could not delete '$D/.clean'." ; exit 1 ; }
933 [ -f /tmp/.clean ] && exit 0
936 [ -d /tmp ] && ! [ -f /tmp/.clean ] && { clean_tmp || ES=1 ; }
942 # Required-Start: mountdevsubfs
946 # Short-Description: Start or stop bootlogd.
947 # Description: Starts or stops the bootlogd log program
948 # which logs boot messages.
952 DAEMON=/sbin/bootlogd
953 [ -x "$DAEMON" ] || exit 0
956 BOOTLOGD_OPTS="-r -c"
957 [ -r /etc/default/bootlogd ] && . /etc/default/bootlogd
960 . /lib/lsb/init-functions
962 # Because bootlogd is broken on some systems, we take the special measure
963 # of requiring it to be enabled by setting an environment variable.
964 case "$BOOTLOGD_ENABLE" in
970 # Previously this script was symlinked as "stop-bootlogd" which, when run
971 # with the "start" argument, should stop bootlogd. Now stop-bootlogd is
972 # a distinct script, but for backward compatibility this script continues
973 # to implement the old behavior.
975 SCRIPTNAME=${SCRIPTNAME#[SK]??}
979 [ "$ACTION" = start ] && ACTION=stop
986 log_daemon_msg "Starting $DESC" "$NAME"
990 start-stop-daemon --start --quiet --exec $DAEMON -- \
994 $DAEMON $BOOTLOGD_OPTS
1000 PATH=/sbin:/bin:/usr/sbin:/usr/bin
1001 log_daemon_msg "Stopping $DESC" "$NAME"
1002 start-stop-daemon --stop --quiet --exec $DAEMON
1006 if [ -f /var/log/boot ] && [ -f /var/log/boot~ ]
1008 [ "$VERBOSE" = no ] || log_action_begin_msg "Moving boot log file"
1009 # bootlogd writes to boot, making backup at boot~
1012 savelog -q -p -c 5 boot \
1017 [ "$VERBOSE" = no ] || log_action_end_msg $ES
1020 restart|force-reload)
1021 /etc/init.d/bootlogd stop
1022 /etc/init.d/bootlogd start
1025 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
1033 # Provides: bootmisc
1034 # Required-Start: $local_fs hostname $remote_fs
1035 # Required-Stop: $local_fs
1038 # Short-Description: Miscellaneous things to be done during bootup.
1042 PATH=/usr/sbin:/usr/bin:/sbin:/bin
1043 [ "$DELAYLOGIN" ] || DELAYLOGIN=yes
1048 # If login delaying is enabled then create the flag file
1049 # which prevents logins before startup is complete
1051 case "$DELAYLOGIN" in
1053 echo "System bootup in progress - please wait" > /var/lib/initscripts/nologin
1057 # Create /var/run/utmp so we can login.
1059 if grep -q ^utmp: /etc/group
1061 chmod 664 /var/run/utmp
1062 chgrp utmp /var/run/utmp
1065 # Set pseudo-terminal access permissions.
1066 if [ ! -e /dev/.devfsd ] && [ -c /dev/ttyp0 ]
1068 chmod -f 666 /dev/tty[p-za-e][0-9a-f]
1069 chown -f root:tty /dev/tty[p-za-e][0-9a-f]
1073 uname -snrvm > /var/run/motd
1074 [ -f /etc/motd.tail ] && cat /etc/motd.tail >> /var/run/motd
1076 # Save kernel messages in /var/log/dmesg
1077 if which dmesg >/dev/null 2>&1
1079 savelog -q -p -c 5 /var/log/dmesg
1080 dmesg -s 524288 > /var/log/dmesg
1081 chgrp adm /var/log/dmesg || :
1082 elif [ -c /dev/klog ]
1084 savelog -q -p -c 5 /var/log/dmesg
1085 dd if=/dev/klog of=/var/log/dmesg &
1088 [ -f /var/log/dmesg ] && { chgrp adm /var/log/dmesg || : ; }
1091 # Remove bootclean's flag files.
1092 # Don't run bootclean again after this!
1100 restart|reload|force-reload)
1101 echo "Error: argument '$1' not supported" >&2
1108 echo "Usage: bootmisc.sh [start|stop]" >&2
1117 # Required-Start: modutils checkroot
1119 # Should-Start: lvm cryptdisks
1123 # Short-Description: Check all filesystems.
1127 FSCK_LOGFILE=/var/log/fsck/checkfs
1128 [ "$FSCKFIX" ] || FSCKFIX=no
1130 . /lib/init/usplash-fsck-functions.sh
1132 . /lib/lsb/init-functions
1134 # Always output fsck progress
1135 stdin=`readlink /proc/self/fd/0`
1136 if [ "${stdin#/dev/null}" != "$stdin" ]; then
1137 exec </dev/console >/dev/console 2>&1
1141 # See if we're on AC Power
1142 # If not, we're not gonna run our check
1143 if which on_ac_power >/dev/null 2>&1
1145 on_ac_power >/dev/null 2>&1
1148 [ "$VERBOSE" = no ] || log_success_msg "Running on battery power, so skipping file system check."
1154 # Check the rest of the file systems.
1156 if [ ! -f /fastboot ] && [ ! "$BAT" ] && [ "$FSCKTYPES" != "none" ]
1158 if [ -f /forcefsck ]
1164 if [ "$FSCKFIX" = yes ]
1172 dumb|network|unknown|"")
1176 [ "$(uname -m)" = s390 ] && spinner="" # This should go away
1178 [ "$FSCKTYPES" ] && FSCKTYPES_OPT="-t $FSCKTYPES"
1179 handle_failed_fsck() {
1180 log_failure_msg "File system check failed.
1181 A log is being saved in ${FSCK_LOGFILE} if that location is writable.
1182 Please repair the file system manually."
1183 log_warning_msg "A maintenance shell will now be started.
1184 CONTROL-D will terminate this shell and resume system boot."
1185 # Start a single user shell on the console
1186 if ! sulogin $CONSOLE
1188 log_failure_msg "Attempt to start maintenance shell failed.
1189 Continuing with system boot in 5 seconds."
1193 if [ "$VERBOSE" = no ]
1195 log_action_begin_msg "Checking file systems"
1196 if pidof usplash; then
1197 PROGRESS_FILE=`mktemp` || exit 1
1199 logsave -s $FSCK_LOGFILE fsck -C3 -R -A $fix $force $FSCKTYPES_OPT >/dev/console 2>&1 3>$PROGRESS_FILE &
1201 usplash_progress "$PROGRESS_FILE"
1202 rm -f $PROGRESS_FILE
1204 logsave -s $FSCK_LOGFILE fsck $spinner -R -A $fix $force $FSCKTYPES_OPT
1208 if [ "$FSCKCODE" -gt 1 ]
1210 log_action_end_msg 1 "code $FSCKCODE"
1213 log_action_end_msg 0
1218 log_action_msg "Will now check all file systems of types $FSCKTYPES"
1220 log_action_msg "Will now check all file systems"
1222 logsave -s $FSCK_LOGFILE fsck $spinner -V -R -A $fix $force $FSCKTYPES_OPT
1224 if [ "$FSCKCODE" -gt 1 ]
1228 log_success_msg "Done checking file systems.
1229 A log is being saved in ${FSCK_LOGFILE} if that location is writable."
1233 rm -f /fastboot /forcefsck
1240 restart|reload|force-reload)
1241 echo "Error: argument '$1' not supported" >&2
1248 echo "Usage: checkfs.sh [start|stop]" >&2
1256 # Provides: checkroot
1257 # Required-Start: mountdevsubfs
1259 # Should-Start: keymap hwclockfirst
1263 # Short-Description: Check to root file system.
1266 PATH=/lib/init:/sbin:/bin
1267 FSCK_LOGFILE=/var/log/fsck/checkroot
1268 [ "$FSCKFIX" ] || FSCKFIX=no
1269 [ "$SULOGIN" ] || SULOGIN=no
1271 . /lib/init/usplash-fsck-functions.sh
1273 . /lib/lsb/init-functions
1275 # Always output fsck progress
1276 stdin=`readlink /proc/self/fd/0`
1277 if [ "${stdin#/dev/null}" != "$stdin" ]; then
1278 exec </dev/console >/dev/console 2>&1
1283 # Set SULOGIN in /etc/default/rcS to yes if you want a sulogin to
1284 # be spawned from this script *before anything else* with a timeout,
1287 [ "$SULOGIN" = yes ] && sulogin -t 30 $CONSOLE
1289 KERNEL="$(uname -s)"
1290 MACHINE="$(uname -m)"
1293 # Read /etc/fstab, looking for:
1294 # 1) The root filesystem, resolving LABEL=*|UUID=* entries to the
1296 # 2) Swap that is on a md device or a file that may be on a md
1298 # 3) The mount parameters for a devfs filesystem.
1301 exec 9<&0 </etc/fstab
1313 while read DEV MTPT FSTYPE OPTS DUMP PASS JUNK
1320 [ "$FSTYPE" = "swap" ] && swap_on_lv=yes
1325 if [ "$MTPT" = "/" ] && which findfs >/dev/null 2>&1
1327 DEV="$(findfs "$DEV")"
1331 [ "$FSTYPE" = "swap" ] && swap_on_file=yes
1334 # Devfs definition ?
1335 if [ "$FSTYPE" = "devfs" ] && [ "$MTPT" = "/dev" ] && mountpoint -q /dev
1337 devfs="-t $FSTYPE $DEV $MTPT"
1341 [ "$MTPT" != "/" ] && continue
1346 ( [ "$PASS" != 0 ] && [ "$PASS" != "" ] ) && rootcheck=yes
1347 ( [ "$FSTYPE" = "nfs" ] || [ "$FSTYPE" = "nfs4" ] ) && rootcheck=no
1349 ro|ro,*|*,ro|*,ro,*)
1358 # Activate the swap device(s) in /etc/fstab. This needs to be done
1359 # before fsck, since fsck can be quite memory-hungry.
1364 if [ "$swap_on_lv" = yes ]
1366 [ "$VERBOSE" = no ] || log_warning_msg "Not activating swap on logical volume."
1367 elif [ "$swap_on_file" = yes ]
1369 [ "$VERBOSE" = no ] || log_warning_msg "Not activating swap on swapfile."
1378 if [ "$ENABLE_SWAP" = yes ]
1380 if [ "$VERBOSE" = no ]
1382 log_action_begin_msg "Activating swap"
1383 swapon -a -e >/dev/null 2>&1
1384 log_action_end_msg $?
1386 log_action_msg "Will now activate swap"
1391 log_success_msg "Done activating swap."
1393 log_failure_msg "Swap activation failed with error code ${ES}."
1399 # Does the root device in /etc/fstab match with the actual device ?
1400 # If not we try to use the /dev/root alias device, and if that
1401 # fails we create a temporary node in /dev/shm.
1403 if [ "$rootcheck" = yes ]
1405 ddev="$(mountpoint -qx $rootdev)"
1406 rdev="$(mountpoint -d /)"
1407 if [ "$ddev" != "$rdev" ] && [ "$ddev" != "4:0" ]
1409 if [ "$(mountpoint -qx /dev/root)" = "4:0" ]
1414 rm -f /dev/shm/root \
1415 && mknod -m 600 /dev/shm/root b ${rdev%:*} ${rdev#*:} \
1416 && [ -e /dev/shm/root ]
1418 rootdev=/dev/shm/root
1427 # Bother, said Pooh.
1429 if [ "$rootfatal" = yes ]
1431 log_failure_msg "The device node $rootdev for the root filesystem is missing or incorrect
1432 or there is no entry for the root filesystem listed in /etc/fstab.
1433 The system is also unable to create a temporary node in /dev/shm.
1434 This means you have to fix the problem manually."
1435 log_warning_msg "A maintenance shell will now be started.
1436 CONTROL-D will terminate this shell and restart the system."
1437 # Start a single user shell on the console
1438 if ! sulogin $CONSOLE
1440 log_failure_msg "Attempt to start maintenance shell failed.
1441 Will restart in 5 seconds."
1444 [ "$VERBOSE" = no ] || log_action_msg "Will now restart"
1448 # See if we're on AC Power
1449 # If not, we're not gonna run our check
1450 if which on_ac_power >/dev/null 2>&1 && [ "$rootcheck" = yes ]
1452 if [ -d /proc/acpi ]; then
1453 modprobe ac >/dev/null 2>&1
1455 on_ac_power >/dev/null 2>&1
1458 log_warning_msg "On battery power, so skipping file system check."
1464 # See if we want to check the root file system.
1469 [ "$rootcheck" = yes ] && log_warning_msg "Fast boot enabled, so skipping file system check."
1473 if [ "$rootcheck" = yes ]
1476 # Ensure that root is quiescent and read-only before fsck'ing.
1478 # mount -n -o remount,ro / would be the correct syntax but
1479 # mount can get confused when there is a "bind" mount defined
1480 # in fstab that bind-mounts "/" somewhere else.
1482 # So we use mount -n -o remount,ro $rootdev / but that can
1483 # fail on older kernels on sparc64/alpha architectures due
1484 # to a bug in sys_mount().
1486 # As a compromise we try both.
1489 ! mount -n -o remount,ro $rootdev / \
1490 && ! mount -n -o remount,ro -t dummytype $rootdev / 2>/dev/null \
1491 && ! mount -n -o remount,ro / 2>/dev/null
1493 log_failure_msg "Cannot check root file system because it is not mounted read-only."
1499 # The actual checking is done here.
1501 if [ "$rootcheck" = yes ]
1503 if [ -f /forcefsck ]
1510 if [ "$FSCKFIX" = yes ]
1519 dumb|network|unknown|"")
1522 # This Linux/s390 special case should go away.
1523 if [ "${KERNEL}:${MACHINE}" = Linux:s390 ]
1528 if [ "$VERBOSE" = no ]
1530 log_action_begin_msg "Checking root file system"
1531 if [ "$roottype" = "ext2" -o "$roottype" = "ext3" ] && pidof usplash; then
1532 PROGRESS_FILE=`mktemp -p /var/run` || PROGRESS_FILE=/var/run/checkroot_fsck
1534 logsave -s $FSCK_LOGFILE fsck -C3 $force $fix -t $roottype $rootdev >/dev/console 2>&1 3>$PROGRESS_FILE &
1536 usplash_progress "$PROGRESS_FILE"
1537 rm -f $PROGRESS_FILE
1539 logsave -s $FSCK_LOGFILE fsck $spinner $force $fix -t $roottype $rootdev
1542 if [ "$FSCKCODE" = 0 ]
1544 log_action_end_msg 0
1546 log_action_end_msg 1 "code $FSCKCODE"
1549 log_action_msg "Will now check root file system"
1550 logsave -s $FSCK_LOGFILE fsck $spinner $force $fix -V -t $roottype $rootdev
1552 if [ "$FSCKCODE" = 0 ]
1554 log_success_msg "Done checking root file system.
1555 A log will be saved in ${FSCK_LOGFILE} if that location is writable."
1557 log_failure_msg "Root file system check failed with error code ${FSCKCODE}.
1558 A log is being saved in ${FSCK_LOGFILE} if that location is writable."
1564 # If there was a failure, drop into single-user mode.
1566 # NOTE: "failure" is defined as exiting with a return code of
1567 # 4 or larger. A return code of 1 indicates that file system
1568 # errors were corrected but that the boot may proceed. A return
1569 # code of 2 or 3 indicates that the system should immediately reboot.
1571 if [ "$FSCKCODE" -gt 3 ]
1573 # Surprise! Re-directing from a HERE document (as in "cat << EOF")
1574 # does not work because the root is currently read-only.
1575 log_failure_msg "An automatic file system check (fsck) of the root filesystem failed.
1576 A manual fsck must be performed, then the system restarted.
1577 The fsck should be performed in maintenance mode with the
1578 root filesystem mounted in read-only mode."
1579 log_warning_msg "The root filesystem is currently mounted in read-only mode.
1580 A maintenance shell will now be started.
1581 After performing system maintenance, press CONTROL-D
1582 to terminate the maintenance shell and restart the system."
1583 # Start a single user shell on the console
1584 if ! sulogin $CONSOLE
1586 log_failure_msg "Attempt to start maintenance shell failed.
1587 Will restart in 5 seconds."
1590 [ "$VERBOSE" = no ] || log_action_msg "Will now restart"
1592 elif [ "$FSCKCODE" -gt 1 ]
1594 log_failure_msg "The file system check corrected errors on the root partition
1595 but requested that the system be restarted."
1596 log_warning_msg "The system will be restarted in 5 seconds."
1598 [ "$VERBOSE" = no ] || log_action_msg "Will now restart"
1603 # Remount root to final mode (rw or ro).
1605 # See the comments above at the previous "mount -o remount"
1606 # for an explanation why we try this twice.
1608 if ! mount -n -o remount,$rootopts,$rootmode $fstabroot / 2>/dev/null
1610 mount -n -o remount,$rootopts,$rootmode /
1614 # We only create/modify /etc/mtab if the location where it is
1615 # stored is writable. If /etc/mtab is a symlink into /proc/
1616 # then it is not writable.
1619 MTAB_PATH="$(readlink -f /etc/mtab || :)"
1620 case "$MTAB_PATH" in
1624 if touch "$MTAB_PATH" >/dev/null 2>&1
1632 [ -L /etc/mtab ] && MTAB_PATH="$(readlink /etc/mtab)"
1635 log_failure_msg "Cannot initialize ${MTAB_PATH}."
1637 log_failure_msg "Cannot initialize /etc/mtab."
1641 log_failure_msg "Illegal mtab location '${MTAB_PATH}'."
1645 if [ "$INIT_MTAB_FILE" = yes ]
1647 [ "$roottype" != none ] &&
1648 mount -f -o $rootopts -t $roottype $fstabroot /
1649 [ "$devfs" ] && mount -f $devfs
1653 # Remove /dev/shm/root if we created it.
1662 restart|reload|force-reload)
1663 echo "Error: argument '$1' not supported" >&2
1670 echo "Usage: checkroot.sh [start|stop]" >&2
1678 # This file was automatically customized by debmake on Fri, 6 Nov 1998 23:00:08 -0600
1680 # Written by Miquel van Smoorenburg <miquels@drinkel.ow.org>.
1681 # Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>.
1682 # Modified for Debian by Christoph Lameter <clameter@debian.org>
1683 # Modified for chrony by John Hasler <jhasler@debian.org> 10 Nov 1998
1685 PATH=/bin:/usr/bin:/sbin:/usr/sbin
1686 DAEMON=/usr/sbin/chronyd
1691 test -f $DAEMON || exit 0
1695 start-stop-daemon --start --verbose --exec $DAEMON
1698 start-stop-daemon --stop --verbose --oknodo --exec $DAEMON
1700 restart|force-reload)
1702 # If the "reload" option is implemented, move the "force-reload"
1703 # option to the "reload" entry above. If not, "force-reload" is
1704 # just the same as "restart".
1706 echo -n "Restarting $DESC: "
1707 start-stop-daemon --stop --quiet --exec $DAEMON
1709 start-stop-daemon --start --quiet --exec $DAEMON -- -r
1713 echo "Usage: /etc/init.d/chrony {start|stop|restart|force-reload}"
1721 # Provides: console-screen
1722 # Required-Start: $local_fs $remote_fs
1723 # Required-Stop: $local_fs $remote_fs
1724 # Default-Start: S 2 3 4 5
1725 # Default-Stop: 0 1 6
1726 # Should-Start: $syslog
1728 # Description: Set console screen modes and fonts
1729 # Short-Description: Prepare console
1733 # This is the boot script for the `console-tools' package.
1735 # It loads parameters from /etc/console-tools/config, maybe loads
1736 # default screen-font, screen font-map, and application charset-map,
1737 # and maybe start "vcstime"
1739 # (c) 1997 Yann Dirson
1741 # If setupcon is present, then we've been superseded by console-setup.
1742 if type setupcon >/dev/null 2>&1; then
1746 # check if usplash is runing and skip this, we'll get run again later
1747 if pidof usplash > /dev/null; then
1751 if [ -r /etc/console-tools/config ] ; then
1752 . /etc/console-tools/config
1755 if [ -d /etc/console-tools/config.d ]; then
1756 for i in `run-parts --list /etc/console-tools/config.d `; do
1761 . /lib/lsb/init-functions
1763 PATH=/sbin:/bin:/usr/sbin:/usr/bin
1764 SETFONT="/usr/bin/consolechars"
1766 CHARSET="/usr/bin/charset"
1767 VCSTIME="/usr/sbin/vcstime"
1769 # Different device name for 2.6 kernels and devfs
1770 if [ `uname -r | cut -f 2 -d .` = 6 ] && [ -e /dev/.devfsd ]; then
1771 VCSTIME_OPT="-2 /dev/vcsa0"
1778 # set DEVICE_PREFIX depending on devfs/udev
1779 if [ -d /dev/vc ]; then
1780 DEVICE_PREFIX="/dev/vc/"
1782 DEVICE_PREFIX="/dev/tty"
1785 reset_vga_palette ()
1787 if [ -f /proc/fb ]; then
1788 # They have a framebuffer device.
1789 # That means we have work to do...
1796 # be sure the main program is installed
1797 [ -x "${SETFONT}" ] || return 0
1800 # If we can't access the console, quit
1801 CONSOLE_TYPE=`fgconsole 2>/dev/null` || return 0
1803 if [ ! $CONSOLE_TYPE = "serial" ] ; then
1804 readlink /proc/self/fd/0 | grep -q -e /dev/vc -e '/dev/tty[^p]' -e /dev/console
1805 if [ $? -eq 0 ] ; then
1811 [ $VT = "no" ] && return 0
1814 if [ "${DO_VCSTIME}" = "yes" -a -x ${VCSTIME} ] ; then
1815 [ "$VERBOSE" != "no" ] && log_action_begin_msg "Starting clock on text console"
1816 ${VCSTIME} ${VCSTIME_OPT} &
1817 [ "$VERBOSE" != "no" ] && log_action_end_msg 0
1821 # Global default font+sfm
1822 if [ "${SCREEN_FONT}" ]
1824 [ "$VERBOSE" != "no" ] && log_action_begin_msg "Setting up general console font"
1825 SCREEN_FONT="-f ${SCREEN_FONT}"
1827 # maybe use an external SFM
1828 [ "${SCREEN_FONT_MAP}" ] && SCREEN_FONT_MAP="-u ${SCREEN_FONT_MAP}"
1830 # Try to be cleverer and run for all consoles, but this is run
1831 # _before_ getty and so only one console running. So,
1832 # Set for the first 6 VCs (as they are allocated in /etc/inittab)
1833 NUM_CONSOLES=`fgconsole --next-available`
1834 NUM_CONSOLES=$(($NUM_CONSOLES - 1))
1835 [ ${NUM_CONSOLES} -eq 1 ] && NUM_CONSOLES=6
1837 while [ $i -le $NUM_CONSOLES ]
1839 if ! ${SETFONT} --tty=${DEVICE_PREFIX}$i ${SETFONT_OPT} ${SCREEN_FONT} ${SCREEN_FONT_MAP} ; then
1840 [ "$VERBOSE" != "no" ] && log_action_end_msg 1
1842 elif [ "$i" -eq "$NUM_CONSOLES" ]; then
1843 [ "$VERBOSE" != "no" ] && log_action_end_msg 0
1851 VCS="`set | grep '^SCREEN_FONT_vc[0-9]*=' | sed -e 's/^SCREEN_FONT_vc//' -e 's/=.*//'`"
1854 [ "$VERBOSE" != "no" ] && log_action_begin_msg "Setting up per-VC fonts"
1857 # extract FONTNAME info from variable setting
1858 eval font=\$SCREEN_FONT_vc$vc
1859 # eventually find an associated SFM
1860 eval sfm=\${SCREEN_FONT_MAP_vc${vc}}
1861 [ "$sfm" ] && sfm="-u $sfm"
1863 ${SETFONT} --tty=${DEVICE_PREFIX}$vc ${SETFONT_OPT} -f $font $sfm
1865 [ "$VERBOSE" != "no" ] && log_action_end_msg 0
1870 [ "${APP_CHARSET_MAP}" ] && ${CHARSET} G0 ${APP_CHARSET_MAP}
1874 VCS="`set | grep '^APP_CHARSET_MAP_vc[0-9]*=' | sed -e 's/^APP_CHARSET_MAP_vc//' -e 's/=.*//'`"
1877 [ "$VERBOSE" != "no" ] && log_action_begin_msg "Setting up per-VC ACM\'s"
1880 # extract FONTNAME info from variable setting
1881 eval acm=\$APP_CHARSET_MAP_vc$vc
1882 ${CHARSET} --tty="${DEVICE_PREFIX}$vc" G0 "$acm"
1884 [ "$VERBOSE" != "no" ] && log_action_end_msg 0
1888 # Go to UTF-8 mode as necessary
1891 [ -r /etc/environment ] && ENV_FILE="/etc/environment"
1892 [ -r /etc/default/locale ] && ENV_FILE="/etc/default/locale"
1893 [ "$ENV_FILE" ] && CHARMAP=$(set -a && . "$ENV_FILE" && locale charmap)
1894 if test "$CHARMAP" = "UTF-8"
1896 unicode_start 2> /dev/null || true
1898 unicode_stop 2> /dev/null|| true
1903 if [ "$BLANK_TIME" ]; then
1904 setterm_args="$setterm_args -blank $BLANK_TIME"
1906 if [ "$BLANK_DPMS" ]; then
1907 setterm_args="$setterm_args -powersave $BLANK_DPMS"
1909 if [ "$POWERDOWN_TIME" ]; then
1910 setterm_args="$setterm_args -powerdown $POWERDOWN_TIME"
1912 if [ "$setterm_args" ]; then
1913 setterm $setterm_args
1916 # Keyboard rate and delay
1918 if [ -n "$KEYBOARD_RATE" ]; then
1919 KBDRATE_ARGS="-r $KEYBOARD_RATE"
1921 if [ -n "$KEYBOARD_DELAY" ]; then
1922 KBDRATE_ARGS="$KBDRATE_ARGS -d $KEYBOARD_DELAY"
1924 if [ -n "$KBDRATE_ARGS" ]; then
1925 [ "$VERBOSE" != "no" ] && log_action_begin_msg "Setting keyboard rate and delay"
1926 kbdrate -s $KBDRATE_ARGS
1927 [ "$VERBOSE" != "no" ] && log_action_end_msg 0
1930 # Inform gpm if present, of potential changes.
1931 if [ -f /var/run/gpm.pid ]; then
1932 kill -WINCH `cat /var/run/gpm.pid` 2> /dev/null
1935 # Allow user to remap keys on the console
1936 if [ -r /etc/console-tools/remap ]
1938 dumpkeys < ${DEVICE_PREFIX}1 | sed -f /etc/console-tools/remap | loadkeys --quiet
1941 if [ "$LEDS" != "" ]
1944 while [ $i -le $NUM_CONSOLES ]
1946 setleds -D $LEDS < $DEVICE_PREFIX$i
1953 start|reload|restart|force-reload)
1954 log_action_msg "Setting console screen modes and fonts"
1964 # Start/stop the cron daemon.
1968 # Required-Start: $syslog $time
1969 # Required-Stop: $syslog $time
1970 # Default-Start: 2 3 4 5
1971 # Default-Stop: 0 1 6
1972 # Short-Description: Regular background program processing daemon
1973 # Description: cron is a standard UNIX program that runs user-specified
1974 # programs at periodic scheduled times. vixie cron adds a
1975 # number of features to the basic UNIX cron, including better
1976 # security and more powerful configuration options.
1980 test -f /usr/sbin/cron || exit 0
1982 #LSBNAMES='-l' # Uncomment for LSB name support in /etc/cron.d/
1984 . /lib/lsb/init-functions
1987 start) log_daemon_msg "Starting periodic command scheduler" "crond"
1988 start-stop-daemon --start --quiet --pidfile /var/run/crond.pid --name cron --startas /usr/sbin/cron -- $LSBNAMES
1991 stop) log_daemon_msg "Stopping periodic command scheduler" "crond"
1992 start-stop-daemon --stop --quiet --pidfile /var/run/crond.pid --name cron
1995 restart) log_daemon_msg "Restarting periodic command scheduler" "crond"
1996 start-stop-daemon --stop --retry 5 --quiet --pidfile /var/run/crond.pid --name cron
1997 start-stop-daemon --start --quiet --pidfile /var/run/crond.pid --name cron --startas /usr/sbin/cron -- $LSBNAMES
2000 reload|force-reload) log_daemon_msg "Reloading configuration files for periodic command scheduler" "crond"
2001 # cron reloads automatically
2004 *) log_action_msg "Usage: /etc/init.d/cron {start|stop|restart|reload|force-reload}"
2012 # Required-Start: $remote_fs $syslog
2013 # Required-Stop: $remote_fs $syslog
2014 # Default-Start: 2 3 4 5
2016 # Short-Description: D-Bus systemwide message bus
2017 # Description: D-Bus is a simple interprocess messaging system, used
2018 # for sending messages between applications.
2020 # -*- coding: utf-8 -*-
2021 # Debian init.d script for D-BUS
2022 # Copyright © 2003 Colin Walters <walters@debian.org>
2023 # Copyright © 2005 Sjoerd Simons <sjoerd@debian.org>
2027 DAEMON=/usr/bin/dbus-daemon
2028 UUIDGEN=/usr/bin/dbus-uuidgen
2029 UUIDGEN_OPTS=--ensure
2031 DAEMONUSER=messagebus
2032 PIDDIR=/var/run/dbus
2034 DESC="system message bus"
2035 EVENTDIR=/etc/dbus-1/event.d
2037 test -x $DAEMON || exit 0
2039 . /lib/lsb/init-functions
2041 # Source defaults file; edit that file to configure this script.
2043 if [ -e /etc/default/dbus ]; then
2047 if [ -n "$ENABLED" ]; then
2048 log_warning_msg "The ENABLED option in /etc/default/$NAME has been deprecated."
2049 log_warning_msg "Please remove this setting from the configuration file."
2050 log_warning_msg "To disable the service use a runlevel editor like sysv-rc-conf or bum instead."
2053 create_machineid() {
2054 # Create machine-id file
2055 if [ -x $UUIDGEN ]; then
2056 $UUIDGEN $UUIDGEN_OPTS
2060 dependent_services()
2062 # Do nothing if we are called by init
2063 [ ! -z $runlevel ] && return
2065 # Determine current runlevel
2066 r=$(/sbin/runlevel) || true
2069 # Do nothing if we can't determine the runlevel (e.g. inside chroots)
2070 [ "$r" = "unknown" ] && return
2072 if [ "$1" = "stop" ] ; then
2080 # Get the list of services active in this runlevel
2081 if [ -d /etc/rc${r}.d/ ] ; then # sysv-rc
2082 services=$(grep -s -l "^# Required-Start:.*dbus" /etc/rc${r}.d/S??* | sort $param)
2083 elif [ -f /etc/runlevel.conf ] ; then # file-rc
2084 list=$(grep -s -l "^# Required-Start:.*dbus" /etc/init.d/* || true)
2085 services=$( for i in $list ; do
2086 grep -E "^[[:digit:]]{2}[[:space:]]+([0-9,S]+|[-])[[:space:]]+.*$r.*[[:space:]]+$i$" /etc/runlevel.conf
2087 done | sort $param | awk '{print $4}' )
2090 log_warning_msg "Unable to determine dependent services: unknown init system"
2093 # Start the services in the correct order
2094 for i in $services ; do
2095 service=$(basename $i)
2096 service=${service#S??}
2097 invoke-rc.d $service $action || true
2105 if [ ! -d $PIDDIR ]; then
2107 chown $DAEMONUSER $PIDDIR
2108 chgrp $DAEMONUSER $PIDDIR
2111 if ! mountpoint -q /proc/ ; then
2112 log_failure_msg "Can't start $DESC - /proc is not mounted"
2116 if [ -e $PIDFILE ]; then
2117 PIDDIR=/proc/$(cat $PIDFILE)
2118 if [ -d ${PIDDIR} -a "$(readlink -f ${PIDDIR}/exe)" = "${DAEMON}" ]; then
2119 log_success_msg "$DESC already started; not starting."
2122 log_success_msg "Removing stale PID file $PIDFILE."
2129 log_daemon_msg "Starting $DESC" "$NAME"
2130 start-stop-daemon --start --quiet --pidfile $PIDFILE \
2131 --user $DAEMONUSER --exec $DAEMON -- --system $PARAMS
2133 if [ -d $EVENTDIR ]; then
2134 run-parts --arg=start $EVENTDIR || true
2136 dependent_services start
2141 dependent_services stop
2142 if [ -d $EVENTDIR ]; then
2143 run-parts --reverse --arg=stop $EVENTDIR || true
2145 log_daemon_msg "Stopping $DESC" "$NAME"
2146 start-stop-daemon --stop --retry 5 --quiet --oknodo --pidfile $PIDFILE \
2148 # We no longer include these arguments so that start-stop-daemon
2149 # can do its job even given that we may have been upgraded.
2150 # We rely on the pidfile being sanely managed
2151 # --exec $DAEMON -- --system $PARAMS
2159 log_action_begin_msg "Reloading $DESC config"
2160 dbus-send --print-reply --system --type=method_call \
2161 --dest=org.freedesktop.DBus \
2162 / org.freedesktop.DBus.ReloadConfig > /dev/null
2163 # hopefully this is enough time for dbus to reload it's config file.
2164 log_action_end_msg $?
2174 reload|force-reload)
2182 echo "Usage: /etc/init.d/$NAME {start|stop|reload|restart|force-reload}" >&2
2189 # $Id: dns-clean,v 1.1.1.1 2004/05/07 03:12:59 john Exp $
2191 # dns-clean by John Hasler 1999-2003
2192 # Any possessor of a copy of this program may treat it as if it
2193 # were in the public domain. I waive all rights.
2195 # This script should be run at bootup to clean up any mess left by 0dns-up.
2196 # It should be run before ppp is started.
2197 # It should never be run while ppp is up.
2200 # Provides: dns-clean
2201 # Required-Start: $local_fs
2202 # Required-Stop: $local_fs
2205 # Short-Description: Cleans up any mess left by 0dns-up
2206 # Description: 0dns-up often leaves behind some cruft. This Script is meant
2207 # to clean up any such mess.
2210 PATH=/sbin:/bin:/usr/sbin:/usr/bin
2212 test -f /usr/sbin/pppconfig || exit 0
2213 # We might have a tmpfs /var/run.
2214 mkdir /var/run/pppconfig >/dev/null 2>&1 || true
2215 test -f /etc/ppp/ip-down.d/0dns-down || exit 0
2217 . /lib/lsb/init-functions
2222 [ "$VERBOSE" != no ] && log_begin_msg "Restoring resolver state..."
2223 /etc/ppp/ip-down.d/0dns-down "0dns-clean"
2224 [ "$VERBOSE" != no ] && log_end_msg $?
2226 stop|restart|force-reload)
2238 # evms Enterprise Volume Management System
2240 # Written by Miquel van Smoorenburg <miquels@cistron.nl>.
2241 # Modified for Debian GNU/Linux
2242 # by Ian Murdock <imurdock@gnu.ai.mit.edu>.
2243 # Modified for evms package
2244 # by Matt Zimmerman <mdz@debian.org>
2249 # Default-Start: 2 3 4 5
2250 # Default-Stop: 0 1 6
2253 # Short-Description: Activates EVMS volumes
2254 # Description: Activates any EVMS volumes that are left unactivated
2255 # by the initramfs for some reason (or if the user does
2256 # not use initramfs). This possibly includes setting up
2257 # RAID, LVM, snapshots, BBR etc., but does not start a
2261 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
2263 DESC="Enterprise Volume Management System"
2265 test -x /sbin/evms_activate || exit 0
2267 . /lib/lsb/init-functions
2273 start|reload|restart|force-reload)
2274 log_begin_msg "Starting $DESC..."
2276 if [ "$VERBOSE" != no ]; then
2277 evms_activate || status=$?
2279 # Messages are still written to the log
2280 evms_activate >/dev/null 2>&1 || status=$?
2287 echo "no daemons started by this script"
2292 log_success_msg "Usage: $N {start|stop|restart|reload|force-reload|status}"
2300 # Originally based on:
2301 # Version: @(#)skeleton 1.8 03-Mar-1998 miquels@cistron.nl
2303 # Modified for gdm, Steve Haslam <steve@arise.dmeon.co.uk> 14mar99
2304 # modified to remove --exec, as it does not work on upgrades. 18jan2000
2305 # modified to use --name, to detect stale PID files 18mar2000
2306 # sleep until gdm dies, then restart it 16jul2000
2307 # get along with other display managers (Branden Robinson, Ryan Murray) 05sep2001
2311 # To start gdm even if it is not the default display manager, change
2312 # HEED_DEFAULT_DISPLAY_MANAGER to "false."
2313 HEED_DEFAULT_DISPLAY_MANAGER=true
2314 DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
2315 PATH=/sbin:/bin:/usr/sbin:/usr/bin
2316 DAEMON=/usr/sbin/gdm
2317 PIDFILE=/var/run/gdm.pid
2318 UPGRADEFILE=/var/run/gdm.upgrade
2320 if [ -e $UPGRADEFILE -a "$1" != "restart" -a "$1" != "force-reload" ]; then
2321 SSD_ARG="--startas $DAEMON"
2324 SSD_ARG="--exec $DAEMON"
2327 # Allow cdd to override the config
2328 if [ -f /etc/gdm/gdm-cdd.conf ]; then
2329 CONFIG_FILE="--config=/etc/gdm/gdm-cdd.conf"
2332 test -x $DAEMON || exit 0
2334 if [ -r /etc/environment ]; then
2335 if LANG=$(pam_getenv -l LANG); then
2338 if LANGUAGE=$(pam_getenv -l LANGUAGE); then
2344 . /lib/lsb/init-functions
2348 if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" -a "$HEED_DEFAULT_DISPLAY_MANAGER" = "true" -a "$(cat $DEFAULT_DISPLAY_MANAGER_FILE 2>/dev/null)" != "$DAEMON" ]; then
2349 log_warning_msg "Not starting GNOME Display Manager (gdm); it is not the default display manager."
2351 # if usplash is runing, make sure to stop it now, yes "start" kills it.
2352 if pidof usplash > /dev/null; then
2353 /etc/init.d/usplash start
2355 log_begin_msg "Starting GNOME Display Manager..."
2356 start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --name gdm $SSD_ARG -- $CONFIG_FILE >/dev/null 2>&1 || log_end_msg 1
2361 log_begin_msg "Stopping GNOME Display Manager..."
2362 start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --name gdm $SSD_ARG --retry 30 >/dev/null 2>&1
2366 log_begin_msg "Reloading GNOME Display Manager configuration..."
2367 log_warning_msg "Changes will take effect when all current X sessions have ended."
2368 start-stop-daemon --stop --signal USR1 --quiet --pidfile \
2369 $PIDFILE --name gdm $SSD_ARG >/dev/null 2>&1
2372 restart|force-reload)
2377 log_success_msg "Usage: /etc/init.d/gdm {start|stop|restart|reload|force-reload}"
2394 # This script detects deprecated kernel versions incompatible with
2395 # the current version of the glibc
2397 # glibc kernel version check: KERNEL_VERSION_CHECK
2398 linux_compare_versions () {
2399 verA=$(($(echo "$1" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 10000 + \2 \* 100 + \3/')))
2400 verB=$(($(echo "$3" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 10000 + \2 \* 100 + \3/')))
2402 test $verA -$2 $verB
2405 kfreebsd_compare_versions () {
2406 verA=$(($(echo "$1" | sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \* 100 + \2/')))
2407 verB=$(($(echo "$3" | sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \* 100 + \2/')))
2409 test $verA -$2 $verB
2414 echo "The installation of a 2.6 kernel _could_ ask you to install a new libc"
2415 echo "first, this is NOT a bug, and should *NOT* be reported. In that case,"
2416 echo "please add etch sources to your /etc/apt/sources.list and run:"
2417 echo " apt-get install -t etch linux-image-2.6"
2418 echo "Then reboot into this new kernel, and proceed with your upgrade"
2427 if [ "$system" = "Linux" ]
2429 # Test to make sure z < 255, in x.y.z-n form of kernel version
2430 # Also make sure we don't trip on x.y.zFOO-n form
2431 #kernel_rev=$(uname -r | tr -- - . | cut -d. -f3 | tr -d '[:alpha:]')
2432 kernel_rev=$(uname -r | sed 's/\([0-9]*\.[0-9]*\.\)\([0-9]*\)\(.*\)/\2/')
2433 if [ "$kernel_rev" -ge 255 ]
2435 echo "WARNING: Your kernel version indicates a revision number"
2436 echo "of 255 or greater. Glibc has a number of built in"
2437 echo "assumptions that this revision number is less than 255."
2438 echo "If you\'ve built your own kernel, please make sure that any"
2439 echo "custom version numbers are appended to the upstream"
2440 echo "kernel number with a dash or some other delimiter."
2445 # sanity checking for the appropriate kernel on each architecture.
2447 kernel_ver=`uname -r`
2449 # convert "armv4l" and similar to just "arm", and "mips64" and similar
2452 arm*) realarch="arm";;
2453 mips*) realarch="mips";;
2457 # From glibc 2.3.5-7 real-i386 is dropped.
2458 if [ "$realarch" = i386 ]
2460 echo "WARNING: This machine has real i386 class processor."
2461 echo "Debian etch and later does not support such old hardware"
2463 echo "The reason is that \"bswap\" instruction is not supported"
2464 echo "on i386 class processors, and some core libraries have"
2465 echo "such instruction. You\'ll see illegal instruction error"
2466 echo "when you upgrade your Debian system."
2470 # arm boxes require __ARM_NR_set_tls in the kernel to function properly.
2471 if [ "$realarch" = arm ]
2473 if linux_compare_versions "$kernel_ver" lt 2.6.12
2475 echo WARNING: This version of glibc requires that you be running
2476 echo kernel version 2.6.12 or later. Earlier kernels contained
2477 echo bugs that may render the system unusable if a modern version
2478 echo of glibc is installed.
2484 # Alpha and HPPA boxes require latest fixes in the kernel to function properly.
2485 if [ "$realarch" = parisc -o "$realarch" = alpha ]
2487 if linux_compare_versions "$kernel_ver" lt 2.6.9
2489 echo WARNING: This version of glibc requires that you be running
2490 echo kernel version 2.6.9 or later. Earlier kernels contained
2491 echo bugs that may render the system unusable if a modern version
2492 echo of glibc is installed.
2498 # sh4 boxes require kernel version 2.6.11 minimum
2499 if [ "$realarch" = sh4 ]
2501 if linux_compare_versions "$kernel_ver" lt 2.6.11
2503 echo WARNING: This version of glibc requires that you be running
2504 echo kernel version 2.6.11 or later. Earlier kernels contained
2505 echo bugs that may render the system unusable if a modern version
2506 echo of glibc is installed.
2512 # The GNU libc requires 2.6 kernel (except on m68k) because we drop to
2513 # support linuxthreads
2514 if [ "$realarch" != m68k ]
2516 if linux_compare_versions "$kernel_ver" lt 2.6.8
2518 echo WARNING: POSIX threads library NPTL requires kernel version
2519 echo 2.6.8 or later. If you use a kernel 2.4, please upgrade it
2520 echo before installing glibc.
2526 # The GNU libc is now built with --with-kernel= >= 2.4.1 on m68k
2527 if [ "$realarch" = m68k ]
2529 if linux_compare_versions "$kernel_ver" lt 2.4.1
2531 echo WARNING: This version of glibc requires that you be running
2532 echo kernel version 2.4.1 or later. Earlier kernels contained
2533 echo bugs that may render the system unusable if a modern version
2534 echo of glibc is installed.
2540 # From glibc 2.6-3 SPARC V8 support is dropped.
2541 if [ "$realarch" = sparc ]
2543 # The process could be run using linux32, check for /proc.
2544 if [ -f /proc/cpuinfo ]
2546 case "$(sed '/^type/!d;s/^type.*: //g' /proc/cpuinfo)" in
2554 echo "WARNING: This machine has a SPARC V8 or earlier class processor."
2555 echo "Debian lenny and later does not support such old hardware"
2562 elif [ $system = "GNU/kFreeBSD" ] ; then
2563 kernel_ver=`uname -r`
2564 if kfreebsd_compare_versions "$kernel_ver" lt 6.0
2566 echo WARNING: This version of glibc uses UMTX_OP_WAIT and UMTX_OP_WAKE
2567 echo syscalls that are not present in the current running kernel. They
2568 echo have been added in kFreeBSD 6.0. Your system should still work,
2569 echo but it is recommended to upgrade to a more recent version.
2577 # Required-Start: umountroot
2579 # Should-Start: lvm raid2
2583 # Short-Description: Execute the halt command.
2587 PATH=/usr/sbin:/usr/bin:/sbin:/bin
2588 [ -f /etc/default/halt ] && . /etc/default/halt
2590 . /lib/lsb/init-functions
2593 if [ "$INIT_HALT" = "" ]
2608 # See if we need to cut the power.
2609 if [ "$INIT_HALT" = "POWEROFF" ] && [ -x /etc/init.d/ups-monitor ]
2611 /etc/init.d/ups-monitor poweroff
2614 # Don't shut down drives if we're using RAID.
2616 if grep -qs '^md.*active' /proc/mdstat
2621 # If INIT_HALT=HALT don't poweroff.
2623 if [ "$INIT_HALT" = "HALT" ]
2628 log_action_msg "Will now halt"
2630 halt -d -f -i $poweroff $hddown
2637 restart|reload|force-reload)
2638 echo "Error: argument '$1' not supported" >&2
2645 echo "Usage: $0 start|stop" >&2
2653 # Provides: hostname
2658 # Short-Description: Set hostname.
2665 . /lib/lsb/init-functions
2668 [ -f /etc/hostname ] && HOSTNAME="$(cat /etc/hostname)"
2670 # Keep current name if /etc/hostname is missing.
2671 [ -z "$HOSTNAME" ] && HOSTNAME="$(hostname)"
2673 # And set it to 'localhost' if no setting was found
2674 [ -z "$HOSTNAME" ] && HOSTNAME=localhost
2676 [ "$VERBOSE" != no ] && log_action_begin_msg "Setting hostname to '$HOSTNAME'"
2677 hostname "$HOSTNAME"
2679 [ "$VERBOSE" != no ] && log_action_end_msg $ES
2686 restart|reload|force-reload)
2687 echo "Error: argument '$1' not supported" >&2
2694 echo "Usage: hostname.sh [start|stop]" >&2
2699 # hwclock.sh Set and adjust the CMOS clock, according to the UTC
2700 # setting in /etc/default/rcS (see also rcS(5)).
2702 # Version: @(#)hwclock.sh 2.00 14-Dec-1998 miquels@cistron.nl
2705 # 2000-01-30 Henrique M. Holschuh <hmh@rcm.org.br>
2706 # - Minor cosmetic changes in an attempt to help new
2707 # users notice something IS changing their clocks
2708 # during startup/shutdown.
2709 # - Added comments to alert users of hwclock issues
2710 # and discourage tampering without proper doc reading.
2712 # WARNING: Please read /usr/share/doc/util-linux/README.Debian.hwclock
2713 # before changing this file. You risk serious clock
2714 # misbehaviour otherwise.
2717 # Provides: hwclockfirst
2718 # Required-Start: mountdevsubfs
2719 # Required-Stop: umountroot
2724 FIRST=yes # debian/rules sets this to 'yes' when creating hwclockfirst.sh
2726 # Set this to any options you might need to give to hwclock, such
2727 # as machine hardware clock type for Alphas.
2732 [ ! -x /sbin/hwclock ] && return 0
2735 . /lib/lsb/init-functions
2736 verbose_log_action_msg() { [ "$VERBOSE" = no ] || log_action_msg "$@"; }
2738 [ "$GMT" = "-u" ] && UTC="yes"
2740 no|"") GMT="--localtime"
2742 if [ "X$FIRST" = "Xyes" ] && [ ! -r /etc/localtime ]; then
2743 if [ -z "$TZ" ]; then
2744 log_action_msg "System clock was not updated at this time"
2752 *) log_action_msg "Unknown UTC setting: \"$UTC\""; return 1 ;;
2756 no|"") BADYEAR="" ;;
2757 yes) BADYEAR="--badyear" ;;
2758 *) log_action_msg "unknown BADYEAR setting: \"$BADYEAR\""; return 1 ;;
2763 if [ -w /etc ] && [ ! -f /etc/adjtime ] && [ ! -e /etc/adjtime ]; then
2764 echo "0.0 0 0.0" > /etc/adjtime
2767 if [ ! -w /etc/adjtime ]; then
2773 if [ "$FIRST" != yes ]; then
2774 # Uncomment the hwclock --adjust line below if you want
2775 # hwclock to try to correct systematic drift errors in the
2778 # WARNING: If you uncomment this option, you must either make
2779 # sure *nothing* changes the Hardware Clock other than
2780 # hwclock --systohc, or you must delete /etc/adjtime
2781 # every time someone else modifies the Hardware Clock.
2783 # Common "vilains" are: ntp, MS Windows, the BIOS Setup
2786 # WARNING: You must remember to invalidate (delete)
2787 # /etc/adjtime if you ever need to set the system clock
2788 # to a very different value and hwclock --adjust is being
2791 # Please read /usr/share/doc/util-linux/README.Debian.hwclock
2792 # before enabling hwclock --adjust.
2794 #/sbin/hwclock --adjust $GMT $BADYEAR
2798 if [ "$HWCLOCKACCESS" != no ]; then
2799 log_action_msg "Setting the system clock"
2801 # Copies Hardware Clock time to System Clock using the correct
2802 # timezone for hardware clocks in local time, and sets kernel
2803 # timezone. DO NOT REMOVE.
2804 if /sbin/hwclock --hctosys $GMT $HWCLOCKPARS $BADYEAR $NOADJ; then
2805 # Announce the local time.
2806 verbose_log_action_msg "System Clock set to: `date $UTC`"
2808 log_warning_msg "Unable to set System Clock to: `date $UTC`"
2811 verbose_log_action_msg "Not setting System Clock"
2814 stop|restart|reload|force-reload)
2816 # Updates the Hardware Clock with the System Clock time.
2817 # This will *override* any changes made to the Hardware Clock.
2819 # WARNING: If you disable this, any changes to the system
2820 # clock will not be carried across reboots.
2822 if [ "$HWCLOCKACCESS" != no ]; then
2823 log_action_msg "Saving the system clock"
2824 if [ "$GMT" = "-u" ]; then
2827 if /sbin/hwclock --systohc $GMT $HWCLOCKPARS $BADYEAR; then
2828 verbose_log_action_msg "Hardware Clock updated to `date`"
2831 verbose_log_action_msg "Not saving System Clock"
2835 if [ "$HWCLOCKACCESS" != no ]; then
2836 /sbin/hwclock --show $GMT $HWCLOCKPARS $BADYEAR
2840 log_success_msg "Usage: hwclock.sh {start|stop|reload|force-reload|show}"
2841 log_success_msg " start sets kernel (system) clock from hardware (RTC) clock"
2842 log_success_msg " stop and reload set hardware (RTC) clock from kernel (system) clock"
2850 # hwclock.sh Set and adjust the CMOS clock, according to the UTC
2851 # setting in /etc/default/rcS (see also rcS(5)).
2853 # Version: @(#)hwclock.sh 2.00 14-Dec-1998 miquels@cistron.nl
2856 # 2000-01-30 Henrique M. Holschuh <hmh@rcm.org.br>
2857 # - Minor cosmetic changes in an attempt to help new
2858 # users notice something IS changing their clocks
2859 # during startup/shutdown.
2860 # - Added comments to alert users of hwclock issues
2861 # and discourage tampering without proper doc reading.
2863 # WARNING: Please read /usr/share/doc/util-linux/README.Debian.hwclock
2864 # before changing this file. You risk serious clock
2865 # misbehaviour otherwise.
2869 # Required-Start: mountdevsubfs
2870 # Required-Stop: $local_fs
2875 FIRST=no # debian/rules sets this to 'yes' when creating hwclockfirst.sh
2877 # Set this to any options you might need to give to hwclock, such
2878 # as machine hardware clock type for Alphas.
2883 [ ! -x /sbin/hwclock ] && return 0
2886 . /lib/lsb/init-functions
2887 verbose_log_action_msg() { [ "$VERBOSE" = no ] || log_action_msg "$@"; }
2889 [ "$GMT" = "-u" ] && UTC="yes"
2891 no|"") GMT="--localtime"
2893 if [ "X$FIRST" = "Xyes" ] && [ ! -r /etc/localtime ]; then
2894 if [ -z "$TZ" ]; then
2895 log_action_msg "System clock was not updated at this time"
2903 *) log_action_msg "Unknown UTC setting: \"$UTC\""; return 1 ;;
2907 no|"") BADYEAR="" ;;
2908 yes) BADYEAR="--badyear" ;;
2909 *) log_action_msg "unknown BADYEAR setting: \"$BADYEAR\""; return 1 ;;
2914 if [ -w /etc ] && [ ! -f /etc/adjtime ] && [ ! -e /etc/adjtime ]; then
2915 echo "0.0 0 0.0" > /etc/adjtime
2918 if [ ! -w /etc/adjtime ]; then
2924 if [ "$FIRST" != yes ]; then
2925 # Uncomment the hwclock --adjust line below if you want
2926 # hwclock to try to correct systematic drift errors in the
2929 # WARNING: If you uncomment this option, you must either make
2930 # sure *nothing* changes the Hardware Clock other than
2931 # hwclock --systohc, or you must delete /etc/adjtime
2932 # every time someone else modifies the Hardware Clock.
2934 # Common "vilains" are: ntp, MS Windows, the BIOS Setup
2937 # WARNING: You must remember to invalidate (delete)
2938 # /etc/adjtime if you ever need to set the system clock
2939 # to a very different value and hwclock --adjust is being
2942 # Please read /usr/share/doc/util-linux/README.Debian.hwclock
2943 # before enabling hwclock --adjust.
2945 #/sbin/hwclock --adjust $GMT $BADYEAR
2949 if [ "$HWCLOCKACCESS" != no ]; then
2950 log_action_msg "Setting the system clock"
2952 # Copies Hardware Clock time to System Clock using the correct
2953 # timezone for hardware clocks in local time, and sets kernel
2954 # timezone. DO NOT REMOVE.
2955 if /sbin/hwclock --hctosys $GMT $HWCLOCKPARS $BADYEAR $NOADJ; then
2956 # Announce the local time.
2957 verbose_log_action_msg "System Clock set to: `date $UTC`"
2959 log_warning_msg "Unable to set System Clock to: `date $UTC`"
2962 verbose_log_action_msg "Not setting System Clock"
2965 stop|restart|reload|force-reload)
2967 # Updates the Hardware Clock with the System Clock time.
2968 # This will *override* any changes made to the Hardware Clock.
2970 # WARNING: If you disable this, any changes to the system
2971 # clock will not be carried across reboots.
2973 if [ "$HWCLOCKACCESS" != no ]; then
2974 log_action_msg "Saving the system clock"
2975 if [ "$GMT" = "-u" ]; then
2978 if /sbin/hwclock --systohc $GMT $HWCLOCKPARS $BADYEAR; then
2979 verbose_log_action_msg "Hardware Clock updated to `date`"
2982 verbose_log_action_msg "Not saving System Clock"
2986 if [ "$HWCLOCKACCESS" != no ]; then
2987 /sbin/hwclock --show $GMT $HWCLOCKPARS $BADYEAR
2991 log_success_msg "Usage: hwclock.sh {start|stop|reload|force-reload|show}"
2992 log_success_msg " start sets kernel (system) clock from hardware (RTC) clock"
2993 log_success_msg " stop and reload set hardware (RTC) clock from kernel (system) clock"
3003 # Required-Start: mountdevsubfs
3007 # Short-Description: Set keymap
3008 # Description: Set the Console keymap
3011 # If setupcon is present, then we've been superseded by console-setup.
3012 if type setupcon >/dev/null 2>&1; then
3016 . /lib/lsb/init-functions
3019 # Load the keymaps *as soon as possible*
3022 # Don't fail on error
3023 CONSOLE_TYPE=`fgconsole 2>/dev/null` || CONSOLE_TYPE="unknown"
3025 # Don't fail on serial consoles
3028 # fail silently if loadkeys not present (yet).
3029 command -v loadkeys >/dev/null 2>&1 || QUIT=1
3031 CONFDIR=/etc/console
3032 CONFFILEROOT=boottime
3034 CONFFILE=${CONFDIR}/${CONFFILEROOT}.${EXT}.gz
3038 # On Mac PPC machines, we may need to set kernel vars first
3039 # We need to mount /proc to do that; not optimal, as its going to
3040 # be mounted in S10checkroot, but we need it set up before sulogin
3041 # may be run in checkroot, which will need the keyboard to log in...
3042 [ -x /sbin/sysctl ] || return
3043 [ -r /etc/sysctl.conf ] || return
3044 grep -v '^\#' /etc/sysctl.conf | grep -q keycodes
3045 if [ "$?" = "0" ] ; then
3046 grep keycodes /etc/sysctl.conf | grep -v "^#" | while read d ; do
3047 /sbin/sysctl -w $d 2> /dev/null || true
3052 unicode_start_stop()
3054 # Switch unicode mode by checking the locale.
3055 # This will be needed before loading the keymap.
3056 [ -x /usr/bin/unicode_start ] || [ -x /bin/unicode_start ] || return
3057 [ -x /usr/bin/unicode_stop ] || [ -x /bin/unicode_stop ] || return
3060 [ -r /etc/environment ] && ENV_FILE="/etc/environment"
3061 [ -r /etc/default/locale ] && ENV_FILE="/etc/default/locale"
3062 [ $ENV_FILE = none ] && return
3064 for var in LANG LC_ALL LC_CTYPE; do
3065 value=$(egrep "^[^#]*${var}=" $ENV_FILE | tail -n1 | cut -d= -f2)
3069 CHARMAP=`LANG=$LANG LC_ALL=$LC_ALL LC_CTYPE=$LC_CTYPE locale charmap`
3070 if [ "$CHARMAP" = "UTF-8" ]; then
3071 unicode_start 2> /dev/null || true
3073 unicode_stop 2> /dev/null || true
3077 if [ ! $QUIT = '1' ] ; then
3080 start | restart | force-reload | reload)
3082 # Set kernel variables if required
3085 # First mount /proc if necessary...and if it is there (#392798)
3087 if [ -d /proc ]; then
3088 if [ ! -x /proc/$$ ]; then
3094 if [ -f /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes ] ; then
3095 linux_keycodes=`cat /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes`
3104 if [ $linux_keycodes -gt 0 ] ; then
3105 if [ -r ${CONFFILE} ] ; then
3107 # Switch console mode to UTF-8 or ASCII as necessary
3110 if [ $CONSOLE_TYPE = "serial" ] ; then
3111 loadkeys -q ${CONFFILE} 2>&1 > /dev/null
3113 loadkeys -q ${CONFFILE}
3117 # if we've a serial console, we may not have a keyboard, so don't
3118 # complain if we fail.
3119 if [ ! $CONSOLE_TYPE = "serial" ]; then
3120 log_warning_msg "Problem when loading ${CONFDIR}/${CONFFILEROOT}.${EXT}.gz, use install-keymap"
3127 # unmount /proc if we mounted it
3128 [ "$unmount_proc" = "no" ] || umount -n /proc
3136 log_warning_msg "Usage: $0 {start|stop|restart|reload|force-reload}"
3143 # Provides: killprocs
3144 # Required-Start: $local_fs
3148 # Short-Description: executed by init(8) upon entering runlevel 1 (single).
3151 PATH=/usr/sbin:/usr/bin:/sbin:/bin
3153 . /lib/lsb/init-functions
3156 # Kill all processes.
3157 log_action_begin_msg "Sending all processes the TERM signal"
3159 log_action_end_msg 0
3161 log_action_begin_msg "Sending all processes the KILL signal"
3163 log_action_end_msg 0
3165 # We start update here, since we just killed it.
3166 if [ -x /sbin/update ] && [ "$(uname -s)" = Linux ]
3168 case "$(uname -r)" in
3180 restart|reload|force-reload)
3181 echo "Error: argument '$1' not supported" >&2
3188 echo "Usage: $0 start|stop" >&2
3193 # /etc/init.d/klogd: start the kernel log daemon.
3197 # Required-Start: syslog
3198 # Required-Stop: syslog
3199 # Default-Start: S 1 2 3 4 5
3201 # Short-Description: Kernel logger
3204 PATH=/bin:/usr/bin:/sbin:/usr/sbin
3206 pidfile=/var/run/klogd/klogd.pid
3207 kmsgpipe=/var/run/klogd/kmsg
3208 kmsgpidfile=/var/run/klogd/kmsgpipe.pid
3211 test -f $binpath || exit 0
3212 . /lib/lsb/init-functions
3214 # Use KLOGD="-k /boot/System.map-$(uname -r)" to specify System.map
3216 KLOGD="-P $kmsgpipe"
3218 test ! -r /etc/default/klogd || . /etc/default/klogd
3220 . /lib/lsb/init-functions
3224 log_begin_msg "Starting kernel log daemon..."
3225 # create klog-writeable pid and fifo directory
3226 mkdir -p /var/run/klogd
3227 chown klog:klog /var/run/klogd
3228 mkfifo -m 700 $kmsgpipe
3229 chown klog:klog $kmsgpipe
3231 # shovel /proc/kmsg to pipe readable by klogd user
3232 start-stop-daemon --start --pidfile $kmsgpidfile --exec /bin/dd -b -m -- bs=1 if=/proc/kmsg of=$kmsgpipe
3234 # start klogd as non-root with reading from kmsgpipe
3235 start-stop-daemon --start --quiet --chuid klog --exec $binpath -- $KLOGD
3239 log_begin_msg "Stopping kernel log daemon..."
3240 start-stop-daemon --stop --quiet --retry 3 --oknodo --exec $binpath --pidfile $pidfile
3242 start-stop-daemon --stop --quiet --oknodo --pidfile $kmsgpidfile
3243 rm -f $kmsgpidfile $kmsgpipe
3246 restart|force-reload)
3252 log_success_msg "Usage: /etc/init.d/klogd {start|stop|restart|force-reload}"
3259 # chkconfig: - 20 90
3260 # description: Starts and stops "laptop-mode" - tweaks system behavior
3261 # to extend battery life.
3263 # config: /etc/laptop-mode/laptop-mode.conf
3266 # Provides: laptop-mode
3267 # Should-Start: $all
3268 # Required-Start: $local_fs
3269 # Required-Stop: $local_fs
3270 # Default-Start: 2 3 4 5
3271 # Default-Stop: 0 1 6
3272 # Short-Description: Enable laptop-mode-tools power management functions
3273 # Description: Enable laptop-mode-tools power management functions
3277 test -f /usr/sbin/laptop_mode || exit 0
3279 . /lib/lsb/init-functions
3282 if [ -f /etc/default/laptop-mode ]; then
3283 . /etc/default/laptop-mode;
3285 if [ -f /etc/default/acpi-support ]; then
3286 . /etc/default/acpi-support;
3289 if [ x$ENABLE_LAPTOP_MODE = xfalse ]; then
3293 # Enable laptop mode when the system is booted when running on battery.
3297 log_action_begin_msg "Enabling laptop mode"
3298 mkdir -p /var/run/laptop-mode-tools
3299 touch /var/run/laptop-mode-tools/enabled
3300 /usr/sbin/laptop_mode init auto > $TEMPFILE
3301 log_action_end_msg $? "$( cat $TEMPFILE )"
3304 restart|reload|force-reload)
3305 # Full restart: first stop laptop mode completely (to restore default mount options etc.)
3306 log_action_begin_msg "Disabling laptop mode"
3307 mkdir -p /var/run/laptop-mode-tools
3308 rm -f /var/run/laptop-mode-tools/enabled
3309 /usr/sbin/laptop_mode init stop > $TEMPFILE
3310 log_action_end_msg $? "$( cat $TEMPFILE )"
3312 # Now remove files containing stored status, re-enable, and start it up again.
3313 log_action_begin_msg "Enabling laptop mode"
3314 rm -f /var/run/laptop-mode-tools/*
\r
3315 touch /var/run/laptop-mode-tools/enabled
3316 /usr/sbin/laptop_mode init auto force > $TEMPFILE
3317 log_action_end_msg $? "$( cat $TEMPFILE )"
3321 log_action_begin_msg "Disabling laptop mode"
3322 rm -f /var/run/laptop-mode-tools/enabled
3323 /usr/sbin/laptop_mode init stop > $TEMPFILE
3324 log_action_end_msg $? "$( cat $TEMPFILE )"
3328 echo "Laptop mode status:"
3330 /usr/sbin/laptop_mode status
3334 echo "Usage: $0 {stop|start|restart|reload|force-reload|status}" >&2
3339 if [ -f $TEMPFILE ] ; then
3346 # Provides: libpam-foreground-clean
3347 # Required-Start: $local_fs $remote_fs
3351 # Short-Description: Clean old status files during boot.
3356 . /lib/lsb/init-functions
3359 STATEDIR=/var/run/console
3363 if [ -d $STATEDIR ]; then
3364 log_begin_msg "Cleaning up $STATEDIR/..."
3371 stop|restart|force-reload)
3376 echo "Usage: $0 {start|stop|restart|force-reload}" >&2
3382 # loopback - brings up the loopback (127.0.0.1) network device so that
3383 # DHCP and other such things will work
3386 # Check the package is still installed
3387 [ -x /sbin/ifup ] || exit 0
3390 . /lib/lsb/init-functions
3395 [ -d /var/run/network ] || mkdir /var/run/network
3397 log_begin_msg "Starting basic networking..."
3398 if ifup --allow auto lo; then
3405 log_begin_msg "Stopping basic networking..."
3412 restart|force-reload)
3416 echo "Usage: /etc/init.d/loopback {start|stop|restart|force-reload}"
3424 N=/etc/init.d/makedev
3425 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
3431 test -L /dev/MAKEDEV || ln -fs /sbin/MAKEDEV /dev/MAKEDEV
3433 # create dvb-devices, if the dvb-directory allready exists, and
3434 # no devfs or udev is in use (workaround for the changed major-number
3435 # of the dvb-devices, introduced in kernel 2.6.8, to be able to
3436 # switch between kernels <= 2.6.7 and >= 2.6.8, without manual
3437 # recreation of the devices (MAKEDEV dvb checks the kernel-version
3438 # and uses the correct major-number))
3440 if [ ! -e /dev/.devfsd -a ! -e /dev/.udevdb ]; then
3441 if [ -d /dev/dvb ]; then
3442 cd /dev && ./MAKEDEV dvb
3447 stop|reload|restart|force-reload)
3450 echo "Usage: $N {start|stop|restart|force-reload}" >&2
3458 # Start the RAID monitor daemon for all active md arrays if desired.
3460 # Copyright (c) 2001-2004 Mario Jou/3en <joussen@debian.org>
3461 # Distributable under the terms of the GNU GPL version 2.
3464 DEBIANCONFIG=/etc/default/mdadm
3465 PIDFILE=/var/run/mdadm.pid
3467 test -x $MDADM || exit 0
3469 . /lib/lsb/init-functions
3473 test -f $DEBIANCONFIG && . $DEBIANCONFIG
3477 if [ "x$START_DAEMON" = "xtrue" ] ; then
3478 log_begin_msg "Starting RAID monitoring services..."
3479 start-stop-daemon -S -q -p $PIDFILE -x $MDADM -- -F -i $PIDFILE -m $MAIL_TO -f -s
3484 if [ -f $PIDFILE ] ; then
3485 log_begin_msg "Stopping RAID monitoring services..."
3486 start-stop-daemon -K -q -p $PIDFILE -x $MDADM
3491 restart|reload|force-reload)
3496 log_success_msg "Usage: $0 {start|stop|restart|reload|force-reload}"
3504 # Start any arrays which are described in /etc/mdadm/mdadm.conf and which are
3505 # not running already.
3507 # Copyright (c) 2001-2004 Mario Jou/3en <joussen@debian.org>
3508 # Distributable under the terms of the GNU GPL version 2.
3512 CONFIG=/etc/mdadm/mdadm.conf
3513 DEBIANCONFIG=/etc/default/mdadm
3515 . /lib/lsb/init-functions
3517 test -x $MDADM || exit 0
3520 test -f $DEBIANCONFIG && . $DEBIANCONFIG
3524 if [ "x$AUTOSTART" = "xtrue" ] ; then
3525 if [ ! -f /proc/mdstat ] && [ -x /sbin/modprobe ] ; then
3526 /sbin/modprobe -k md > /dev/null 2>&1
3528 test -f /proc/mdstat || exit 0
3529 log_begin_msg "Starting RAID devices..."
3530 if [ -f $CONFIG ] && [ -x $MDADM ] ; then
3532 elif [ -x $MDRUN ] ; then
3538 stop|restart|reload|force-reload)
3541 log_success_msg "Usage: $0 {start|stop|restart|reload|force-reload}"
3549 # Provides: module-init-tools
3552 # Should-Start: checkroot
3556 # Short-Description: Process /etc/modules.
3557 # Description: Load the modules listed in /etc/modules.
3560 # Silently exit if the kernel does not support modules or needs modutils.
3561 [ -f /proc/modules ] || exit 0
3562 [ ! -f /proc/ksyms ] || exit 0
3563 [ -x /sbin/modprobe ] || exit 0
3566 . /lib/lsb/init-functions
3571 KMAJ=${KVER%${KVER#*.*[^.]}}
3574 if [ -e /etc/modules-$KVER ]; then
3575 MODULES_FILE=/etc/modules-$KVER
3576 elif [ -e /etc/modules-$KMAJ ]; then
3577 MODULES_FILE=/etc/modules-$KMAJ
3579 MODULES_FILE=/etc/modules
3587 if [ "$VERBOSE" != no ]; then
3588 log_action_msg "Loading kernel module $module"
3589 modprobe $module $args || true
3591 modprobe $module $args > /dev/null 2>&1 || true
3595 if [ "$VERBOSE" = no ]; then
3596 log_action_begin_msg 'Loading kernel modules'
3599 # Loop over every line in /etc/modules.
3600 log_begin_msg 'Loading manual drivers...'
3601 grep '^[^#]' $MODULES_FILE | \
3602 while read module args; do
3603 [ "$module" ] || continue
3604 load_module "$module" "$args"
3607 if [ "$VERBOSE" = no ]; then
3608 log_action_end_msg 0
3614 # Provides: mountall-bootclean
3615 # Required-Start: mountall
3619 # Short-Description: bootclean after mountall.
3620 # Description: Clean temporary filesystems after
3621 # all local filesystems have been mounted.
3627 /etc/init.d/bootclean
3629 restart|reload|force-reload)
3630 echo "Error: argument '$1' not supported" >&2
3637 echo "Usage: mountall-bootclean.sh [start|stop]" >&2
3645 # Provides: mountall
3646 # Required-Start: checkfs
3652 # Short-Description: Mount all filesystems.
3659 . /lib/lsb/init-functions
3660 . /lib/init/mount-functions.sh
3662 if [ -r /etc/default/locale ]; then
3663 . /etc/default/locale
3669 # Mount local file systems in /etc/fstab.
3672 if [ "$VERBOSE" = no ]
3674 log_action_begin_msg "Mounting local filesystems"
3675 mount -a -t proc >/dev/null 2>&1 # Ignore error message due to /proc already being mounted
3677 mount -a -t noproc,nfs,nfs4,smbfs,cifs,ncp,ncpfs,coda,ocfs2,gfs
3679 ES_TO_REPORT=$(($ES_TO_REPORT | $ES))
3680 if [ 0 = "$ES_TO_REPORT" ]
3682 log_action_end_msg 0
3684 log_action_end_msg 1 "code $ES_TO_REPORT"
3687 log_action_msg "Will now mount local filesystems"
3688 mount -a -t proc >/dev/null 2>&1 # Ignore error message due to /proc already being mounted
3690 [ 0 = "$ES" ] || log_failure_msg "Mounting proc filesystems failed with error code ${ES}."
3691 mount -a -v -t noproc,nfs,nfs4,smbfs,cifs,ncp,ncpfs,coda,ocfs2,gfs
3695 log_success_msg "Done mounting local filesystems."
3697 log_failure_msg "Mounting local filesystems failed with error code ${ES}."
3703 case "$(uname -s)" in
3705 INITCTL=/etc/.initctl
3708 INITCTL=/dev/initctl
3713 # We might have mounted something over /dev, see if
3714 # /dev/initctl is there.
3716 if [ ! -p $INITCTL ]
3719 mknod -m 600 $INITCTL p
3724 # Execute swapon command again, in case we want to swap to
3725 # a file on a now mounted filesystem.
3727 # Ignore 255 status due to swap already being enabled
3729 if [ "$VERBOSE" = no ]
3731 log_action_begin_msg "Activating swapfile swap"
3732 swapon -a -e 2>/dev/null || : # Stifle "Device or resource busy"
3733 log_action_end_msg 0
3735 log_action_msg "Will now activate swapfile swap"
3736 swapon -a -e -v || :
3737 log_success_msg "Done activating swapfile swap."
3745 restart|reload|force-reload)
3746 echo "Error: argument '$1' not supported" >&2
3753 echo "Usage: mountall.sh [start|stop]" >&2
3761 # Provides: mountdevsubfs mountvirtfs
3762 # Required-Start: mountkernfs
3766 # Short-Description: Mount special file systems under /dev.
3767 # Description: Mount the virtual filesystems the kernel provides
3768 # that ordinarily live under the /dev filesystem.
3771 PATH=/lib/init:/sbin:/bin
3774 [ -f /etc/default/devpts ] && . /etc/default/devpts
3777 [ -f /etc/default/tmpfs ] && . /etc/default/tmpfs
3779 KERNEL="$(uname -s)"
3781 . /lib/lsb/init-functions
3782 . /lib/init/mount-functions.sh
3786 # Mount a tmpfs on /dev/shm
3789 [ "${SHM_SIZE:=$TMPFS_SIZE}" ] && SHM_OPT="-osize=$SHM_SIZE"
3790 domount tmpfs shmfs /dev/shm $SHM_OPT
3793 # Mount /dev/pts. Create master ptmx node if needed.
3795 domount devpts "" /dev/pts -ogid=$TTYGRP,mode=$TTYMODE
3798 # Magic to make /proc/bus/usb work
3800 #mkdir -p /dev/bus/usb/.usbfs
3801 #domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
3802 #ln -s .usbfs/devices /dev/bus/usb/devices
3803 #mount --rbind /dev/bus/usb /proc/bus/usb
3808 echo "Warning: mountdevsubfs should be called with the 'start' argument." >&2
3814 restart|reload|force-reload)
3815 echo "Error: argument '$1' not supported" >&2
3822 echo "Usage: mountdevsubfs [start|stop]" >&2
3828 # Provides: mountkernfs
3833 # Short-Description: Mount kernel virtual file systems.
3834 # Description: Mount initial set of virtual filesystems the kernel
3835 # provides and that are required by everything.
3838 PATH=/lib/init:/sbin:/bin
3840 . /lib/lsb/init-functions
3841 . /lib/init/mount-functions.sh
3845 # Mount proc filesystem on /proc
3847 domount proc "" /proc -onodev,noexec,nosuid
3850 # Mount sysfs on /sys
3852 domount sysfs "" /sys -onodev,noexec,nosuid
3854 # Mount /var/run and /var/lock as tmpfs.
3855 domount tmpfs "" /var/run -omode=0755,nodev,noexec,nosuid
3856 domount tmpfs "" /var/lock -omode=1777,nodev,noexec,nosuid
3858 # Mount spufs, if Cell Broadband processor is detected
3859 if mountpoint -q /proc && grep -qs '^cpu.*Cell' /proc/cpuinfo; then
3861 domount spufs "" /spu -ogid=spu
3864 # Propagate files from the initramfs to our new /var/run.
3865 for file in /dev/.initramfs/varrun/*; do
3866 [ -e "$file" ] || continue
3867 cp -a "$file" "/var/run/${x#/dev/.initramfs/varrun/}"
3870 if [ ! -d /var/run/sendsigs.omit.d/ ]; then
3871 mkdir /var/run/sendsigs.omit.d/
3877 echo "Warning: mountvirtfs should be called with the 'start' argument." >&2
3883 restart|reload|force-reload)
3884 echo "Error: argument '$1' not supported" >&2
3891 echo "Usage: mountvirtfs [start|stop]" >&2
3897 # Provides: mountnfs-bootclean
3898 # Required-Start: mountnfs
3902 # Short-Description: bootclean after mountnfs.
3903 # Description: Clean temporary filesystems after
3904 # network filesystems have been mounted.
3910 /etc/init.d/bootclean
3912 restart|reload|force-reload)
3913 echo "Error: argument '$1' not supported" >&2
3920 echo "Usage: mountnfs-bootclean.sh [start|stop]" >&2
3928 # Provides: mountoverflowtmp
3929 # Required-Start: mountall-bootclean
3933 # Short-Description: mount emergency /tmp.
3934 # Description: Mount a tmpfs on /tmp if there would
3935 # otherwise be too little space to log in.
3938 . /lib/lsb/init-functions
3942 defs=/etc/default/mountoverflowtmp
3943 test ! -f "$defs" || . "$defs"
3946 if test "$MINTMPKB" = "0"; then exit 0; fi
3950 log_action_begin_msg "Checking minimum space in /tmp"
3952 avail="`printf "%s" "$df" | awk 'NR==2 { print $4 }'`"
3953 log_action_end_msg 0
3954 if test $avail -lt "$MINTMPKB"; then
3955 log_action_begin_msg "Mounting emergency tmpfs on /tmp"
3956 mount -t tmpfs -o size=1048576,mode=1777 overflow /tmp
3957 log_action_end_msg 0
3960 restart|reload|force-reload)
3961 echo "Error: argument '$1' not supported" >&2
3965 log_action_begin_msg "Unmounting any overflow tmpfs from /tmp"
3966 if LANG=C LC_ALL=C mount | \
3967 grep '^overflow on /tmp type tmpfs' >/dev/null; then
3970 log_action_end_msg 0
3973 echo "Usage: mountoverflowtmp [start|stop]" >&2
3982 # Required-Start: mountall
3986 # Short-Description: Update mtab file.
3987 # Description: Update the mount program's mtab file after
3988 # all local filesystems have been mounted.
3991 PATH=/lib/init:/sbin:/bin
3994 [ -f /etc/default/devpts ] && . /etc/default/devpts
3997 [ -f /etc/default/tmpfs ] && . /etc/default/tmpfs
3999 KERNEL="$(uname -s)"
4001 . /lib/lsb/init-functions
4002 . /lib/init/mount-functions.sh
4006 # Directory present?
4013 if ! mountpoint -q $2
4026 if ! grep -E -sq "^([^ ]+) +$2 +" /etc/mtab
4028 mount -f -t $1 $OPTS $4 $NAME $2
4034 MTAB_PATH="$(readlink -f /etc/mtab || :)"
4035 case "$MTAB_PATH" in
4037 # Assume that /proc/ is not writable
4040 # Only update mtab if it is known to be writable
4041 # Note that the touch program is in /usr/bin
4042 #if ! touch "$MTAB_PATH" >/dev/null 2>&1
4048 [ -L /etc/mtab ] && MTAB_PATH="$(readlink /etc/mtab)"
4051 log_failure_msg "Cannot initialize ${MTAB_PATH}."
4053 log_failure_msg "Cannot initialize /etc/mtab."
4057 log_failure_msg "Illegal mtab location '${MTAB_PATH}'."
4062 # Initialize mtab file if necessary
4064 if [ ! -f /etc/mtab ]
4069 if selinux_enabled && which restorecon >/dev/null 2>&1 && [ -r /etc/mtab ]
4071 restorecon /etc/mtab
4075 domtab proc /proc "proc" -onodev,noexec,nosuid
4076 domtab sysfs /sys "sys" -onodev,noexec,nosuid
4077 domtab tmpfs /var/run "varrun" -omode=0755,nodev,noexec,nosuid
4078 domtab tmpfs /var/lock "varlock" -omode=1777,nodev,noexec,nosuid
4079 domtab usbfs /proc/bus/usb "procbususb"
4082 domtab tmpfs /dev "udev" -omode=0755
4086 [ "${SHM_SIZE:=$TMPFS_SIZE}" ] && SHM_OPT="-osize=$SHM_SIZE"
4087 domtab tmpfs /dev/shm "devshm" $SHM_OPT
4088 domtab devpts /dev/pts "devpts" -ogid=$TTYGRP,mode=$TTYMODE
4090 # S07linux-restricted-modules-common
4091 exec 9<&0 0</proc/mounts
4092 while read FDEV FDIR FTYPE FOPTS REST
4095 /lib/modules/*/volatile)
4096 domtab "$FTYPE" "$FDIR" "lrm"
4102 # /etc/network/if-up.d/mountnfs
4103 exec 9<&0 </etc/fstab
4104 while read FDEV FDIR FTYPE FOPTS REST
4112 noauto|*,noauto|noauto,*|*,noauto,*)
4117 nfs|nfs4|smbfs|cifs|coda|ncp|ncpfs|ocfs2|gfs)
4118 domtab "$FTYPE" "$FDIR" "$FDEV" "-o$FOPTS"
4134 restart|reload|force-reload)
4135 echo "Error: argument '$1' not supported" >&2
4142 echo "Usage: mountall-mtab.sh [start|stop]" >&2
4150 # MySQL daemon start/stop script.
4152 # Debian version. Based on the original by TcX.
4156 ${DEBIAN_SCRIPT_DEBUG:+ set -v -x}
4158 test -x /usr/sbin/mysqld || exit 0
4160 SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
4161 CONF=/etc/mysql/my.cnf
4162 MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
4164 # priority can be overriden and "-s" adds output to stderr
4165 ERR_LOGGER="logger -p daemon.err -t /etc/init.d/mysql -i"
4167 # Safeguard (relative paths, core dumps..)
4171 # mysqladmin likes to read /root/.my.cnf. This is usually not what I want
4172 # as many admins e.g. only store a password without a username there and
4173 # so break my scripts.
4174 export HOME=/etc/mysql/
4176 ## fetch a particular option from mysql's invocation
4178 # usage: void mysqld_get_param option
4179 mysqld_get_param() {
4180 /usr/sbin/mysqld --print-defaults \
4187 ## Checks if there is a server running and if so if it is accessible.
4189 # check_alive insists on a pingable server
4190 # check_dead also fails if there is a lost mysqld in the process list
4192 # Usage: boolean mysqld_status [check_alive|check_dead] [warn|nowarn]
4194 ping_output=`$MYADMIN ping 2>&1`; ping_alive=$(( ! $? ))
4197 pidfile=`mysqld_get_param pid-file`
4198 if [ -f "$pidfile" ] && ps `cat $pidfile` >/dev/null 2>&1; then ps_alive=1; fi
4200 if [ "$1" = "check_alive" -a $ping_alive = 1 ] ||
4201 [ "$1" = "check_dead" -a $ping_alive = 0 -a $ps_alive = 0 ]; then
4202 return 0 # EXIT_SUCCESS
4204 if [ "$2" = "warn" ]; then
4205 /bin/echo -e "$ps_alive processes alive and '$MYADMIN ping' resulted in\n$ping_output\n" | $ERR_LOGGER -p daemon.debug
4207 return 1 # EXIT_FAILURE
4217 # check for config file
4218 if [ ! -r /etc/mysql/my.cnf ]; then
4219 /bin/echo -e "\nWARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz"
4222 echo -n "Starting MySQL database server: mysqld"
4223 if mysqld_status check_alive nowarn; then
4224 echo "...already running."
4226 /usr/bin/mysqld_safe > /dev/null 2>&1 &
4227 for i in 1 2 3 4 5 6; do
4229 if mysqld_status check_alive nowarn ; then break; fi
4231 if mysqld_status check_alive warn; then
4233 # Now start mysqlcheck or whatever the admin wants.
4234 /etc/mysql/debian-start
4237 /bin/echo -e "\tPlease take a look at the syslog."
4241 if $MYADMIN variables | egrep -q have_bdb.*YES; then
4242 /bin/echo "BerkeleyDB is obsolete, see /usr/share/doc/mysql-server-4.1/README.Debian.gz" | $ERR_LOGGER -p daemon.info
4247 # * As a passwordless mysqladmin (e.g. via ~/.my.cnf) must be possible
4248 # at least for cron, we can rely on it here, too. (although we have
4249 # to specify it explicit as e.g. sudo environments points to the normal
4250 # users home and not /root)
4251 echo -n "Stopping MySQL database server: mysqld"
4252 if ! mysqld_status check_dead nowarn; then
4254 shutdown_out=`$MYADMIN shutdown 2>&1`; r=$?
4256 if [ "$r" -ne 0 ]; then
4257 /bin/echo -e -n "...failed.\n$shutdown_out\nKilling MySQL database server by signal: mysqld"
4260 for i in 1 2 3 4 5 6 7 8 9 10; do
4262 if mysqld_status check_dead nowarn; then server_down=1; break; fi
4264 if test -z "$server_down"; then killall -9 mysqld; fi
4268 if ! mysqld_status check_dead warn; then
4270 echo "Please stop MySQL manually and read /usr/share/doc/mysql-server-4.1/README.Debian.gz!"
4278 set +e; $SELF stop; set -e
4282 'reload'|'force-reload')
4283 echo -n "Reloading MySQL database server: mysqld"
4289 if mysqld_status check_alive nowarn; then
4292 echo "MySQL is stopped."
4298 echo "Usage: $SELF start|stop|restart|reload|force-reload|status"
4305 # MySQL NDB management daemon start/stop script.
4309 ${DEBIAN_SCRIPT_DEBUG:+ set -v -x}
4312 SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
4313 DAEMON=/usr/sbin/ndbd
4314 CONF=/etc/mysql/my.cnf
4315 export HOME=/etc/mysql/
4317 # Safeguard (relative paths, core dumps..)
4321 # Exit *silently* if we're not supposed to be started.
4323 # The Debian scripts should execute these scripts to stop and start
4324 # the daemon when upgrading if it is started. On the other hand it should
4325 # remain silently if the server has not even been configured.
4326 # See /usr/share/doc/mysql-server-*/README.Debian for more information.
4327 test -x $DAEMON || exit 0
4328 if $DAEMON --help | grep -q '^ndb-connectstring.*No default value'; then exit 0; fi
4336 # Creatign a PID file does not work as the master process forks
4337 # a child with different PID and then terminates itself.
4338 echo -n "Starting MySQL NDB cluster server: ndbd"
4339 if start-stop-daemon \
4347 /bin/echo -e "\tPlease take a look at the syslog."
4353 echo -n "Stopping MySQL NDB cluster management server: ndbd"
4354 if start-stop-daemon \
4366 'restart'|'force-reload')
4367 set +e; $SELF stop; set -e
4372 echo "Usage: $SELF start|stop|restart|force-reload"
4379 # MySQL NDB management daemon start/stop script.
4383 ${DEBIAN_SCRIPT_DEBUG:+ set -v -x}
4386 SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
4387 DAEMON=/usr/sbin/ndb_mgmd
4388 CONF=/etc/mysql/ndb_mgmd.cnf
4389 export HOME=/etc/mysql/
4391 # Safeguard (relative paths, core dumps..)
4395 # Exit *silently* if we're not supposed to be started.
4397 # The Debian scripts should execute these scripts to stop and start
4398 # the daemon when upgrading if it is started. On the other hand it should
4399 # remain silently if the server has not even been configured.
4400 # See /usr/share/doc/mysql-server-*/README.Debian for more information.
4401 test -x $DAEMON || exit 0
4402 test -r $CONF || exit 0
4410 echo -n "Starting MySQL NDB cluster management server: ndb_mgmd"
4411 # --pid-file does not work as the daemon forks itself with $PID=$PID+1
4412 if start-stop-daemon \
4422 /bin/echo -e "\tPlease take a look at the syslog."
4428 echo -n "Stopping MySQL NDB cluster management server: ndb_mgmd"
4429 if start-stop-daemon \
4441 'restart'|'force-reload')
4442 set +e; $SELF stop; set -e
4447 echo "Usage: $SELF start|stop|restart|force-reload"
4454 # Provides: networking
4455 # Required-Start: mountkernfs ifupdown $local_fs
4456 # Required-Stop: ifupdown $local_fs
4459 # Short-Description: Raise network interfaces.
4462 PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
4464 [ -x /sbin/ifup ] || exit 0
4466 . /lib/lsb/init-functions
4471 log_action_begin_msg "Configuring network interfaces"
4472 type usplash_write >/dev/null 2>/dev/null && usplash_write "TIMEOUT 120" || true
4473 if [ "$VERBOSE" != no ]; then
4475 log_action_end_msg $?
4477 log_action_end_msg $?
4480 if ifup -a >/dev/null 2>&1; then
4481 log_action_end_msg $?
4483 log_action_end_msg $?
4486 type usplash_write >/dev/null 2>/dev/null && usplash_write "TIMEOUT 15" || true
4490 if sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\2/p' /proc/mounts |
4491 grep -qE '^(nfs[1234]?|smbfs|ncp|ncpfs|coda|cifs)$'; then
4492 log_warning_msg "not deconfiguring network interfaces: network shares still mounted."
4496 log_action_begin_msg "Deconfiguring network interfaces"
4497 if [ "$VERBOSE" != no ]; then
4498 if ifdown -a --exclude=lo; then
4499 log_action_end_msg $?
4501 log_action_end_msg $?
4504 if ifdown -a --exclude=lo >/dev/null 2>/dev/null; then
4505 log_action_end_msg $?
4507 log_action_end_msg $?
4512 force-reload|restart)
4513 log_action_begin_msg "Reconfiguring network interfaces"
4514 ifdown -a --exclude=lo || true
4515 if ifup -a --exclude=lo; then
4516 log_action_end_msg $?
4518 log_action_end_msg $?
4523 echo "Usage: /etc/init.d/networking {start|stop|restart|force-reload}"
4532 # nfs-common This shell script takes care of starting and stopping
4533 # common daemons required for NFS clients and servers.
4535 # chkconfig: 345 20 80
4536 # description: NFS is a popular protocol for file sharing across \
4537 # TCP/IP networks. This service provides NFS file \
4538 # locking functionality.
4544 DESC="NFS common utilities"
4547 DEFAULTFILE=/etc/default/nfs-common
4551 IDMAPD_PIDFILE=/var/run/rpc.idmapd.pid
4553 GSSD_PIDFILE=/var/run/rpc.gssd.pid
4554 PIPEFS_MOUNTPOINT=/var/lib/nfs/rpc_pipefs
4556 if [ -f $DEFAULTFILE ]; then
4560 . /lib/lsb/init-functions
4562 # Determine whether lockd daemon is required.
4563 case "$NEED_LOCKD" in
4565 *) case `uname -r` in
4566 '' | [01].* | 2.[0123].* )
4567 # Older kernels may or may not need a lockd daemon.
4568 # We must assume they do, unless we can prove otherwise.
4569 # (A false positive here results only in a harmless message.)
4571 if test -f /proc/ksyms
4573 grep -q lockdctl /proc/ksyms || NEED_LOCKD=no
4577 *) # Modern kernels (>= 2.4) start a lockd thread automatically.
4584 # Exit if required binaries are missing.
4585 [ -x $PREFIX/sbin/rpc.statd ] || exit 0
4586 [ -x $PREFIX/sbin/rpc.lockd ] || [ "$NEED_LOCKD" = no ] || exit 0
4587 [ -x /usr/sbin/rpc.idmapd ] || [ "$NEED_IDMAPD" = no ] || exit 0
4588 [ -x /usr/sbin/rpc.gssd ] || [ "$NEED_GSSD" = no ] || exit 0
4591 modprobe -q "$1" || true
4595 if ! grep -E -qs "$1\$" /proc/filesystems
4599 if ! mountpoint -q "$2"
4601 mount -t "$1" "$1" "$2"
4607 # See how we were called.
4610 cd / # daemons should have root dir as cwd
4611 log_begin_msg "Starting nfs statd..."
4613 start-stop-daemon --start --quiet \
4614 --exec $PREFIX/sbin/rpc.statd -- $STATDOPTS || ERROR=1
4616 if [ "$NEED_LOCKD" = yes ]
4618 log_begin_msg "Starting nfs lockd..."
4620 start-stop-daemon --start --quiet \
4621 --exec $PREFIX/sbin/rpc.lockd || ERROR=1
4624 if [ "$NEED_IDMAPD" = yes ] || [ "$NEED_GSSD" = yes ]
4627 if do_mount rpc_pipefs $PIPEFS_MOUNTPOINT
4629 if [ "$NEED_IDMAPD" = yes ]
4631 log_begin_msg "Starting rpc idmapd..."
4633 start-stop-daemon --start --quiet \
4634 --make-pidfile --pidfile $IDMAPD_PIDFILE \
4635 --exec /usr/sbin/rpc.idmapd || ERROR=1
4638 if [ "$NEED_GSSD" = yes ]
4640 log_begin_msg "Starting rpc gssd..."
4642 start-stop-daemon --start --quiet \
4643 --make-pidfile --pidfile $GSSD_PIDFILE \
4644 --exec /usr/sbin/rpc.gssd -- $RPCGSSDOPTS || ERROR=1
4652 if [ "$NEED_GSSD" = yes ]
4654 log_begin_msg "Stopping rpc gssd..."
4656 start-stop-daemon --stop --oknodo --quiet \
4657 --name rpc.gssd --user 0 || ERROR=1
4661 if [ "$NEED_IDMAPD" = yes ]
4663 log_begin_msg "Stopping rpc idmapd..."
4665 start-stop-daemon --stop --oknodo --quiet \
4666 --name rpc.idmapd --user 0 || ERROR=1
4668 rm -f $IDMAPD_PIDFILE
4670 if [ "$NEED_LOCKD" = yes ]
4672 log_begin_msg "Stopping nfs lockd..."
4674 start-stop-daemon --stop --oknodo --quiet \
4675 --name rpc.lockd --user 0 || ERROR=1
4678 log_begin_msg "Stopping nfs statd..."
4680 start-stop-daemon --stop --oknodo --quiet \
4681 --name rpc.statd --user 0 || ERROR=1
4685 restart | force-reload)
4692 log_success_msg "Usage: nfs-common {start|stop|restart}"
4701 # This shell script takes care of starting and stopping
4702 # the kernel-mode NFS server.
4704 # chkconfig: 345 60 20
4705 # description: NFS is a popular protocol for file sharing across TCP/IP \
4706 # networks. This service provides NFS server functionality, \
4707 # which is configured via the /etc/exports file.
4713 DESC="NFS kernel daemon"
4716 # Exit if required binaries are missing.
4717 [ -x $PREFIX/sbin/rpc.nfsd ] || exit 0
4718 [ -x $PREFIX/sbin/rpc.mountd ] || exit 0
4719 [ -x $PREFIX/sbin/exportfs ] || exit 0
4720 [ -x $PREFIX/sbin/rpc.svcgssd ] || exit 0
4723 DEFAULTFILE=/etc/default/nfs-kernel-server
4729 PROCNFSD_MOUNTPOINT=/proc/fs/nfsd
4730 if [ -f $DEFAULTFILE ]; then
4734 . /lib/lsb/init-functions
4737 modprobe -q "$1" || true
4741 if ! grep -E -qs "$1\$" /proc/filesystems
4745 if ! mountpoint -q "$2"
4747 mount -t "$1" "$1" "$2"
4753 # See how we were called.
4756 cd / # daemons should have root dir as cwd
4757 if grep -q '^/' /etc/exports
4760 do_mount nfsd $PROCNFSD_MOUNTPOINT || NEED_SVCGSSD=no
4761 log_begin_msg "Exporting directories for $DESC..."
4763 $PREFIX/sbin/exportfs -r || ERROR=1
4766 if [ "$NEED_SVCGSSD" = yes ]
4768 log_begin_msg "Starting rpc svcgssd..."
4770 start-stop-daemon --start --quiet \
4771 --make-pidfile --pidfile /var/run/rpc.svcgssd.pid \
4772 --exec $PREFIX/sbin/rpc.svcgssd -- $RPCSVCGSSDOPTS || ERROR=1
4776 log_begin_msg "Starting rpc nfsd..."
4778 start-stop-daemon --start --quiet \
4779 --exec $PREFIX/sbin/rpc.nfsd -- $RPCNFSDCOUNT || ERROR=1
4782 # make sure 127.0.0.1 is a valid source for requests
4784 if [ -f /proc/net/rpc/auth.unix.ip/channel ]
4786 fgrep -qs 127.0.0.1 /proc/net/rpc/auth.unix.ip/content || {
4787 echo "nfsd 127.0.0.1 2147483647 localhost" >/proc/net/rpc/auth.unix.ip/channel
4792 $PREFIX/bin/rpcinfo -u localhost nfs 3 >/dev/null 2>&1 ||
4793 RPCMOUNTDOPTS="$RPCMOUNTDOPTS --no-nfs-version 3"
4795 [ -z "$ClearAddr" ] || echo "nfsd 127.0.0.1 1" >/proc/net/rpc/auth.unix.ip/channel
4797 log_begin_msg "Starting rpc mountd..."
4799 start-stop-daemon --start --quiet \
4800 --exec $PREFIX/sbin/rpc.mountd -- $RPCMOUNTDOPTS || ERROR=1
4803 log_warning_msg "Not starting $DESC: No exports."
4808 log_begin_msg "Stopping rpc mountd..."
4810 start-stop-daemon --stop --oknodo --quiet \
4811 --name rpc.mountd --user 0 || ERROR=1
4813 if [ "$NEED_SVCGSSD" = yes ]
4815 log_begin_msg "Stopping rpc svcgssd..."
4817 start-stop-daemon --stop --oknodo --quiet \
4818 --name rpc.svcgssd --user 0 || ERROR=1
4820 rm -f /var/run/rpc.svcgssd.pid
4822 log_begin_msg "Stopping rpc nfsd..."
4824 start-stop-daemon --stop --oknodo --quiet \
4825 --name nfsd --user 0 --signal 2 || ERROR=1
4828 log_begin_msg "Unexporting directories for $DESC..."
4830 $PREFIX/sbin/exportfs -au || ERROR=1
4834 reload | force-reload)
4835 log_begin_msg "Re-exporting directories for $DESC..."
4837 $PREFIX/sbin/exportfs -r || ERROR=1
4848 log_success_msg "Usage: nfs-kernel-server {start|stop|reload|force-reload|restart}"
4858 # Required-Start: udev
4862 # Short-Description: PCMCIA support
4863 # Description: This service provides PCMCIA hardware support for
4864 # systems running Linux >= 2.6.13-rc1.
4869 [ -f /sbin/pccardctl ] || exit 0
4871 # If /lib/lsb/init-functions doesn't exist
4872 # define them here, otherwise installer breaks
4873 if [ -f /lib/lsb/init-functions ]; then
4874 . /lib/lsb/init-functions
4882 if [ "$1" = 0 ]; then
4899 [ -f /etc/default/pcmciautils ] && . /etc/default/pcmciautils
4907 [ -f /etc/default/rcS ] && . /etc/default/rcS
4909 # Are we running from init?
4912 ([ "$previous" ] && [ "$runlevel" ]) || [ "$runlevel" = S ]
4915 if ls /sys/class/pcmcia_socket/* >/dev/null 2>&1; then
4916 if ! run_by_init; then
4917 log_success_msg "PCMCIA bridge driver already present in kernel"
4922 KERNEL_VERSION="$(uname -r | sed 's/-.*//')"
4926 case $KERNEL_VERSION in
4927 2.[012345].*|2.6.[0-9]|2.6.[0-9][!0-9]*) return 1 ;;
4928 2.6.1[012]|2.6.1[012][!0-9]*) return 1 ;;
4933 if ! supported_kernel; then
4934 if ! run_by_init; then
4935 log_failure_msg "pcmciautils requires Linux >= 2.6.13-rc1; use pcmcia-cs instead"
4940 if [ -z "$PCIC" ]; then
4941 if ! run_by_init; then
4942 log_failure_msg "No PCMCIA bridge module specified"
4947 if ! [ -e /dev/.udev ]; then
4948 if ! run_by_init; then
4949 log_failure_msg "pcmciautils requires udev to be enabled"
4954 if [ "$VERBOSE" = "no" ]; then
4955 MODPROBE_OPTIONS="$MODPROBE_OPTIONS -Q"
4956 export MODPROBE_OPTIONS
4961 log_daemon_msg "Loading PCMCIA bridge driver module" "$PCIC"
4963 if [ "$CORE_OPTS" ]; then
4964 modprobe -Qb pcmcia_core $CORE_OPTS
4967 modprobe -Qb $PCIC $PCIC_OPTS
4981 reload|force-reload)
4985 log_success_msg "Usage: $0 {start|stop|restart|reload|force-reload}"
4991 # start/stop portmap daemon.
4995 # Required-Start: $network
4996 # Required-Stop: $network
4997 # Should-Start: $named
4998 # Should-Stop: $named
4999 # Default-Start: S 1 2 3 4 5
5003 test -f /sbin/portmap || exit 0
5005 . /lib/lsb/init-functions
5008 if [ -f /etc/default/portmap ]; then
5009 . /etc/default/portmap
5010 elif [ -f /etc/portmap.conf ]; then
5017 if [ -n "$pid" ] ; then
5018 log_begin_msg "Not starting portmap daemon. Already running."
5022 log_begin_msg "Starting portmap daemon..."
5023 start-stop-daemon --start --quiet --oknodo --exec /sbin/portmap -- $OPTIONS
5026 sleep 1 # needs a short pause or pmap_set won't work. :(
5027 if [ -f /var/run/portmap.upgrade-state ]; then
5028 log_begin_msg "Restoring old RPC service information..."
5029 pmap_set </var/run/portmap.upgrade-state
5031 rm -f /var/run/portmap.upgrade-state
5033 if [ -f /var/run/portmap.state ]; then
5034 pmap_set </var/run/portmap.state
5035 rm -f /var/run/portmap.state
5041 log_begin_msg "Stopping portmap daemon..."
5042 pmap_dump >/var/run/portmap.state
5043 start-stop-daemon --stop --quiet --oknodo --exec /sbin/portmap
5054 log_success_msg "Usage: /etc/init.d/portmap {start|stop|force-reload|restart}"
5063 # /etc/init.d/ppp: start or stop PPP link.
5065 # This configuration method is deprecated, please use /etc/network/interfaces.
5067 [ -x /usr/sbin/pppd -a -f /etc/ppp/ppp_on_boot ] || exit 0
5068 if [ -x /etc/ppp/ppp_on_boot ]; then RUNFILE=1; fi
5069 . /lib/lsb/init-functions
5073 log_begin_msg "Starting up PPP link..."
5074 if [ "$RUNFILE" = "1" ]; then
5075 /etc/ppp/ppp_on_boot
5082 log_begin_msg "Shutting down PPP link..."
5083 if [ "$RUNFILE" = "1" ]; then
5090 restart|force-reload)
5091 log_begin_msg "Restarting PPP link..."
5092 if [ "$RUNFILE" = "1" ]; then
5095 /etc/ppp/ppp_on_boot
5097 poff provider || true
5104 log_success_msg "Usage: /etc/init.d/ppp {start|stop|restart|force-reload}"
5112 # Provides: pppd-dns
5113 # Required-Start: $local_fs
5115 # Short-Description: Restore resolv.conf if the system crashed.
5118 # Restore /etc/resolv.conf if the system crashed before the ppp link
5121 [ -x /etc/ppp/ip-down.d/0000usepeerdns ] \
5122 && exec /etc/ppp/ip-down.d/0000usepeerdns
5125 ###########################################################################
5126 # Autostart script for guest tools' service.
5128 # Copyright (c) 2005-2008 Parallels Software International, Inc.
5129 # All rights reserved.
5130 # http://www.parallels.com
5131 ###########################################################################
5135 # chkconfig: 2345 99 20
5136 # description: Autostart script for guest tools' service.
5140 # Provides: prltoolsd
5143 # Default-Start: 2 3 4 5
5144 # Default-Stop: 0 1 6
5145 # Description: Autostart script for guest tools' service.
5149 ###########################################################################
5150 # Set configuration data
5151 ###########################################################################
5154 exefile="/usr/bin/${prlfile}"
5155 pidfile="/var/run/${prlfile}.pid"
5157 # Set custom options if they are required
5158 PRLTOOLSD_OPTIONS="-p $pidfile"
5160 ###########################################################################
5161 # Install client ID for wireless bridged networking
5162 ###########################################################################
5164 # Install record for client ID sending for each networking card
5165 # in the system in the dhclient.conf (dhclient is installed)
5166 dhclient_install() {
5167 # Locate dhclient.conf using strings. The directory can be
5168 # different on different distributions
5169 CONF=`strings /sbin/dhclient | grep etc | grep dhclient.conf`
5172 # and can even not exists...
5173 mkdir -p `dirname $CONF`
5176 for IFACE in $IFACES; do
5177 HWADDR=`ifconfig -a | grep ^$IFACE | awk '{ print $5 }'`
5180 # Install section like
5181 # interface "eth0" {
5182 # send dhcp-client-identifier 1:<real_mac>;
5184 # or leave it untouched if present
5191 iface = ENVIRON["IFACE"]
5192 addr = ENVIRON["HWADDR"]
5194 print "interface \""iface"\" {"
5195 print " send dhcp-client-identifier 1:"addr"; # Remove this comment on manual client-id modification"
5201 iface = ENVIRON["IFACE"]
5203 gsub(/\"/, "", test_if)
5204 gsub(/ /, "", test_if)
5205 if (test_if == iface)
5206 iface_found = inside_iface = 1
5209 /dhcp-client-identifier/ {
5212 match(str, /Remove this/))
5219 addr = ENVIRON["HWADDR"]
5222 print " send dhcp-client-identifier 1:"addr"; # Remove this comment on manual client-id modification"
5229 ' $CONF >$CONF.tmp1 || exit 0
5234 # Install key to send client ID (dhcpcd is installed)
5235 # Kludge to do this on the per/interface basis is not found
5237 CONF="/etc/sysconfig/network/dhcp"
5238 HWADDR=`/sbin/ifconfig -a | awk '/HWaddr/ { print $5 ; exit }'`
5240 awk '/DHCLIENT_CLIENT_ID=/{
5242 sub(/\".*\"/, "", str1)
5243 if (length(str1) + 2 >= length(str) || match($str, /Remove this/))
5244 print "DHCLIENT_CLIENT_ID=\"1:"ENVIRON["HWADDR"]"\" # Remove this comment on manual client-id modification"
5252 ' $CONF >$CONF.tmp1 || exit 0
5256 clientid_install() {
5257 IFACES=`ifconfig -a | awk '/HWaddr/{ print $1 }' | xargs`
5258 if [ -n "$IFACES" ]; then
5259 [ -f /sbin/dhclient ] && dhclient_install $IFACES
5260 [ -f /etc/sysconfig/network/dhcp ] && dhcpc_install $IFACES
5264 ###########################################################################
5265 # Start and Stop operations for tools' daemon
5266 ###########################################################################
5269 if [ -f $pidfile ]; then
5273 echo -n $"Loading Parallels ToolsGate driver: "
5274 if modprobe prl_tg; then
5280 echo -n $"Loading Parallels Network driver: "
5282 # Installing client-id to the DHCP client configuration
5283 # is temporary disabled.
5287 if modprobe prl_eth; then
5293 echo -n $"Loading Parallels Shared Folders driver: "
5294 if modprobe prl_fs; then
5300 echo -n $"Starting Parallels tools daemon: "
5301 $exefile ${PRLTOOLSD_OPTIONS}
5303 if [ -n $RETVAL ]; then
5315 echo -n $"Shutting down Parallels tools daemon: "
5317 if [ -f $pidfile ]; then
5318 prlpid=`cat $pidfile 2>/dev/null`
5320 if [ -n $prlpid ] && [ -e /proc/$prlpid ]; then
5328 if [ -n $RETVAL ]; then
5337 ###########################################################################
5338 # Perform initial operations
5339 ###########################################################################
5341 [ -f $exefile ] || exit 0
5343 ###########################################################################
5344 # Start/stop guest tools' service
5345 ###########################################################################
5359 echo "=> This script starts/stops Parallels guest tools' service"
5360 echo "Usage: $0 <start | stop | restart>"
5367 # /etc/init.d/procps: Set kernel variables from /etc/sysctl.conf
5369 # written by Elrond <Elrond@Wunder-Nett.org>
5373 # Required-Start: mountkernfs
5377 # Short-Description: Configure kernel parameters at boottime
5378 # Description: Loads kernel parameters that are specified in /etc/sysctl.conf
5382 # Check for existance of the default file and exit if not there,
5383 # Closes #52839 for the boot-floppy people
5384 [ -r /etc/default/rcS ] || exit 0
5386 . /lib/lsb/init-functions
5389 which sysctl > /dev/null || exit 0
5393 start|restart|force-reload)
5394 if [ ! -r /etc/sysctl.conf ]
5399 if [ "$VERBOSE" = "yes" ]; then
5402 log_action_begin_msg "Setting kernel variables"
5404 log_action_end_msg $?
5409 echo "Usage: /etc/init.d/procps {start|stop|restart|force-reload}" >&2
5418 # Starts/stops services on runlevel changes.
5420 # Optimization: A start script is not run when the service was already
5421 # configured to run in the previous runlevel. A stop script is not run
5422 # when the the service was already configured not to run in the previous
5426 # Miquel van Smoorenburg <miquels@cistron.nl>
5427 # Bruce Perens <Bruce@Pixar.com>
5429 PATH=/sbin:/bin:/usr/sbin:/usr/bin
5432 # Un-comment the following for debugging.
5435 # Specify method used to enable concurrent init.d scripts.
5436 # Valid options are 'none' and 'shell'.
5439 # Make sure the name survive changing the argument list
5445 # Stub to do progress bar ticks (currently just for usplash) on startup
5447 startup_progress() {
5449 step=$(($step + $step_change))
5450 progress=$(($step * $progress_size / $num_steps + $first_step))
5451 if type usplash_write >/dev/null 2>&1; then
5452 usplash_write "PROGRESS $progress" || true
5457 # Start script or program.
5459 case "$CONCURRENCY" in
5466 # Debian Policy §9.3.1 requires .sh scripts in runlevel S to be sourced
5467 # However, some important packages currently contain .sh scripts
5468 # that do "exit" at some point, thus killing this process. Bad!
5469 #[ S = "$runlevel" ] && sh=.
5470 for script in $scripts ; do
5473 if [ "." = "$sh" ] ; then
5475 RC_SAVE_PATH="$PATH"
5476 startup_progress $debug . "$script"
5477 PATH="$RC_SAVE_PATH"
5479 startup_progress $debug $sh "$script" $action
5483 startup_progress $debug "$script" $action
5495 # Debian Policy §9.3.1 requires .sh scripts in runlevel S to be sourced
5496 # However, some important packages currently contain .sh scripts
5497 # that do "exit" at some point, thus killing this process. Bad!
5498 #[ S = "$runlevel" ] && sh=.
5500 for script in $scripts ; do
5503 if [ "." = "$sh" ] ; then
5505 RC_SAVE_PATH="$PATH"
5506 startup_progress $debug . "$script"
5507 PATH="$RC_SAVE_PATH"
5509 startup_progress $debug $sh "$script" $action
5513 startup_progress $debug "$script" $action &
5518 [ 1 = "$backgrounded" ] && wait
5527 # Debian Policy §9.3.1 requires .sh scripts in runlevel S to be sourced
5528 # However, some important packages currently contain .sh scripts
5529 # that do "exit" at some point, thus killing this process. Bad!
5530 #[ S = "$runlevel" ] && sh=.
5531 # Make sure .sh scripts are sourced in runlevel S
5532 if [ "." = "$sh" ] ; then
5534 for script in $scripts ; do
5538 RC_SAVE_PATH="$PATH"
5539 startup_progress $debug . "$script"
5540 PATH="$RC_SAVE_PATH"
5543 newscripts="$newscripts $script"
5547 scripts="$newscripts"
5550 # startpar is not working as it should yet [pere 2005-09-10]
5551 [ -n "$scripts" ] && startup_progress $debug startpar -a $action $scripts
5552 startup_progress $debug startpar -a $action $scripts
5558 echo "error: '$scriptname' exited outside the expected code flow."
5560 trap on_exit EXIT # Enable emergency handler
5562 # Ignore CTRL-C only in this shell, so we can interrupt subprocesses.
5563 trap ":" INT QUIT TSTP
5565 # Should we also output to the console?
5566 # /proc won't be mounted if we don't have an initramfs, but then we're
5567 # dealing with custom systems so it's their own fault that they'll get
5568 # output from rcS ;)
5569 if grep -w -q quiet /proc/cmdline 2>/dev/null; then
5576 # Set onlcr to avoid staircase effect.
5577 if [ "$QUIET" != yes ]; then
5578 stty onlcr </dev/console >/dev/console 2>&1
5581 # Now find out what the current and what the previous runlevel are.
5584 # Get first argument. Set new runlevel to this argument.
5585 [ "$1" != "" ] && runlevel=$1
5586 if [ "$runlevel" = "" ]
5588 echo "Usage: $scriptname <runlevel>" >&2
5592 [ "$previous" = "" ] && previous=N
5594 export runlevel previous
5596 if [ S = "$runlevel" ]
5599 # See if system needs to be setup. This is ONLY meant to
5600 # be used for the initial setup after a fresh installation!
5602 if [ -x /sbin/unconfigured.sh ]
5604 /sbin/unconfigured.sh
5611 # Is there an rc directory for this new runlevel?
5612 if [ -d /etc/rc$runlevel.d ]
5614 # Split the progress bar into thirds
5615 progress_size=$((100 / 3))
5620 # Count down from 0 to -100 and use the entire bar
5627 # Use 2/3 of the space
5629 progress_size=$(($progress_size * 2))
5634 # Begin where rcS left off and use the final 1/3 of
5635 # the space (by leaving progress_size unchanged)
5636 first_step=$(($progress_size * 2))
5641 # Count the number of scripts we need to run (for usplash progress bar)
5643 for s in /etc/rc$runlevel.d/[SK]*; do
5644 case "${s##/etc/rc$runlevel.d/S??}" in
5645 gdm|xdm|kdm|ltsp-client-core|reboot|halt)
5649 num_steps=$(($num_steps + 1))
5654 # First, run the KILL scripts.
5655 if [ "$previous" != N ]
5657 # Run all scripts with the same level in parallel
5659 for s in /etc/rc$runlevel.d/K*
5661 level=$(echo $s | sed 's/.*\/K\([0-9][0-9]\).*/\1/')
5662 if [ "$level" = "$CURLEVEL" ]
5668 for i in /etc/rc$runlevel.d/K$level*
5670 # Check if the script is there.
5671 [ ! -f $i ] && continue
5674 # Find stop script in previous runlevel but
5675 # no start script there.
5677 suffix=${i#/etc/rc$runlevel.d/K[0-9][0-9]}
5678 previous_stop=/etc/rc$previous.d/K[0-9][0-9]$suffix
5679 previous_start=/etc/rc$previous.d/S[0-9][0-9]$suffix
5681 # If there is a stop script in the previous level
5682 # and _no_ start script there, we don't
5683 # have to re-stop the service.
5685 [ -f $previous_stop ] && [ ! -f $previous_start ] && continue
5688 SCRIPTS="$SCRIPTS $i"
5690 startup stop $SCRIPTS
5694 # Now run the START scripts for this runlevel.
5695 # Run all scripts with the same level in parallel
5697 for s in /etc/rc$runlevel.d/S*
5699 level=$(echo $s | sed 's/.*\/S\([0-9][0-9]\).*/\1/')
5700 if [ "$level" = "$CURLEVEL" ]
5706 for i in /etc/rc$runlevel.d/S$level*
5708 [ ! -f $i ] && continue
5710 if [ "$previous" != N ]
5713 # Find start script in previous runlevel and
5714 # stop script in this runlevel.
5716 suffix=${i#/etc/rc$runlevel.d/S[0-9][0-9]}
5717 stop=/etc/rc$runlevel.d/K[0-9][0-9]$suffix
5718 previous_start=/etc/rc$previous.d/S[0-9][0-9]$suffix
5720 # If there is a start script in the previous level
5721 # and _no_ stop script in this level, we don't
5722 # have to re-start the service.
5724 [ -f $previous_start ] && [ ! -f $stop ] && continue
5726 SCRIPTS="$SCRIPTS $i"
5728 startup $ACTION $SCRIPTS
5732 if [ S = "$runlevel" ]
5735 # For compatibility, run the files in /etc/rc.boot too.
5737 [ -d /etc/rc.boot ] && run-parts /etc/rc.boot
5740 # Finish setup if needed. The comment above about
5741 # /sbin/unconfigured.sh applies here as well!
5743 if [ -x /sbin/setup.sh ]
5749 trap - EXIT # Disable emergency handler
5755 PATH=/sbin:/bin:/usr/sbin:/usr/bin
5756 [ -f /etc/default/rcS ] && . /etc/default/rcS
5757 . /lib/lsb/init-functions
5760 if [ -x /etc/rc.local ]; then
5761 log_begin_msg "Running local boot scripts (/etc/rc.local)"
5771 restart|reload|force-reload)
5772 echo "Error: argument '$1' not supported" >&2
5778 echo "Usage: $0 start|stop" >&2
5786 # Call all S??* scripts in /etc/rcS.d/ in numerical/alphabetical order
5789 exec /etc/init.d/rc S
5790 Configuration of System V init under Debian GNU/Linux
5792 Most Unix versions have a file here that describes how the scripts
5793 in this directory work, and how the links in the /etc/rc?.d/ directories
5794 influence system startup/shutdown.
5796 For Debian, this information is contained in the policy manual, chapter
5797 "System run levels and init.d scripts". The Debian Policy Manual is
5800 http://www.debian.org/doc/debian-policy/#contents
5802 The Debian Policy Manual is also available in the Debian package
5803 "debian-policy". When this package is installed, the policy manual can be
5804 found in directory /usr/share/doc/debian-policy. If you have a browser
5805 installed you can probably read it at
5807 file://localhost/usr/share/doc/debian-policy/
5809 Some more detailed information can also be found in the files in the
5810 /usr/share/doc/sysv-rc directory.
5812 Debian Policy dictates that /etc/init.d/*.sh scripts must work properly
5813 when sourced. The following additional rules apply:
5815 * /etc/init.d/*.sh scripts may not rely for their correct functioning
5816 on their being sourced rather than executed. That is, they must work
5817 properly when executed too. They must include "#!/bin/sh" at the top.
5819 * /etc/init.d/*.sh scripts must conform to the rules for sh scripts as
5820 spelled out in the Debian policy section entitled "Scripts" (§10.4).
5825 # Required-Start: umountroot $network
5827 # Should-Start: lvm raid2
5830 # Short-Description: Execute the reboot command.
5834 PATH=/usr/sbin:/usr/bin:/sbin:/bin
5836 . /lib/lsb/init-functions
5839 # Message should end with a newline since kFreeBSD may
5840 # print more stuff (see #323749)
5841 log_action_msg "Will now restart"
5849 restart|reload|force-reload)
5850 echo "Error: argument '$1' not supported" >&2
5857 echo "Usage: $0 start|stop" >&2
5863 # Provides: rmnologin
5864 # Required-Start: $local_fs $remote_fs
5866 # Should-Start: kdm xdm gdm $syslog
5867 # Default-Start: 0 1 2 3 4 5 6
5869 # Short-Description: Remove /etc/nologin at boot
5870 # Description: This script removes the /etc/nologin file as the
5871 # last step in the boot process, if DELAYLOGIN=yes.
5872 # If DELAYLOGIN=no, /etc/nologin was not created by
5873 # bootmisc earlier in the boot process.
5877 [ "$DELAYLOGIN" ] || DELAYLOGIN=yes
5882 # If login delaying is enabled then remove the flag file
5884 case "$DELAYLOGIN" in
5886 rm -f /var/lib/initscripts/nologin
5895 restart|reload|force-reload)
5896 echo "Error: argument '$1' not supported" >&2
5903 echo "Usage: $0 start|stop" >&2
5913 # Required-Start: $network
5914 # Required-Stop: $syslog
5915 # Should-Start: $named $syslog
5916 # Should-Stop: $syslog network
5917 # Default-Start: 2 3 4 5
5918 # Default-Stop: 0 1 6
5919 # Short-Description: fast remote file copy program daemon
5920 # Description: rsync is a program that allows files to be copied to and
5921 # from remote machines in much the same way as rcp.
5922 # This provides rsyncd daemon functionality.
5927 # /etc/init.d/rsync: start and stop the rsync daemon
5929 DAEMON=/usr/bin/rsync
5932 RSYNC_DEFAULTS_FILE=/etc/default/rsync
5933 RSYNC_CONFIG_FILE=/etc/rsyncd.conf
5936 test -x $DAEMON || exit 0
5938 . /lib/lsb/init-functions
5941 if [ -s $RSYNC_DEFAULTS_FILE ]; then
5942 . $RSYNC_DEFAULTS_FILE
5943 case "x$RSYNC_ENABLE" in
5947 *) log_failure_msg "Value of RSYNC_ENABLE in $RSYNC_DEFAULTS_FILE must be either 'true' or 'false';"
5948 log_failure_msg "not starting rsync daemon."
5952 case "x$RSYNC_NICE" in
5953 x[0-9]) RSYNC_NICE_PARM="--nicelevel $RSYNC_NICE";;
5954 x[1-9][0-9]) RSYNC_NICE_PARM="--nicelevel $RSYNC_NICE";;
5956 *) log_warning_msg "Value of RSYNC_NICE in $RSYNC_DEFAULTS_FILE must be a value between 0 and 19 (inclusive);"
5957 log_warning_msg "ignoring RSYNC_NICE now."
5962 export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
5966 if "$RSYNC_ENABLE"; then
5967 log_daemon_msg "Starting rsync daemon" "rsync"
5968 if [ -s /var/run/rsync.pid ] && kill -0 $(cat /var/run/rsync.pid) >/dev/null 2>&1; then
5969 log_progress_msg "apparently already running"
5973 if [ ! -s "$RSYNC_CONFIG_FILE" ]; then
5974 log_failure_msg "missing or empty config file $RSYNC_CONFIG_FILE"
5978 if start-stop-daemon --start --quiet --background \
5979 --pidfile /var/run/rsync.pid --make-pidfile \
5980 $RSYNC_NICE_PARM --exec /usr/bin/rsync \
5981 -- --no-detach --daemon --config "$RSYNC_CONFIG_FILE" $RSYNC_OPTS
5985 if ! kill -0 $(cat /var/run/rsync.pid) >/dev/null 2>&1; then
5986 log_failure_msg "rsync daemon failed to start"
5992 if [ $rc -eq 0 ]; then
5996 rm -f /var/run/rsync.pid
5999 if [ -s "$RSYNC_CONFIG_FILE" ]; then
6000 [ "$VERBOSE" != no ] && log_warning_msg "rsync daemon not enabled in /etc/default/rsync, not starting..."
6005 log_daemon_msg "Stopping rsync daemon" "rsync"
6006 start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/rsync.pid
6008 rm -f /var/run/rsync.pid
6011 reload|force-reload)
6012 log_warning_msg "Reloading rsync daemon: not needed, as the daemon"
6013 log_warning_msg "re-reads the config file whenever a client connects."
6018 if $RSYNC_ENABLE; then
6019 log_daemon_msg "Restarting rsync daemon" "rsync"
6020 if [ -s /var/run/rsync.pid ] && kill -0 $(cat /var/run/rsync.pid) >/dev/null 2>&1; then
6021 start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/rsync.pid || true
6024 log_warning_msg "rsync daemon not running, attempting to start."
6025 rm -f /var/run/rsync.pid
6027 if start-stop-daemon --start --quiet --background \
6028 --pidfile /var/run/rsync.pid --make-pidfile \
6029 $RSYNC_NICE_PARM --exec /usr/bin/rsync \
6030 -- --no-detach --daemon --config "$RSYNC_CONFIG_FILE" $RSYNC_OPTS
6034 if ! kill -0 $(cat /var/run/rsync.pid) >/dev/null 2>&1; then
6035 log_failure_msg "rsync daemon failed to start"
6041 if [ $rc -eq 0 ]; then
6045 rm -f /var/run/rsync.pid
6048 [ "$VERBOSE" != no ] && log_warning_msg "rsync daemon not enabled in /etc/default/rsync, not starting..."
6053 echo "Usage: /etc/init.d/rsync {start|stop|reload|force-reload|restart}"
6062 # Required-Start: $network $local_fs $remote_fs
6063 # Required-Stop: $network $local_fs $remote_fs
6064 # Default-Start: 2 3 4 5
6065 # Default-Stop: 0 1 6
6066 # Short-Description: start Samba daemons (nmbd and smbd)
6073 # Reads config file (will override defaults above)
6074 [ -r /etc/default/samba ] && . /etc/default/samba
6076 DAEMON=/usr/sbin/smbd
6077 PIDDIR=/var/run/samba
6078 NMBDPID=$PIDDIR/nmbd.pid
6079 SMBDPID=$PIDDIR/smbd.pid
6081 # clear conflicting settings from the environment
6084 # See if the daemons are there
6085 test -x /usr/sbin/nmbd -a -x /usr/sbin/smbd || exit 0
6087 . /lib/lsb/init-functions
6091 log_daemon_msg "Starting Samba daemons"
6092 # Make sure we have our PIDDIR, even if it's on a tmpfs
6093 install -o root -g root -m 755 -d $PIDDIR
6095 NMBD_DISABLED=`testparm -s --parameter-name='disable netbios' 2>/dev/null`
6096 if [ "$NMBD_DISABLED" != 'Yes' ]; then
6097 log_progress_msg "nmbd"
6098 if ! start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/nmbd -- -D
6105 if [ "$RUN_MODE" != "inetd" ]; then
6106 log_progress_msg "smbd"
6107 if ! start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/smbd -- -D; then
6116 log_daemon_msg "Stopping Samba daemons"
6117 log_progress_msg "nmbd"
6119 start-stop-daemon --stop --quiet --pidfile $NMBDPID
6120 # Wait a little and remove stale PID file
6122 if [ -f $NMBDPID ] && ! ps h `cat $NMBDPID` > /dev/null
6124 # Stale PID file (nmbd was succesfully stopped),
6125 # remove it (should be removed by nmbd itself IMHO.)
6129 if [ "$RUN_MODE" != "inetd" ]; then
6130 log_progress_msg "smbd"
6131 start-stop-daemon --stop --quiet --pidfile $SMBDPID
6132 # Wait a little and remove stale PID file
6134 if [ -f $SMBDPID ] && ! ps h `cat $SMBDPID` > /dev/null
6136 # Stale PID file (nmbd was succesfully stopped),
6137 # remove it (should be removed by smbd itself IMHO.)
6146 log_daemon_msg "Reloading /etc/samba/smb.conf" "smbd only"
6148 start-stop-daemon --stop --signal HUP --pidfile $SMBDPID
6152 restart|force-reload)
6158 pidofproc -p $SMBDPID $DAEMON >/dev/null
6160 if [ $status -eq 0 ]; then
6161 log_success_msg "SMBD is running"
6163 log_failure_msg "SMBD is not running"
6168 echo "Usage: /etc/init.d/samba {start|stop|reload|restart|force-reload|status}"
6176 # Provides: sendsigs
6181 # Short-Description: Kill all remaining processes.
6185 PATH=/usr/sbin:/usr/bin:/sbin:/bin
6187 . /lib/lsb/init-functions
6191 if [ -e /var/run/sendsigs.omit ]; then
6192 for pid in $(cat /var/run/sendsigs.omit); do
6193 OMITPIDS="${OMITPIDS:+$OMITPIDS }-o $pid"
6197 if [ -d /var/run/sendsigs.omit.d/ ]; then
6198 for pidfile in /var/run/sendsigs.omit.d/*; do
6199 [ -f "$pidfile" ] || continue
6200 for pid in $(cat $pidfile); do
6201 OMITPIDS="${OMITPIDS:+$OMITPIDS }-o $pid"
6206 # Kill all processes.
6207 log_action_begin_msg "Terminating all remaining processes"
6208 killall5 -15 $OMITPIDS
6209 log_action_end_msg 0
6211 log_action_begin_msg "Sending all processes the KILL signal"
6212 killall5 -9 $OMITPIDS
6213 log_action_end_msg 0
6220 restart|reload|force-reload)
6221 echo "Error: argument '$1' not supported" >&2
6226 if which usplash_down >/dev/null; then
6231 echo "Usage: $0 start|stop" >&2
6240 # Required-Start: $local_fs killprocs
6244 # Short-Description: executed by init(8) upon entering runlevel 1 (single).
6249 . /lib/lsb/init-functions
6252 log_action_msg "Will now switch to single-user mode"
6260 restart|reload|force-reload)
6261 echo "Error: argument '$1' not supported" >&2
6268 echo "Usage: $0 start|stop" >&2
6274 # Provides: skeleton
6275 # Required-Start: $local_fs $remote_fs
6276 # Required-Stop: $local_fs $remote_fs
6277 # Default-Start: 2 3 4 5
6278 # Default-Stop: S 0 1 6
6279 # Short-Description: Example initscript
6280 # Description: This file should be used to construct scripts to be
6281 # placed in /etc/init.d.
6284 # Author: Foo Bar <foobar@baz.org>
6286 # Please remove the "Author" lines above and replace them
6287 # with your own name if you copy and modify this script.
6291 # PATH should only include /usr/* if it runs after the mountnfs.sh script
6292 PATH=/usr/sbin:/usr/bin:/sbin:/bin
6293 DESC="Description of the service"
6294 NAME=daemonexecutablename
6295 DAEMON=/usr/sbin/$NAME
6296 DAEMON_ARGS="--options args"
6297 PIDFILE=/var/run/$NAME.pid
6298 SCRIPTNAME=/etc/init.d/$NAME
6300 # Exit if the package is not installed
6301 [ -x "$DAEMON" ] || exit 0
6303 # Read configuration variable file if it is present
6304 [ -r /etc/default/$NAME ] && . /etc/default/$NAME
6306 # Load the VERBOSE setting and other rcS variables
6307 [ -f /etc/default/rcS ] && . /etc/default/rcS
6309 # Define LSB log_* functions.
6310 # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
6311 . /lib/lsb/init-functions
6314 # Function that starts the daemon/service
6319 # 0 if daemon has been started
6320 # 1 if daemon was already running
6321 # 2 if daemon could not be started
6322 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
6324 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
6327 # Add code here, if necessary, that waits for the process to be ready
6328 # to handle requests from services started subsequently which depend
6329 # on this one. As a last resort, sleep for some time.
6333 # Function that stops the daemon/service
6338 # 0 if daemon has been stopped
6339 # 1 if daemon was already stopped
6340 # 2 if daemon could not be stopped
6341 # other if a failure occurred
6342 start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
6344 [ "$RETVAL" = 2 ] && return 2
6345 # Wait for children to finish too if this is a daemon that forks
6346 # and if the daemon is only ever run from this initscript.
6347 # If the above conditions are not satisfied then add some other code
6348 # that waits for the process to drop all resources that could be
6349 # needed by services started subsequently. A last resort is to
6350 # sleep for some time.
6351 start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
6352 [ "$?" = 2 ] && return 2
6353 # Many daemons don't delete their pidfiles when they exit.
6359 # Function that sends a SIGHUP to the daemon/service
6363 # If the daemon can reload its configuration without
6364 # restarting (for example, when it is sent a SIGHUP),
6365 # then implement that here.
6367 start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
6373 [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
6376 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
6377 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
6381 [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
6384 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
6385 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
6388 #reload|force-reload)
6390 # If do_reload() is not implemented then leave this commented out
6391 # and leave 'force-reload' as an alias for 'restart'.
6393 #log_daemon_msg "Reloading $DESC" "$NAME"
6397 restart|force-reload)
6399 # If the "reload" option is implemented then remove the
6400 # 'force-reload' alias
6402 log_daemon_msg "Restarting $DESC" "$NAME"
6409 1) log_end_msg 1 ;; # Old process is still running
6410 *) log_end_msg 1 ;; # Failed to start
6420 #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
6421 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
6431 # Required-Start: $network $local_fs $remote_fs
6433 # Default-Start: 2 3 4 5
6434 # Default-Stop: 0 1 6
6435 # Short-Description: OpenBSD Secure Shell server
6440 # /etc/init.d/ssh: start and stop the OpenBSD "secure shell(tm)" daemon
6442 test -x /usr/sbin/sshd || exit 0
6443 ( /usr/sbin/sshd -\? 2>&1 | grep -q OpenSSH ) 2>/dev/null || exit 0
6446 if test -f /etc/default/ssh; then
6450 . /lib/lsb/init-functions
6452 if [ -n "$2" ]; then
6453 SSHD_OPTS="$SSHD_OPTS $2"
6456 # Are we running from init?
6458 ([ "$previous" ] && [ "$runlevel" ]) || [ "$runlevel" = S ]
6461 check_for_no_start() {
6462 # forget it if we're trying to start, and /etc/ssh/sshd_not_to_be_run exists
6463 if [ -e /etc/ssh/sshd_not_to_be_run ]; then
6464 if [ "$1" = log_end_msg ]; then
6467 if ! run_by_init; then
6468 log_action_msg "OpenBSD Secure Shell server not in use (/etc/ssh/sshd_not_to_be_run)"
6475 if [ ! -c /dev/null ]; then
6476 if [ "$1" = log_end_msg ]; then
6477 log_end_msg 1 || true
6479 if ! run_by_init; then
6480 log_action_msg "/dev/null is not a character device!"
6486 check_privsep_dir() {
6487 # Create the PrivSep empty dir if necessary
6488 if [ ! -d /var/run/sshd ]; then
6490 chmod 0755 /var/run/sshd
6495 if [ ! -e /etc/ssh/sshd_not_to_be_run ]; then
6496 /usr/sbin/sshd -t || exit 1
6501 if [ -e /var/run/sshd.pid ]; then
6502 PID="$(head -n1 /var/run/sshd.pid)"
6503 if [ -e "/proc/$PID/oom_adj" ]; then
6504 printf '%s' "$SSHD_OOM_ADJUST" >"/proc/$PID/oom_adj" || true
6509 export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
6516 log_daemon_msg "Starting OpenBSD Secure Shell server" "sshd"
6517 if start-stop-daemon --start --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then
6525 log_daemon_msg "Stopping OpenBSD Secure Shell server" "sshd"
6526 if start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/sshd.pid; then
6533 reload|force-reload)
6536 log_daemon_msg "Reloading OpenBSD Secure Shell server's configuration" "sshd"
6537 if start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd; then
6547 log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd"
6548 start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile /var/run/sshd.pid
6549 check_for_no_start log_end_msg
6550 check_dev_null log_end_msg
6551 if start-stop-daemon --start --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then
6562 log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd"
6564 start-stop-daemon --stop --quiet --retry 30 --pidfile /var/run/sshd.pid
6569 # old daemon stopped
6570 check_for_no_start log_end_msg
6571 check_dev_null log_end_msg
6572 if start-stop-daemon --start --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then
6579 # daemon not running
6580 log_progress_msg "(not running)"
6585 log_progress_msg "(failed to stop)"
6592 log_action_msg "Usage: /etc/init.d/ssh {start|stop|reload|force-reload|restart|try-restart}"
6599 # Provides: stop-bootlogd
6600 # Required-Start: $remote_fs
6602 # Default-Start: 1 2 3 4 5
6604 # Short-Description: Stop bootlogd
6605 # Description: See the bootlogd script
6609 DAEMON=/sbin/bootlogd
6611 [ -x "$DAEMON" ] || exit 0
6615 /etc/init.d/bootlogd stop
6617 stop|restart|force-reload)
6621 echo "Usage: $NAME {start|stop|restart|force-reload}" >&2
6629 # Provides: stop-bootlogd-single
6630 # Required-Start: $remote_fs
6634 # Short-Description: Stop bootlogd in single user mode
6635 # Description: See the bootlogd script
6638 PATH=/usr/sbin:/usr/bin:/sbin:/bin
6639 NAME=stop-bootlogd-single
6640 DAEMON=/sbin/bootlogd
6642 [ -x "$DAEMON" ] || exit 0
6646 if [ ! -e /proc/cmdline ] || grep -q '\<single\>' /proc/cmdline
6648 /etc/init.d/bootlogd stop
6651 stop|restart|force-reload)
6655 echo "Usage: $NAME {start|stop|restart|force-reload}" >&2
6662 # /etc/init.d/sysklogd: start the system log daemon.
6666 # Required-Start: $local_fs $time
6667 # Required-Stop: $local_fs $time
6668 # Should-Start: $network $named
6669 # Should-Stop: $network $named
6670 # Default-Start: S 1 2 3 4 5
6672 # Short-Description: System logger
6675 PATH=/bin:/usr/bin:/sbin:/usr/sbin
6677 pidfile=/var/run/syslogd.pid
6678 binpath=/sbin/syslogd
6680 test -x $binpath || exit 0
6682 # syslogd options should be set in /etc/default/syslogd
6685 # user to run syslogd as - this can overriden in /etc/default/syslogd
6688 test ! -r /etc/default/syslogd || . /etc/default/syslogd
6690 # allow ltsp to override
6691 test ! -r /etc/ltsp/syslogd || . /etc/ltsp/syslogd
6693 # Figure out under which user syslogd should be running as
6694 if echo ${SYSLOGD} | grep -q '^.*-u[[:space:]]*\([[:alnum:]]*\)[[:space:]]*.*$'
6696 # A specific user has been set on the command line, try to extract it.
6697 USER=$(echo ${SYSLOGD} | sed -e 's/^.*-u[[:space:]]*\([[:alnum:]]*\)[[:space:]]*.*$/\1/')
6699 # By default, run syslogd under the syslog user
6700 SYSLOGD="${SYSLOGD} -u ${USER}"
6703 # Unable to get the user under which syslogd should be running, stop.
6706 log_failure_msg "Unable to get syslog user"
6710 . /lib/lsb/init-functions
6714 # Only proceed if /dev/xconsole is used at all
6715 if ! grep -q '^[^#].*/dev/xconsole' /etc/syslog.conf
6720 if [ ! -e /dev/xconsole ]; then
6721 mknod -m 640 /dev/xconsole p
6723 chmod 0640 /dev/xconsole
6726 chown ${USER}:adm /dev/xconsole
6732 for l in `syslogd-listfiles -a`
6734 chown ${USER}:adm $l
6740 # No pidfile, probably no daemon present
6742 if [ ! -f $pidfile ]
6749 # No pid, probably no daemon present
6756 if [ ! -d /proc/$pid ]
6761 cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1`
6765 if [ "$cmd" != "$binpath" ]
6775 log_begin_msg "Starting system log daemon..."
6778 start-stop-daemon --start --quiet --pidfile $pidfile --name syslogd --startas $binpath -- $SYSLOGD
6782 log_begin_msg "Stopping system log daemon..."
6783 start-stop-daemon --stop --quiet --pidfile $pidfile --name syslogd
6786 reload|force-reload)
6787 log_begin_msg "Reloading system log daemon..."
6789 start-stop-daemon --stop --quiet --signal 1 --pidfile $pidfile --name syslogd
6793 log_begin_msg "Restarting system log daemon..."
6794 start-stop-daemon --stop --retry 5 --quiet --pidfile $pidfile --name syslogd
6796 start-stop-daemon --start --quiet --pidfile $pidfile --name syslogd --startas $binpath -- $SYSLOGD
6808 log_success_msg "Usage: /etc/init.d/sysklogd {start|stop|reload|restart|force-reload|reload-or-restart}"
6814 # init script for udev
6816 # Check the package is still installed
6817 [ -x /sbin/udevd ] || exit 0
6820 . /lib/lsb/init-functions
6826 # We need the uevent support introduced in 2.6.15, bail out if we
6827 # don't have it and fall back to a static /dev
6828 if [ ! -f /sys/class/mem/null/uevent ]; then
6829 if mountpoint -q /dev; then
6830 # uh-oh, initramfs made some kind of /dev, get rid of it
6831 umount -l /dev/.static/dev
6837 if ! mountpoint -q /dev; then
6838 # initramfs didn't mount /dev, so we'll need to do that
6839 mount -n --bind /dev /etc/udev
6840 mount -n -t tmpfs -o mode=0755 udev /dev
6841 mkdir -m 0700 -p /dev/.static/dev
6842 mount -n --move /etc/udev /dev/.static/dev
6845 # Copy over default device tree
6846 cp -a -f /lib/udev/devices/* /dev
6848 # It's all over netlink now
6849 if [ -e /proc/sys/kernel/hotplug ]; then
6850 echo "" > /proc/sys/kernel/hotplug
6854 log_begin_msg "Starting kernel event manager..."
6855 if start-stop-daemon --start --quiet --exec /sbin/udevd -- --daemon; then
6861 # This next bit can take a while
6862 if type usplash_write >/dev/null 2>&1; then
6863 usplash_write "TIMEOUT 360" ||:
6864 trap "usplash_write 'TIMEOUT 15' ||:" 0
6867 # Log things that trigger does
6868 /sbin/udevadm monitor -e >/dev/.udev.log &
6871 # Fix permissions and missing symlinks/programs for devices made in
6872 # initramfs, and catch up on everything we missed
6873 log_begin_msg "Loading hardware drivers..."
6874 /sbin/udevadm trigger
6875 if /sbin/udevadm settle; then
6881 # Kill the udev monitor again
6882 kill $UDEV_MONITOR_PID
6885 log_begin_msg "Stopping kernel event manager..."
6886 if start-stop-daemon --stop --quiet --oknodo --exec /sbin/udevd; then
6891 umount -l /dev/.static/dev
6895 cp -au /lib/udev/devices/* /dev
6897 log_begin_msg "Loading additional hardware drivers..."
6898 /sbin/udevadm trigger
6899 if /sbin/udevadm settle; then
6905 reload|force-reload)
6906 log_begin_msg "Reloading kernel event manager..."
6907 if start-stop-daemon --stop --signal 1 --exec /sbin/udevd; then
6914 echo "Usage: /etc/init.d/udev {start|stop|restart|reload|force-reload}"
6921 # init script to finish up udev
6923 # Check the package is still installed
6924 [ -x /sbin/udevd ] || exit 0
6927 . /lib/lsb/init-functions
6933 # Save udev log in /var/log/udev
6934 if [ -e /dev/.udev.log ]; then
6935 mv -f /dev/.udev.log /var/log/udev
6938 # Copy any rules generated while the root filesystem was read-only
6939 for file in /dev/.udev/tmp-rules--*; do
6940 dest=${file##*tmp-rules--}
6941 [ "$dest" = '*' ] && break
6942 cat $file >> /etc/udev/rules.d/$dest
6946 stop|restart|reload|force-reload)
6949 echo "Usage: /etc/init.d/udev {start|stop|restart|reload|force-reload}"
6957 # Provides: umountfs
6958 # Required-Start: umountnfs urandom
6960 # Default-Start: 0 6
6962 # Short-Description: Turn off swap and unmount all local file systems.
6966 PATH=/usr/sbin:/usr/bin:/sbin:/bin
6969 . /lib/lsb/init-functions
6973 # Print in order of decreasing length
6975 # Algorithm: Find and print longest argument, then call self
6976 # to print remaining arguments in order of decreasing length
6978 # This function runs at one tenth the speed of the sort program
6979 # but we use the function because we don't want to rely on any
6980 # programs in /usr/.
6982 # N.B.: Arguments must not be null and must not contain whitespace
6985 [ "$1" ] || return 0
6992 if [ "$ARGLENGTH" -gt "$ARGLENGTH_LONGEST" ]
6994 ARGLENGTH_LONGEST="$ARGLENGTH"
6995 ARGNUM_LONGEST="$ARGNUM"
6997 ARGNUM=$(($ARGNUM + 1))
6999 # The method of passing prevargs assumes that args can be
7000 # delimited with spaces
7003 while [ "$ARGNUM" -lt "$ARGNUM_LONGEST" ]
7005 PREVARGS="$PREVARGS $1"
7007 ARGNUM=$(($ARGNUM + 1))
7011 pioodl $PREVARGS "$@"
7016 exec 9<&0 </proc/mounts
7017 PROTECTED_MOUNTS="$(sed -n '0,/^\/[^ ]* \/ /p' /proc/mounts)"
7018 WEAK_MTPTS="" #be gentle, don't use force
7021 while read DEV MTPT FSTYPE REST
7023 echo "$PROTECTED_MOUNTS" | grep -qs "^$DEV $MTPT " && continue
7025 /|/proc|/dev|/.dev|/dev/pts|/dev/shm|/proc/*|/sys|/var/run|/var/lock)
7030 proc|procfs|linprocfs|devfs|sysfs|usbfs|usbdevfs|devpts|securityfs)
7034 if [ -d "$MTPT" ]; then
7035 TMPFS_MTPTS="$TMPFS_MTPTS $MTPT"
7039 REG_MTPTS="$REG_MTPTS $MTPT"
7040 if echo "$PROTECTED_MOUNTS" | grep -qs "^$DEV "; then
7041 WEAK_MTPTS="$WEAK_MTPTS $MTPT "
7050 # Make sure tmpfs file systems are umounted before turning off
7051 # swap, to avoid running out of memory if the tmpfs filesystems
7052 # use a lot of space.
7054 if [ "$TMPFS_MTPTS" ]
7056 if [ "$VERBOSE" = no ]
7058 log_action_begin_msg "Unmounting temporary filesystems"
7060 log_action_end_msg $?
7062 log_action_msg "Will now unmount temporary filesystems"
7063 umount -v $TMPFS_MTPTS
7067 log_success_msg "Done unmounting temporary filesystems."
7069 log_failure_msg "Unmounting temporary filesystems failed with error code ${ES}."
7077 if [ "$VERBOSE" = no ]
7079 log_action_begin_msg "Deactivating swap"
7080 swapoff -a >/dev/null
7081 log_action_end_msg $?
7083 log_action_msg "Will now deactivate swap"
7088 log_success_msg "Done deactivating swap."
7090 log_failure_msg "Swap deactivation failed with error code ${ES}."
7095 # Unmount local filesystems
7097 [ -z "$REG_MTPTS" ] && return
7098 [ "$VERBOSE" = no ] && log_action_begin_msg "Unmounting local filesystems"
7099 REG_MTPTS="$(pioodl $REG_MTPTS)"
7101 for MTPT in $REG_MTPTS; do
7102 if echo "$WEAK_MTPTS" | grep -qs " $MTPT "; then
7107 if [ "$VERBOSE" = no ]; then
7108 umount $FORCE -r -d $MTPT
7110 [ "$ES" != 0 ] && [ "$ES2" = 0 ] && ES2=$ES
7112 log_action_begin_msg "Unmounting local filesystem $MTPT"
7113 umount $FORCE -v -r -d $MTPT
7115 if [ "$ES" = 0 ]; then
7116 log_success_msg "Done unmounting local filesystem $MTPT."
7118 log_failure_msg "Unmounting local filesystem $MTPT failed with error code $ES."
7122 [ "$VERBOSE" = no ] && log_action_end_msg $ES2
7129 restart|reload|force-reload)
7130 echo "Error: argument '$1' not supported" >&2
7137 echo "Usage: $0 start|stop" >&2
7145 # Provides: umountnfs
7146 # Required-Start: sendsigs
7150 # Short-Description: Unmount all network filesystems except the root file system.
7151 # Description: Also unmounts all virtual filesystems (proc, devfs, devpts,
7152 # usbfs, sysfs) that are not mounted at the top level.
7155 PATH=/usr/sbin:/usr/bin:/sbin:/bin
7156 KERNEL="$(uname -s)"
7157 RELEASE="$(uname -r)"
7160 . /lib/lsb/init-functions
7162 case "${KERNEL}:${RELEASE}" in
7163 Linux:[01].*|Linux:2.[01].*)
7166 Linux:2.[23].*|Linux:2.4.?|Linux:2.4.?-*|Linux:2.4.10|Linux:2.4.10-*)
7175 # Write a reboot record to /var/log/wtmp before unmounting
7178 # Remove bootclean flag files (precaution against symlink attacks)
7179 rm -f /tmp/.clean /var/lock/.clean /var/run/.clean
7181 [ "$VERBOSE" = no ] || log_action_begin_msg "Unmounting remote and non-toplevel virtual filesystems"
7184 # Make list of points to unmount in reverse order of their creation
7187 exec 9<&0 </proc/mounts
7190 while read DEV MTPT FSTYPE REST
7193 /|/proc|/dev|/dev/pts|/dev/shm|/proc/*|/sys|/var/run|/var/lock)
7198 nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs)
7201 proc|procfs|linprocfs|devfs|devpts|usbfs|usbdevfs|sysfs)
7215 [ "$VERBOSE" = no ] || log_action_end_msg $ES
7222 restart|reload|force-reload)
7223 echo "Error: argument '$1' not supported" >&2
7230 echo "Usage: umountnfs.sh [start|stop]" >&2
7238 # Provides: umountroot
7239 # Required-Start: umountfs
7240 # Required-Stop: umountfs
7243 # Short-Description: Mount the root filesystem read-only.
7249 . /lib/lsb/init-functions
7253 [ "$VERBOSE" = no ] || log_action_begin_msg "Mounting $MTPT filesystem read-only"
7255 [ "$(uname -s)" = "GNU/kFreeBSD" ] && MOUNT_FORCE_OPT=-f
7257 # mount -n -o remount,ro /
7258 # will act on a bind mount of / if there is one.
7259 # See #339023 and the comment in checkroot.sh
7260 mount $MOUNT_FORCE_OPT -n -o remount,ro -t dummytype dummydev $MTPT 2>/dev/null \
7261 || mount $MOUNT_FORCE_OPT -n -o remount,ro dummydev $MTPT 2>/dev/null \
7262 || mount $MOUNT_FORCE_OPT -n -o remount,ro $MTPT
7264 [ "$VERBOSE" = no ] || log_action_end_msg $ES
7268 # These directories must exist on the root filesystem as they are
7269 # targets for system mountpoints. We've just unmounted all other
7270 # filesystems, so either they are mounted now (in which case the
7271 # mount point exists) or we can make the mountpoint.
7272 for dir in /proc /sys /var/run /var/lock; do
7273 mkdir -p $dir || true
7275 exec 9<&0 < /proc/mounts
7279 while read DEV MTPT FSTYPE REST
7282 /proc|/dev|/.dev|/dev/pts|/dev/shm|/proc/*|/sys|/var/run|/var/lock)
7287 proc|procfs|linprocfs|devfs|sysfs|usbfs|usbdevfs|devpts|tmpfs)
7303 restart|reload|force-reload)
7304 echo "Error: argument '$1' not supported" >&2
7311 echo "Usage: $0 start|stop" >&2
7319 # skeleton example file to build /etc/init.d/ scripts.
7320 # This file should be used to construct scripts for /etc/init.d.
7322 # Written by Miquel van Smoorenburg <miquels@cistron.nl>.
7323 # Modified for Debian
7324 # by Ian Murdock <imurdock@gnu.ai.mit.edu>.
7326 # Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl
7329 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
7330 DAEMON=/usr/sbin/uniconfd
7332 DESC="UniConf daemon"
7334 test -x $DAEMON || exit 0
7336 # Include uniconf defaults if available
7337 if [ -f /etc/default/uniconfd ] ; then
7338 . /etc/default/uniconfd
7341 DAEMON_OPTS="$UNICONFD_OPTS $UNICONFD_MOUNTS"
7345 echo -n "Starting $DESC: "
7346 start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
7347 --make-pidfile --background \
7348 --exec $DAEMON -- -f $DAEMON_OPTS
7349 if [ "$?" != "0" ]; then ERR=$?; echo; exit $ERR; fi
7353 echo -n "Stopping $DESC: "
7354 start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
7356 if [ "$?" != "0" ]; then ERR=$?; echo; exit $ERR; fi
7361 # If the daemon can reload its config files on the fly
7362 # for example by sending it SIGHUP, do it here.
7364 # If the daemon responds to changes in its config file
7365 # directly anyway, make this a do-nothing entry.
7367 # echo "Reloading $DESC configuration files."
7368 # start-stop-daemon --stop --signal 1 --quiet --pidfile \
7369 # /var/run/$NAME.pid --exec $DAEMON
7371 restart|force-reload)
7373 # If the "reload" option is implemented, move the "force-reload"
7374 # option to the "reload" entry above. If not, "force-reload" is
7375 # just the same as "restart".
7377 echo -n "Restarting $DESC: "
7378 start-stop-daemon --stop --quiet --pidfile \
7379 /var/run/$NAME.pid --exec $DAEMON || exit $?
7381 start-stop-daemon --start --quiet --pidfile \
7382 /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
7383 if [ "$?" != "0" ]; then ERR=$?; echo; exit $ERR; fi
7388 # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
7389 echo "Usage: $N {start|stop|restart|force-reload}" >&2
7398 # Required-Start: $local_fs
7399 # Required-Stop: $local_fs
7402 # Short-Description: Save and restore random seed between restarts.
7403 # Description This script saves the random seed between restarts.
7404 # It is called from the boot, halt and reboot scripts.
7407 [ -c /dev/urandom ] || exit 0
7409 PATH=/usr/sbin:/usr/bin:/sbin:/bin
7410 SAVEDFILE=/var/lib/urandom/random-seed
7412 [ -f /proc/sys/kernel/random/poolsize ] && POOLSIZE="$(cat /proc/sys/kernel/random/poolsize)"
7415 . /lib/lsb/init-functions
7419 [ "$VERBOSE" = no ] || log_action_begin_msg "Initializing random number generator"
7420 # Load and then save $POOLSIZE bytes,
7421 # which is the size of the entropy pool
7422 if [ -f "$SAVEDFILE" ]
7424 # Handle locally increased pool size
7425 SAVEDSIZE="$(find "$SAVEDFILE" -printf "%s")"
7426 if [ "$SAVEDSIZE" -gt "$POOLSIZE" ]
7428 [ -w /proc/sys/kernel/random/poolsize ] && echo $POOLSIZE > /proc/sys/kernel/random/poolsize
7431 cat "$SAVEDFILE" >/dev/urandom
7435 dd if=/dev/urandom of=$SAVEDFILE bs=$POOLSIZE count=1 >/dev/null 2>&1
7438 [ "$VERBOSE" = no ] || log_action_end_msg $ES
7441 # Carry a random seed from shut-down to start-up;
7442 # see documentation in linux/drivers/char/random.c
7443 [ "$VERBOSE" = no ] || log_action_begin_msg "Saving random seed"
7445 dd if=/dev/urandom of=$SAVEDFILE bs=$POOLSIZE count=1 >/dev/null 2>&1
7447 [ "$VERBOSE" = no ] || log_action_end_msg $ES
7449 restart|reload|force-reload)
7450 echo "Error: argument '$1' not supported" >&2
7454 echo "Usage: urandom start|stop" >&2
7462 test -x /usr/sbin/vbetool || exit 0
7465 . /lib/lsb/init-functions
7467 test -f /etc/default/rcS && . /etc/default/rcS
7468 test -f /etc/default/acpi-support && . /etc/default/acpi-support
7469 test -f /usr/share/acpi-support/device-funcs && . /usr/share/acpi-support/device-funcs
7473 if laptop-detect > /dev/null; then
7477 if [ x$LAPTOP != xtrue ]; then
7482 log_begin_msg "Saving VESA state..."
7483 if [ "$SAVE_VBE_STATE" = "true" ]; then
7484 if [ "$VERBOSE" = no ]; then
7485 if ! vbetool vbestate save > $VBESTATE 2>/dev/null; then
7490 if ! vbetool vbestate save > $VBESTATE ; then
7505 # Required-Start: $network $local_fs
7509 # Short-Description: Wait for critical network file systems to be mounted
7510 # Description: Network file systems are mounted in the background when
7511 # interfaces are brought up; this script waits for
7512 # those among them which are critical for booting to be
7513 # mounted before carrying on.
7514 # Specifically, it will wait for file systems mounted
7515 # on /usr, /usr/*, /var, /var/*
7516 # This script WILL NOT wait on other network file which are
7517 # mounted elsewhere!
7520 [ -f /etc/default/rcS ] && . /etc/default/rcS
7521 . /lib/lsb/init-functions
7524 [ -f /etc/fstab ] || return
7526 # Read through fstab line by line, building a list of networked
7527 # file systems mounted on /usr* or /var*
7528 # Wait up to a fixed period of time for these file systems to mount
7531 exec 9<&0 </etc/fstab
7534 while read DEV MTPT FSTYPE OPTS REST
7542 noauto|*,noauto|noauto,*|*,noauto,*)
7547 nfs|nfs4|smbfs|cifs|coda|ncp|ncpfs|ocfs2|gfs)
7554 /usr/local|/usr/local/*)
7557 waitnfs="$waitnfs $MTPT"
7560 waitnfs="$waitnfs $MTPT"
7567 # Try mounting all networked filesystems here, just before waiting for
7568 # them; background this call so as not to block startup sequence
7569 /lib/init/mountall-net-fs &
7571 # Wait for each path, the timeout is for all of them as that's
7572 # really the maximum time we have to wait anyway
7574 for mountpt in $waitnfs; do
7575 log_action_begin_msg "Waiting for $mountpt"
7577 while ! mountpoint -q $mountpt; do
7580 TIMEOUT=$(( $TIMEOUT - 1 ))
7581 if [ $TIMEOUT -le 0 ]; then
7582 log_action_end_msg 1
7587 if [ $TIMEOUT -gt 0 ]; then
7588 log_action_end_msg 0
7597 restart|reload|force-reload)
7598 echo "Error: argument '$1' not supported" >&2
7604 echo "Usage: $0 start|stop" >&2
7614 # Required-Start: $network $local_fs $remote_fs
7615 # Required-Stop: $network $local_fs $remote_fs
7616 # Default-Start: 2 3 4 5
7617 # Default-Stop: 0 1 6
7618 # Short-Description: start Winbind daemon
7622 PATH=/sbin:/bin:/usr/sbin:/usr/bin
7624 [ -r /etc/default/winbind ] && . /etc/default/winbind
7626 DAEMON=/usr/sbin/winbindd
7627 PIDDIR=/var/run/samba
7629 # clear conflicting settings from the environment
7632 # See if the daemon is there
7633 test -x $DAEMON || exit 0
7635 . /lib/lsb/init-functions
7639 log_daemon_msg "Starting the Winbind daemon" "winbind"
7641 mkdir -p /var/run/samba/winbindd_privileged || return 1
7642 chgrp winbindd_priv $PIDDIR/winbindd_privileged/ || return 1
7643 chmod 0750 $PIDDIR/winbindd_privileged/ || return 1
7644 start-stop-daemon --start --quiet --oknodo --exec $DAEMON -- $WINBINDD_OPTS
7650 log_daemon_msg "Stopping the Winbind daemon" "winbind"
7651 start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
7655 restart|force-reload)
7656 $0 stop && sleep 2 && $0 start
7660 echo "Usage: /etc/init.d/winbind {start|stop|restart|force-reload}"
7667 # Provides: wpa-ifupdown
7668 # Required-Start: $network
7669 # Required-Stop: $network
7674 # Short-Description: Stop wpa_supplicant processes started via ifupdown
7675 # Description: Run ifdown on interfaces authenticated via
7676 # wpa_supplicant. Sendsigs terminates wpa_supplicant
7677 # processes before networking is stopped causing each
7678 # network interface authenticated via a wpa_supplicant
7679 # daemon to be terminated abrubtly.
7682 PATH=/usr/sbin:/usr/bin:/sbin:/bin
7684 test -d /var/run || exit 0
7686 test -x /sbin/ifdown || exit 0
7688 . /lib/lsb/init-functions
7690 stop_wpa_action () {
7691 test -x /sbin/wpa_action || return
7693 IFACES=$(find /var/run -maxdepth 1 -type f -name 'wpa_action.*.pid' -printf '%P\n' | cut -d'.' -f2)
7694 if test -n "$IFACES"; then
7695 log_daemon_msg "Stopping wpa_action roaming interfaces"
7696 for iface in $IFACES; do
7697 log_progress_msg "$iface"
7698 # wpa_action executes /sbin/ifdown
7699 wpa_action "$iface" stop >/dev/null 2>&1
7705 stop_wpa_supplicant () {
7707 IFACES=$(find /var/run -maxdepth 1 -type f -name 'wpa_supplicant.*.pid' -printf '%P\n' | cut -d'.' -f2)
7708 if test -n "$IFACES"; then
7709 log_daemon_msg "Stopping wpa_supplicant interfaces"
7710 for iface in $IFACES; do
7711 log_progress_msg "$iface"
7712 ifdown $iface >/dev/null 2>&1
7719 start|restart|force-reload)
7727 echo "Usage: $0 {start|stop|restart|force-reload}" >&2
7734 # /etc/init.d/x11-common: set up the X server and ICE socket directories
7736 # Provides: x11-common
7737 # Required-Start: $local_fs $remote_fs
7738 # Required-Stop: $local_fs $remote_fs
7739 # Should-Start: $named
7740 # Should-Stop: $named
7747 PATH=/bin:/usr/bin:/sbin:/usr/sbin
7748 SOCKET_DIR=/tmp/.X11-unix
7749 ICE_DIR=/tmp/.ICE-unix
7751 . /lib/lsb/init-functions
7752 if [ -f /etc/default/rcS ]; then
7757 # Restore file security context (SELinux).
7758 if which restorecon >/dev/null 2>&1; then
7763 set_up_socket_dir () {
7764 if [ "$VERBOSE" != no ]; then
7765 log_begin_msg "Setting up X server socket directory $SOCKET_DIR..."
7767 if [ -e $SOCKET_DIR ] && [ ! -d $SOCKET_DIR ]; then
7768 mv $SOCKET_DIR $SOCKET_DIR.$$
7770 mkdir -p $SOCKET_DIR
7771 chown 0:0 $SOCKET_DIR
7772 chmod 1777 $SOCKET_DIR
7773 do_restorecon $SOCKET_DIR
7774 [ "$VERBOSE" != no ] && log_end_msg 0 || return 0
7778 if [ "$VERBOSE" != no ]; then
7779 log_begin_msg "Setting up ICE socket directory $ICE_DIR..."
7781 if [ -e $ICE_DIR ] && [ ! -d $ICE_DIR ]; then
7782 mv $ICE_DIR $ICE_DIR.$$
7787 do_restorecon $ICE_DIR
7788 [ "$VERBOSE" != no ] && log_end_msg 0 || return 0
7792 if [ -d $ICE_DIR ] && [ -d $SOCKET_DIR ]; then
7805 restart|reload|force-reload)
7806 /etc/init.d/x11-common start
7817 log_success_msg "Usage: /etc/init.d/x11-common {start|stop|status|restart|reload|force-reload}"
7824 # vim:set ai et sts=2 sw=2 tw=0: