aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrc.d/init.d/functions11
-rwxr-xr-xrc.d/init.d/halt22
-rwxr-xr-xrc.d/init.d/network6
-rwxr-xr-xrc.d/init.d/nfsfs2
-rwxr-xr-xrc.d/init.d/random9
-rwxr-xr-xrc.d/rc12
-rwxr-xr-xrc.d/rc.sysinit2
-rw-r--r--src/initlog.c1
-rw-r--r--src/process.c1
9 files changed, 35 insertions, 31 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
index 525ecc6d..c3b42a65 100755
--- a/rc.d/init.d/functions
+++ b/rc.d/init.d/functions
@@ -79,18 +79,18 @@ killproc() {
[ $BOOTUP != "color" ] && echo -n $base
if [ "$notset" = 1 ] ; then
# TERM first, then KILL if not dead
- kill -TERM $pid
+ kill -TERM $pid && success -n "$base shutdown" || failure -n "$base shutdown"
usleep 100000
if ps h $pid >/dev/null 2>&1 ; then
sleep 1
- if ps h $pid >/dev/null 2>&1
+ if ps h $pid >/dev/null 2>&1 ; then
sleep 3
- kill -KILL $pid && success "$base shutdown" || failure "$base shutdown"
+ kill -KILL $pid && success -n "$base shutdown" || failure -n "$base shutdown"
fi
fi
# use specified level only
else
- kill $killlevel $pid && success "$base shutdown" || failure "$base shutdown"
+ kill $killlevel $pid && success -n "$base shutdown" || failure -n "$base shutdown"
fi
else
failure -n "$base shutdown"
@@ -263,6 +263,3 @@ confirm() {
;;
esac
}
-
-
-
diff --git a/rc.d/init.d/halt b/rc.d/init.d/halt
index 3d6df5cc..61eab7b3 100755
--- a/rc.d/init.d/halt
+++ b/rc.d/init.d/halt
@@ -11,6 +11,14 @@
# Set the path.
PATH=/sbin:/bin:/usr/bin:/usr/sbin
+. /etc/rc.d/init.d/functions
+
+runcmd() {
+ echo -n $1
+ shift
+ $* && echo_success -n || echo_failure -n
+}
+
# See how we were called.
case "$0" in
*halt)
@@ -30,22 +38,22 @@ esac
# Kill all processes.
[ "${BASH+bash}" = bash ] && enable kill
-action "Sending all processes the TERM signal..." kill -15 -1
+runcmd "Sending all processes the TERM signal..." kill -15 -1
sleep 5
-action "Sending all processes the KILL signal.." kill -9 -1
+runcmd "Sending all processes the KILL signal.." kill -9 -1
# Write to wtmp file before unmounting /var
halt -w
# Turn off swap, then unmount file systems.
-action "Turning off swap and accounting" swapoff -a
+runcmd "Turning off swap and accounting" swapoff -a
[ -x /sbin/accton ] && /sbin/accton
-action "Unmounting file systems" umount -a -f
+runcmd "Unmounting file systems" umount -a -f
mount -n -o remount,ro /
# turn off raid
if [ -x /sbin/raidstop -a -f /etc/raidtab ]; then
- action "Turning off RAID" /sbin/raidstop -a
+ runcmd "Turning off RAID" /sbin/raidstop -a
fi
# Remount read only anything that's left mounted.
@@ -58,9 +66,7 @@ done
echo "$message"
if [ -f /fastboot ]; then
echo "On the next boot fsck will be skipped."
-elif [ -f /forcefsck ];
+elif [ -f /forcefsck ]; then
echo "On the next boot fsck will be forced."
fi
eval $command -i -d -p
-
-
diff --git a/rc.d/init.d/network b/rc.d/init.d/network
index 9b01c324..93f86480 100755
--- a/rc.d/init.d/network
+++ b/rc.d/init.d/network
@@ -57,7 +57,8 @@ ipv4_forward_set ()
fi
if [ $value != `cat /proc/sys/net/ipv4/ip_forward` ]; then
- action -n "$message" echo "$value" > /proc/sys/net/ipv4/ip_forward
+ action -n "$message" /bin/true
+ echo "$value" > /proc/sys/net/ipv4/ip_forward
fi
fi
fi
@@ -95,7 +96,8 @@ case "$1" in
;;
esac
./ifdown ifcfg-lo
- action -n "Disabling IPv4 packet forwarding" echo 0 > /proc/sys/net/ipv4/ip_forward
+ action -n "Disabling IPv4 packet forwarding" /bin/true
+ echo 0 > /proc/sys/net/ipv4/ip_forward
rm -f /var/lock/subsys/network
;;
status)
diff --git a/rc.d/init.d/nfsfs b/rc.d/init.d/nfsfs
index f4789781..9b828248 100755
--- a/rc.d/init.d/nfsfs
+++ b/rc.d/init.d/nfsfs
@@ -28,12 +28,10 @@ case "$1" in
start)
action -n "Mounting remote filesystems" mount -a -t nfs
touch /var/lock/subsys/nfsfs
- echo
;;
stop)
action -n "Unmounting remote filesystems" umount -a -t nfs
rm -f /var/lock/subsys/nfsfs
- echo
;;
status)
if [ -f /proc/mounts ] ; then
diff --git a/rc.d/init.d/random b/rc.d/init.d/random
index 3375141b..27f2abd4 100755
--- a/rc.d/init.d/random
+++ b/rc.d/init.d/random
@@ -1,4 +1,3 @@
-#!/bin/sh
#
# random Script to snapshot random state and reload it at boot time.
#
@@ -19,11 +18,11 @@ case "$1" in
# Carry a random seed from start-up to start-up
# Load and then save 512 bytes, which is the size of the entropy pool
if [ -f $random_seed ]; then
- cmd="cat $random_seed >/dev/urandom"
+ cat $random_seed >/dev/urandom
else
- cmd="touch $random_seed"
+ touch $random_seed
fi
- action "Initializing random number generator" $cmd
+ action -n "Initializing random number generator" /bin/true
chmod 600 $random_seed
dd if=/dev/urandom of=$random_seed count=1 bs=512 2>/dev/null
touch /var/lock/subsys/random
@@ -34,7 +33,7 @@ case "$1" in
# Save 512 bytes, which is the size of the entropy pool
touch $random_seed
chmod 600 $random_seed
- action "Saving random seed" dd if=/dev/urandom of=$random_seed count=1 bs=512 2>/dev/null
+ action -n "Saving random seed" dd if=/dev/urandom of=$random_seed count=1 bs=512 2>/dev/null
rm -f /var/lock/subsys/random
;;
diff --git a/rc.d/rc b/rc.d/rc
index d84b219e..449df6cb 100755
--- a/rc.d/rc
+++ b/rc.d/rc
@@ -51,10 +51,10 @@ if [ -d /etc/rc.d/rc$runlevel.d ]; then
[ ! -f /var/lock/subsys/${subsys}.init ] && continue
# Bring the subsystem down.
- if [ egrep -q "(killproc|action)" $i ]; then
+ if egrep -q "(killproc |action )" $i ; then
$i stop
else
- action "Stopping $subsys" $i stop
+ action -n "Stopping $subsys" $i stop
fi
done
@@ -90,10 +90,14 @@ if [ -d /etc/rc.d/rc$runlevel.d ]; then
}
# Bring the subsystem up.
- if [ egrep -q "(daemon|action)" $i ]; then
+ if egrep -q "(daemon |action )" $i ; then
$i start
else
- action "Starting $subsys" $i start
+ if [ "$subsys" = "halt" ] || [ "$subsys" = "reboot" ]; then
+ $i start
+ else
+ action -n "Starting $subsys" $i start
+ fi
fi
done
fi
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit
index af93e42b..ab962b70 100755
--- a/rc.d/rc.sysinit
+++ b/rc.d/rc.sysinit
@@ -331,5 +331,3 @@ dmesg > /var/log/dmesg
# Feed entropy into the entropy pool
/etc/rc.d/init.d/random start
-
-sleep 10
diff --git a/src/initlog.c b/src/initlog.c
index 96b5af87..cd787fcf 100644
--- a/src/initlog.c
+++ b/src/initlog.c
@@ -121,7 +121,6 @@ int logLine(struct logInfo *logEnt) {
if (logEntries>0) {
for (x=0;x<logEntries;x++) {
openlog(logData[x].cmd,0,logData[x].fac);
- printf("flushing %s\n",logData[x].line);
syslog(logData[x].pri,"%s",logData[x].line);
closelog();
}
diff --git a/src/process.c b/src/process.c
index 48f3b314..860d9452 100644
--- a/src/process.c
+++ b/src/process.c
@@ -176,6 +176,7 @@ int monitor(char *cmdname, int pid, int numfds, int *fds, int reexec, int quiet)
buf=calloc(2048,sizeof(char));
do {
x=read(outpipe[0],buf,2048);
+ write(1,"\n",1);
write(1,buf,x);
buf=calloc(2048,sizeof(char));
} while (x==2048);