summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
Diffstat (limited to 'sbin')
-rwxr-xr-xsbin/init.d/functions11
-rwxr-xr-xsbin/init.d/mouse7
-rwxr-xr-xsbin/rc.M16
3 files changed, 23 insertions, 11 deletions
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
}
diff --git a/sbin/rc.M b/sbin/rc.M
index df6ef16..840d3fe 100755
--- a/sbin/rc.M
+++ b/sbin/rc.M
@@ -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