diff options
author | Willy Tarreau <w@1wt.eu> | 2006-07-16 15:09:42 +0200 |
---|---|---|
committer | Willy Tarreau <willy@wtap.(none)> | 2006-07-26 11:59:36 +0200 |
commit | 5a62166d3029d70f62af1f39e76994318f107e95 (patch) | |
tree | b3bbe062a75d46fc60527855eaa423d59d6be77f | |
parent | [RELEASE] init-scripts-0.3.2 (diff) | |
download | init-scripts-0.3.3.tar.gz |
[RELEASE] init-scripts-0.3.3v0.3.3
-rw-r--r-- | ChangeLog | 4 | ||||
-rwxr-xr-x | sbin/init.d/functions | 11 | ||||
-rwxr-xr-x | sbin/init.d/mouse | 7 | ||||
-rwxr-xr-x | sbin/rc.M | 16 |
4 files changed, 26 insertions, 12 deletions
@@ -1,6 +1,8 @@ 2003/02/18 - création de /var/state (utilisé par dhcp par exemple) -- correction de mouse : utilise /usr/sbin/gpm +- correction de mouse : utilise /usr/sbin/gpm et redirige std* vers /dev/null +- functions : do_stop_with_pidfile supprime les fichiers de pid restants (gpm...) +- rc.M : cesse de lancer cron et atd, ce n'est pas à lui de le faire. - rectification de rc.S : bash ne teste pas l'état R/W des filesystems, donc on crée des fichiers temporaires. De plus, tentative coûte que coûte de créer /tmp. - dans rc.S, en cas d'erreur, on remonte tout en R/O au lieu du sulogin qui stoppe diff --git a/sbin/init.d/functions b/sbin/init.d/functions index 88ebbfc..9216872 100755 --- a/sbin/init.d/functions +++ b/sbin/init.d/functions @@ -330,6 +330,8 @@ function do_stop_with_pidfile { if [ $FORCE_START_STOP -eq 0 ]; then if ! [ -r "$pidfile" ] || ! read pid REPLY <"$pidfile" || ! [ -L /proc/$pid/cwd ]; then echo "# Process $pname${instname:+[$instname]} already stopped (according to $pidfile)${pids:+, but check pids : $pids}" + # ensure that we remove stale files + [ -e "$pidfile" ] && echo "Removing stale pid file" && rm -f "$pidfile" return 0 fi fi @@ -342,9 +344,10 @@ function do_stop_with_pidfile { echo "# Stopping $pname${instname:+[$instname]} (pid $pid according to $pidfile) ..." declare -F fct_pre_stop >/dev/null && fct_pre_stop $pname $instname - kill -CONT $pid; kill -$STOP_FIRST_WITH $pid ; set -- 0 1 2 3 + kill -CONT $pid >/dev/null 2>&1 ; kill -$STOP_FIRST_WITH $pid >/dev/null 2>&1 + set -- 0 1 2 3 while [ -L /proc/$pid/cwd -a $# -gt 0 ] ; do sleep $1 ; shift ; done - [ -L /proc/$pid/cwd ] && { kill -9 $pid ; sleep 1 ; } + [ -L /proc/$pid/cwd ] && { kill -9 $pid >/dev/null 2>&1; sleep 1 ; } [ -L /proc/$pid/cwd ] && { echo " ==> stop $pname${instname:+[$instname]} Failed." ; return 1; } if [ -e "$pidfile" ]; then rm -f "$pidfile"; fi declare -F fct_post_stop >/dev/null && fct_post_stop $pname $instname @@ -387,8 +390,8 @@ function do_stop { REPLY=$retry; retry=0 while [ "$REPLY" ]; do retry=$[$retry+1] - if [ $retry -le 3 ]; then kill -CONT $REPLY && kill -$STOP_FIRST_WITH $REPLY || break; sleep $retry - elif [ $retry -gt 3 ]; then kill -9 $REPLY || break; sleep 1 + if [ $retry -le 3 ]; then kill -CONT $REPLY >/dev/null 2>&1 && kill -$STOP_FIRST_WITH $REPLY >/dev/null 2>&1 || break; sleep $retry + elif [ $retry -gt 3 ]; then kill -9 $REPLY >/dev/null 2>&1 || break; sleep 1 else break; fi REPLY=`ps ho pid $REPLY` done diff --git a/sbin/init.d/mouse b/sbin/init.d/mouse index 6ac43d7..c45aae7 100755 --- a/sbin/init.d/mouse +++ b/sbin/init.d/mouse @@ -9,6 +9,13 @@ option procname reserved_option gpm option cmdline reserved_option '$bin -t $opt_type -m $opt_device' option pidfile reserved_option /var/run/gpm.pid +# gpm is buggy, it doesn't close its std* before forking, so the startup +# script hang at boot time because it hogs the terminal. +function fct_pre_start { + #exec 10>&0 11>&1 12>&2 + exec </dev/null >&0 2>&0 +} + function fct_pre_stop { $cmdline -k >/dev/null 2>&1 } @@ -37,16 +37,18 @@ echo "Starting Multi-user (`date`)" | tee -a $LOG ip link set dev lo up ip addr add 127.0.0.1/8 dev lo +# Cron should be moved to a proper service script + # Starting 'crond' if exist -if [ -x /usr/sbin/crond ] ; then - if [ ! -d /var/spool/cron/crontabs ] ; then mkdir -p /var/spool/cron/crontabs ; fi - crond -fi +#if [ -x /usr/sbin/crond ] ; then +# if [ ! -d /var/spool/cron/crontabs ] ; then mkdir -p /var/spool/cron/crontabs ; fi +# crond +#fi # Starting 'atd' if exist -if [ -x /usr/sbin/atd ] ; then - atd -fi +#if [ -x /usr/sbin/atd ] ; then +# atd +#fi # Sourcing base configuration if [ -x /etc/startup.rc ] ; then |