From 341270673b437826fd4cd8f43056b176b85e061c Mon Sep 17 00:00:00 2001 From: Philip Homburg Date: Wed, 15 Aug 2007 12:56:35 +0000 Subject: [PATCH] mfs no longer needs access to VIRCOPY, Added rs.inet. Start inet with rs.inet as the restart script. --- etc/Makefile | 5 +++- etc/drivers.conf | 1 - etc/rs.inet | 67 ++++++++++++++++++++++++++++++++++++++++++++++++ etc/usr/rc | 2 +- 4 files changed, 72 insertions(+), 3 deletions(-) create mode 100755 etc/rs.inet diff --git a/etc/Makefile b/etc/Makefile index 004f1a28d..814fd0ae7 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -1,7 +1,10 @@ ETC=/etc/ USRETC=/usr/etc/ -FILES1=fstab group hostname.file inet.conf motd.install mtab passwd profile protocols rc services termcap ttytab utmp rc.cd binary_sizes binary_sizes.big binary_sizes.xxl rc.rescue syslog.conf rc.daemons.dist rs.single make.conf drivers.conf +FILES1=fstab group hostname.file inet.conf motd.install mtab passwd profile \ + protocols rc services termcap ttytab utmp rc.cd binary_sizes \ + binary_sizes.big binary_sizes.xxl rc.rescue syslog.conf \ + rc.daemons.dist rs.inet rs.single make.conf drivers.conf FILES2=shadow FILES3=daily dhcptags.conf rc diff --git a/etc/drivers.conf b/etc/drivers.conf index 957b251a3..24edd49a6 100644 --- a/etc/drivers.conf +++ b/etc/drivers.conf @@ -176,7 +176,6 @@ driver mfs { system EXIT # 2 - VIRCOPY # 15 TIMES # 25 SAFECOPYFROM # 31 SAFECOPYTO # 32 diff --git a/etc/rs.inet b/etc/rs.inet new file mode 100755 index 000000000..c0d1058c9 --- /dev/null +++ b/etc/rs.inet @@ -0,0 +1,67 @@ +#!/bin/sh + +# 'Recovery' script that doesn't. This script is to be used for drivers that +# should not be restarted. Instead, the scripts configures the driver 'down'. + +kill_by_name() +{ + label="$1" + pid=`ps ax | grep "$label" | grep -v grep | + sed 's,[ ]*\([0-9]*\).*,\1,` + if [ X"$pid" = X ] + then + return 1 # No such process + fi + echo "killing pid $pid for $label" + kill -9 $pid +} + +daemonize() +{ + # Function to start a daemon, if it exists. + local IFS=':' + local name="$1" + test "$1" = tcpd && name="$2" + + for dir in $PATH + do + if [ -f "$dir/$1" ] + then + + # check if this service is disabled at the boot monitor. + if disabled $name; then return; fi + + echo -n " $name" + "$@" & + return + fi + done +} + +disabled() +{ + ifs="$IFS"; IFS=, + for skip in `sysenv disable` + do + if [ "$skip" = "$1" ] + then + IFS="$ifs"; unset ifs + return 0 + fi + done + IFS="$ifs"; unset ifs + return 1 +} + +exec > /dev/console +echo "Arguments: $@" + +kill_by_name dhcpd +kill_by_name nonamed +kill_by_name syslogd +sleep 1 +service restart "$1" +sleep 1 +daemonize dhcpd +daemonize nonamed -L +daemonize syslogd diff --git a/etc/usr/rc b/etc/usr/rc index e41e3d7e3..e9f52a966 100644 --- a/etc/usr/rc +++ b/etc/usr/rc @@ -100,7 +100,7 @@ start) eval up $driver $arg -period 5HZ fi done - up inet + up inet -script /etc/rs.inet up printer -dev /dev/lp -period 10HZ echo . -- 2.44.0