# udev
# Udev cold-plugging script
+DAEMON=/sbin/udevd
+DAEMON_DESC=UDEV
+DAEMON_OPTS="--daemon"
+
# Source functions library
source /etc/rc.d/init.d/functions
echo "" > /sys/kernel/uevent_helper &&
# Start the udev daemon to continually watch for, and act on uevents
- /sbin/udevd --daemon
+ ${DAEMON} ${DAEMON_OPTS}
}
# See how we were called
# The reason we don't write to mtab is because we don't ever
# want /dev to be unavailable (such as by `umount -a').
cmd_run_log_box "Mounting /dev in tmpfs" mount -n -t tmpfs -o mode=0755 udev /dev
-
cmd_run_log_box "Copying static /dev entries" cp --preserve=all --recursive --remove-destination /lib/udev/devices/* /dev
-
cmd_run_log_box "Setting permissons on /dev/shm" chmod 1777 /dev/shm
- cmd_run_log_box_warn "Starting udevd" udev_start
+ cmd_run_log_box_warn "${DAEMON_DESC} start" udev_start
cmd_run_log_box "Performing Coldplugging" udev_coldplug
;;
-
+
*)
echo "Usage: $0 {start}"
exit ${EXIT_CODE_FAILURE}
bootscript_add_rcsysinit mountfs 35 95
bootscript_add_rcsysinit swap 40 94
bootscript_add_rcsysinit cleanfs 45 00
-bootscript_add_rcsysinit setclock 60 92
+bootscript_add_rcsysinit setclock 60 91
# rc0.d
bootscript_add_manual 0 sendsignals 95 00
# Source functions library
source /etc/rc.d/init.d/functions
-DAEMON=acpid
-DAEMON_DESC="ACPI"
-DAEMON_OPTS="--netlink --logevents"
-
log_script_name "$0 $*"
+DAEMON=/usr/sbin/acpid
+DAEMON_DESC="ACPI daemon"
+DAEMON_OPTS="--netlink --logevents"
+
case "$1" in
start)
- cmd_run_log_box_warn "${DAEMON_DESC} daemon start" loadproc /usr/sbin/${DAEMON} ${DAEMON_OPTS}
+ cmd_run_log_box_warn "${DAEMON_DESC} start" loadproc ${DAEMON} ${DAEMON_OPTS}
;;
stop)
- cmd_run_log_box_warn "${DAEMON_DESC} daemon stop" killproc ${DAEMON}
+ cmd_run_log_box_warn "${DAEMON_DESC} stop" killproc ${DAEMON}
;;
status)
# Load global network parameters
source /etc/sysconfig/network/network-parameters
+DAEMON=/usr/sbin/dhcpd
+DAEMON_DESC="DHCP server"
+DAEMON_OPTS="-q ${DHCP_SERVER_IF}"
+
if [ -z "${DHCP_SERVER_IF}" ]; then
# DHCP server is not enabled
msg_log "DHCP server disabled in '/etc/sysconfig/network/network-parameters'"
# See how we were called
case "$1" in
start)
- cmd_run_log_box_warn "DHCP server start" loadproc /usr/sbin/dhcpd -q ${DHCP_SERVER_IF}
+ cmd_run_log_box_warn "${DAEMON_DESC} start" loadproc ${DAEMON} ${DAEMON_OPTS}
;;
-
+
stop)
- cmd_run_log_box_warn "DHCP server stop" killproc /usr/sbin/dhcpd
+ cmd_run_log_box_warn "${DAEMON_DESC} stop" killproc ${DAEMON}
;;
-
+
restart)
$0 stop
sleep 1
;;
status)
- statusproc /usr/sbin/dhcpd
+ statusproc ${DAEMON}
;;
-
+
*)
echo "Usage: $0 {restart|start|status|stop}"
exit ${EXIT_CODE_FAILURE}
--- /dev/null
+#!/bin/sh
+
+# klogd
+
+# Source functions library
+source /etc/rc.d/init.d/functions
+
+log_script_name "$0 $*"
+
+DAEMON=/sbin/klogd
+DAEMON_DESC="Kernel log daemon"
+DAEMON_OPTS="-k /boot/System-$(uname -r).map"
+
+case "$1" in
+ start)
+ cmd_run_log_box_warn "${DAEMON_DESC} start" loadproc ${DAEMON} ${DAEMON_OPTS}
+ ;;
+
+ stop)
+ cmd_run_log_box_warn "${DAEMON_DESC} stop" killproc ${DAEMON}
+ ;;
+
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+
+ status)
+ statusproc klogd
+ ;;
+
+ *)
+ echo "Usage: $0 {start|stop|restart|status}"
+ exit ${EXIT_CODE_FAILURE}
+ ;;
+esac
+
+exit $?
+++ /dev/null
-#!/bin/sh
-
-# syslogd
-
-# Source functions library
-source /etc/rc.d/init.d/functions
-
-log_script_name "$0 $*"
-
-SYSLOGD_OPTS="-r"
-KLOGD_OPTS="-k /boot/System-$(uname -r).map"
-
-case "$1" in
- start)
- cmd_run_log_box_warn "Starting system log daemon" loadproc syslogd ${SYSLOGD_OPTS}
- cmd_run_log_box_warn "Starting kernel log daemon" loadproc klogd ${KLOGD_OPTS}
- ;;
-
- stop)
- cmd_run_log_box_warn "Stopping kernel log daemon" killproc klogd
- cmd_run_log_box_warn "Stopping system log daemon" killproc syslogd
- ;;
-
- reload)
- cmd_run_nolog_box "Reloading system log daemon configuration file" reloadproc syslogd 1
- ;;
-
- restart)
- $0 stop
- sleep 1
- $0 start
- ;;
-
- status)
- statusproc syslogd
- statusproc klogd
- ;;
-
- *)
- echo "Usage: $0 {start|stop|reload|restart|status}"
- exit ${EXIT_CODE_FAILURE}
- ;;
-
-esac
-
-exit $?
--- /dev/null
+#!/bin/sh
+
+# syslogd
+
+# Source functions library
+source /etc/rc.d/init.d/functions
+
+log_script_name "$0 $*"
+
+DAEMON=/sbin/syslogd
+DAEMON_DESC="System log daemon"
+DAEMON_OPTS="-r"
+
+case "$1" in
+ start)
+ cmd_run_log_box_warn "${DAEMON_DESC} start" loadproc ${DAEMON} ${DAEMON_OPTS}
+ ;;
+
+ stop)
+ cmd_run_log_box_warn "${DAEMON_DESC} stop" killproc ${DAEMON}
+ ;;
+
+ reload)
+ cmd_run_nolog_box "${DAEMON_DESC} reload configuration file" reloadproc ${DAEMON} 1
+ ;;
+
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+
+ status)
+ statusproc ${DAEMON}
+ ;;
+
+ *)
+ echo "Usage: $0 {start|stop|reload|restart|status}"
+ exit ${EXIT_CODE_FAILURE}
+ ;;
+esac
+
+exit $?
sed -i -e "s!^\(export PATH=\).*tools.*!\1/bin:/usr/bin:/sbin:/usr/sbin!" /etc/rc.d/init.d/functions
# Copying boot scripts
-STAGE2_BOOTSCRIPTS="ifdown ifup keyboard mountnetfs network sysklogd"
+STAGE2_BOOTSCRIPTS="ifdown ifup keyboard mountnetfs network syslogd klogd"
for bootscript in ${STAGE2_BOOTSCRIPTS}; do
install -m755 bootscripts/${bootscript} /etc/rc.d/init.d
done
# rcsysinit.d
bootscript_add_rcsysinit sysklogd 50 93
+bootscript_add_rcsysinit klogd 51 92
bootscript_add_rcsysinit keyboard 55 00
# rc3.d
log_script_name "$0 $*"
+DAEMON=/usr/sbin/fcron
+DAEMON_DESC="fcron daemon"
+DAEMON_OPTS="-b -c /etc/fcron/fcron.conf"
+
fcron_start()
{
/etc/fcron/configure
- loadproc fcron -b -c /etc/fcron/fcron.conf
+ loadproc ${DAEMON} ${DAEMON_OPTS}
}
# See how we were called.
case "$1" in
start)
- cmd_run_log_box_warn "Starting fcron" fcron_start
+ cmd_run_log_box_warn "${DAEMON_DESC} start" fcron_start
;;
-
+
stop)
- cmd_run_log_box_warn "Stopping fcron" killproc fcron
+ cmd_run_log_box_warn "${DAEMON_DESC} stop" killproc ${DAEMON}
;;
-
+
reload)
- cmd_run_log_box_warn "reloading fcron" reloadproc fcron
+ cmd_run_log_box_warn "${DAEMON_DESC} reload" reloadproc ${DAEMON}
;;
-
+
restart)
$0 stop
sleep 1
$0 start
;;
-
+
status)
- statusproc fcron
+ statusproc ${DAEMON}
;;
-
+
*)
echo "Usage: $0 {start|stop|reload|restart|status}"
exit ${EXIT_CODE_FAILURE}
log_script_name "$0 $*"
+DAEMON=/usr/sbin/named
+DAEMON_DESC="BIND server"
+DAEMON_OPTS="-u named -t /home/named -c /etc/named.conf"
+
init_resolver()
{
echo "search ${DOMAINNAME}" > /etc/resolv.conf &&
case $1 in
start)
- cmd_run_log_box_warn "Starting named" loadproc /usr/sbin/named -u named -t /home/named -c /etc/named.conf &&
+ cmd_run_log_box_warn "${DAEMON_DESC} start" loadproc ${DAEMON} ${DAEMON_OPTS} &&
init_resolver
;;
-
+
stop)
- cmd_run_log_box_warn "Stopping named" killproc named
+ cmd_run_log_box_warn "${DAEMON_DESC} stop" killproc ${DAEMON}
;;
-
+
restart)
$0 stop
sleep 1
;;
reload)
- cmd_run_log_box "Reloading named" /usr/sbin/rndc -c /etc/rndc.conf reload
+ cmd_run_log_box "${DAEMON_DESC} reload" /usr/sbin/rndc -c /etc/rndc.conf reload
;;
-
+
status)
- statusproc named
+ statusproc ${DAEMON}
;;
-
+
*)
echo "Usage: $0 {start|stop|restart|status}"
exit ${EXIT_CODE_FAILURE}
log_script_name "$0 $*"
+DAEMON=/usr/sbin/slapd
+DAEMON_DESC="LDAP server"
+DAEMON_OPTS=""
+
piddir=/srv/ldap/run
case "$1" in
start)
- cmd_run_log_box_warn "Starting LDAP Server" loadproc slapd
+ cmd_run_log_box_warn "${DAEMON_DESC} start" loadproc ${DAEMON}
;;
-
+
stop)
- cmd_run_log_box_warn "Stopping LDAP Server" killproc_path slapd ${piddir}
+ cmd_run_log_box_warn "${DAEMON_DESC} stop" killproc_path ${DAEMON} ${piddir}
;;
-
+
restart)
$0 stop
sleep 1
;;
status)
- statusproc_path slapd ${piddir}
+ statusproc_path ${DAEMON} ${piddir}
;;
-
+
*)
echo "Usage: $0 {start|stop|restart|status}"
exit ${EXIT_CODE_FAILURE}
# Load global network parameters
source /etc/sysconfig/network/network-parameters
+DAEMON=/sbin/portmap
+DAEMON_DESC="RPC port mapper"
+DAEMON_OPTS=""
+
# Check if NFS server must be enabled
#if [ "x${NFS_SERVER_ENA}" != "xyes" -a "x${NFS_SERVER_ENA}" != "xYes"
#-a "x${NFS_SERVER_ENA}" != "xYES" ]; then
# See how we were called
case "$1" in
start)
- cmd_run_log_box_warn "portmap start" loadproc portmap
+ cmd_run_log_box_warn "${DAEMON_DESC} start" loadproc ${DAEMON} ${DAEMON_OPTS}
;;
stop)
- cmd_run_log_box_warn "portmap stop" killproc portmap
+ cmd_run_log_box_warn "${DAEMON_DESC} stop" killproc ${DAEMON}
;;
reload)
- reloadproc portmap
+ reloadproc ${DAEMON}
;;
restart)
;;
status)
- statusproc portmap
+ statusproc ${DAEMON}
;;
*)
log_script_name "$0 $*"
+DAEMON=/usr/sbin/saslauthd
+DAEMON_DESC="SASL authentication daemon"
+DAEMON_OPTS="-a shadow"
+
case "$1" in
start)
- cmd_run_log_box_warn "SASL daemon start" loadproc /usr/sbin/saslauthd -a shadow
+ cmd_run_log_box_warn "${DAEMON_DESC} start" loadproc ${DAEMON} ${DAEMON_OPTS}
;;
stop)
- cmd_run_log_box_warn "SASL daemon stop" killproc saslauthd
+ cmd_run_log_box_warn "${DAEMON_DESC} stop" killproc ${DAEMON}
;;
-
+
status)
- statusproc saslauthd
+ statusproc ${DAEMON}
;;
-
+
restart)
$0 stop
sleep 1
log_script_name "$0 $*"
-SSHD="/usr/sbin/sshd -4"
+DAEMON="/usr/sbin/sshd"
+DAEMON_DESC="SSH server"
+DAEMON_OPTS="-4"
# Check if SSH server is desired
if [ "x${SSH_SERVER_ENA}" != "xyes" -a "x${SSH_SERVER_ENA}" != "xYes" -a "x${SSH_SERVER_ENA}" != "xYES" ]; then
if [ $? -ne 0 ]; then
exit ${EXIT_CODE_FAILURE}
else
- loadproc ${SSHD}
+ loadproc ${DAEMON} ${DAEMON_OPTS}
fi
}
# See how we were called
case "$1" in
start)
- cmd_run_log_box_warn "Starting sshd" sshd_start
+ cmd_run_log_box_warn "${DAEMON_DESC} start" sshd_start
;;
stop)
- cmd_run_log_box_warn "Stopping sshd" killproc sshd
+ cmd_run_log_box_warn "${DAEMON_DESC} stop" killproc ${DAEMON}
;;
reload)
- reloadproc sshd
+ reloadproc ${DAEMON}
;;
restart)
;;
status)
- statusproc sshd
+ statusproc ${DAEMON}
;;
*)
# Source functions library
source /etc/rc.d/init.d/functions
-DAEMON=xinetd
+DAEMON=/usr/sbin/xinetd
+DAEMON_DESC="xinetd daemon"
+DAEMON_OPTS=""
case "$1" in
start)
- cmd_run_log_box_warn "Starting xinetd daemon" loadproc ${DAEMON}
+ cmd_run_log_box_warn "${DAEMON_DESC} start" loadproc ${DAEMON} ${DAEMON_OPTS}
;;
-
+
stop)
- cmd_run_log_box_warn "Stopping xinetd daemon" killproc ${DAEMON}
+ cmd_run_log_box_warn "${DAEMON_DESC} stop" killproc ${DAEMON}
;;
-
+
restart)
$0 stop
sleep 1
$0 start
;;
-
+
status)
statusproc ${DAEMON}
;;
-
+
*)
echo "Usage: $0 {start|stop|restart|status}"
exit ${EXIT_CODE_FAILURE}
;;
-
esac
exit $?
log_script_name "$0 $*"
+DAEMON=/usr/bin/dbus-daemon
+DAEMON_DESC="D-BUS Messagebus daemon"
+DAEMON_OPTS="--config-file=/etc/dbus-1/system.conf"
+
dbus_start() {
- if statusproc dbus-daemon | grep -q "not running"; then
+ if statusproc ${DAEMON} | grep -q "not running"; then
if [ -f /var/run/dbus/pid ]; then
rm /var/run/dbus/pid
fi
echo "Already running..."
return ${EXIT_CODE_WARNING}
fi
-
- loadproc /usr/bin/dbus-daemon --config-file=/etc/dbus-1/system.conf
+
+ loadproc ${DAEMON} ${DAEMON_OPTS}
return $?
}
case "$1" in
start)
- cmd_run_log_box_warn "D-Bus Messagebus Daemon start" dbus_start
+ cmd_run_log_box_warn "${DAEMON_DESC} start" dbus_start
;;
stop)
- cmd_run_log_box_warn "D-Bus Messagebus Daemon stop" killproc dbus-daemon &&
+ cmd_run_log_box_warn "${DAEMON_DESC} stop" killproc ${DAEMON} &&
rm /var/run/dbus/pid &&
rm /var/run/dbus/system_bus_socket
;;
-
+
status)
- statusproc dbus-daemon
+ statusproc ${DAEMON}
;;
-
+
restart)
$0 stop
sleep 1
log_script_name "$0 $*"
+DAEMON=/usr/sbin/hald
+DAEMON_DESC="HAL daemon"
+DAEMON_OPTS="--use-syslog"
+
case "$1" in
start)
- cmd_run_log_box_warn "HAL Daemon start" loadproc /usr/sbin/hald --use-syslog
+ cmd_run_log_box_warn "${DAEMON_DESC} start" loadproc ${DAEMON} ${DAEMON_DESC}
;;
-
+
stop)
- cmd_run_log_box_warn "HAL Daemon stop" killproc /usr/sbin/hald
+ cmd_run_log_box_warn "${DAEMON_DESC} stop" killproc ${DAEMON}
;;
-
+
status)
- statusproc hald
+ statusproc ${DAEMON}
;;
-
+
restart)
$0 stop
sleep 1
$0 start
;;
-
+
*)
echo "Usage: $0 {restart|start|status|stop}"
exit ${EXIT_CODE_FAILURE}