[Linux-decnet-user] linux-decnet on SuSE Linux
Brought to you by:
chrissie_c,
ph3-der-loewe
|
From: Larry B. <ba...@us...> - 2004-04-15 20:59:51
|
Below is the DECnet startup/shutdown script, /etc/init.d/decnet, for
SuSE Linux Professional 9.0. (The RPM creates
/etc/init.d/init.d/decnet on SuSE. You can delete it, and the unused
/etc/init.d/init.d directory.)
Also, the interface MAC address is set differently. In Red Hat,
MACADDR= is in /etc/sysconfig/network-scripts/ifcfg-eth0. In SuSE,
LLADDR= is in /etc/sysconfig/network/ifcfg-eth0.
Larry Baker
US Geological Survey
650-329-5608
ba...@us...
#!/bin/sh
#
# /etc/init.d/decnet
#
# Starts/Stops DECnet processes on SuSE Linux
#
# chkconfig: - 09 91
# description: DECnet.
# processname: dnetd
# config: /etc/decnet.conf
#
# You can install it using the following command:
#
# chkconfig decnet on
#
### BEGIN INIT INFO
# Provides: decnet
# Required-Start: $network
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: DECnet dnetd daemon
### END INIT INFO
#
#
------------------------------------------------------------------------
-----
#
# Daemons to start. You may remove the ones you don't want
#
daemons="dnetd phoned"
# Prefix for where the progs are installed. "make install" puts them
# in /usr, the RPM has them in /usr
prefix=/usr
#
# Interfaces to set the MAC address of. By default only the default
interface
# in /etc/decnet.conf will be set. If you want to set up more interfaces
# for DECnet, then add them here.
#
extra_interfaces=""
# Source LSB init functions
# providing start_daemon, killproc, pidofproc,
# log_success_msg, log_failure_msg and log_warning_msg.
# This is currently not used by UnitedLinux based distributions and
# not needed for init scripts for UnitedLinux only. If it is used,
# the functions from rc.status should not be sourced or used.
#. /lib/lsb/init-functions
# Shell functions sourced from /etc/rc.status:
# rc_check check and set local and overall rc status
# rc_status check and set local and overall rc status
# rc_status -v be verbose in local rc status and clear it
afterwards
# rc_status -v -r ditto and clear both the local and overall rc
status
# rc_status -s display "skipped" and exit with status 3
# rc_status -u display "unused" and exit with status 3
# rc_failed set local and overall rc status to failed
# rc_failed <num> set local and overall rc status to <num>
# rc_reset clear both the local and overall rc status
# rc_exit exit appropriate to overall rc status
# rc_active checks whether a service is activated by
symlinks
# rc_splash arg sets the boot splash screen to arg (if active)
. /etc/rc.status
# Reset status of this service
rc_reset
# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - generic or unspecified error
# 2 - invalid or excess argument(s)
# 3 - unimplemented feature (e.g. "reload")
# 4 - user had insufficient privileges
# 5 - program is not installed
# 6 - program is not configured
# 7 - program is not running
# 8--199 - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)
#
# Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart
# with force-reload (in case signaling is not supported) are
# considered a success.
#
# Set up some variables.
#
startcmd="startproc"
stopcmd="killproc"
statuscmd="checkproc"
case $1 in
start)
if [ ! -f /etc/decnet.conf ]
then
echo "DECnet not started as it is not configured."
rc_failed 6
rc_exit
fi
# If there is no DECnet in the kernel then try to load it.
if [ ! -f /proc/net/decnet ]
then
modprobe decnet
if [ ! -f /proc/net/decnet ]
then
echo "DECnet not started as it is not in the kernel."
rc_failed 5
rc_exit
fi
fi
echo -n "Starting DECnet..."
NODE=`grep executor /etc/decnet.conf| awk '{print $2}'`
echo "$NODE" > /proc/sys/net/decnet/node_address
CCT=`grep executor /etc/decnet.conf | awk '{print $6}'`
echo "$CCT" > /proc/sys/net/decnet/default_device
$prefix/sbin/setether $NODE $CCT $extra_interfaces
for i in $daemons
do
$startcmd $prefix/sbin/$i
rc_status
done
rc_status -v
;;
stop)
echo -n "Stopping DECnet..."
for i in $daemons
do
$stopcmd $prefix/sbin/$i
rc_status
done
rc_status -v
;;
restart|reload|force-reload)
echo -n "Restarting DECnet..."
for i in $daemons
do
$stopcmd $prefix/sbin/$i
rc_status
$startcmd $prefix/sbin/$i
rc_status
done
rc_status -v
;;
status)
echo -n "Checking DECnet..."
for i in $daemons
do
$statuscmd $prefix/sbin/$i
rc_status
done
rc_status -v
;;
*)
echo "Usage $0 {start|stop|restart|force-reload|status}"
;;
esac
rc_exit
|