Browse Source

Add rc.d(8) script for the system daemons that are restartable.

From now on rc(8) is going to call these scripts to start them up on boot
in the same order than before.
In addition the inetd and rwhod variables in rc.conf are deprecated so that
inetd_flags and rwhod_flags should be used. The old flags are still going
to be used for some time to allow users to switch.
There are more rc modifications to come later so let's put this in so
we can base more work on this.
It is important to mention that you can still keep using rc.local just
like the way you did before, and we have no intention to remove that either.
I'd also like to thank ajacoutot@, halex@, sthen@ and schwarze@ for working
on this with me.
OPENBSD_5_0
robert 13 years ago
parent
commit
5223656147
47 changed files with 543 additions and 207 deletions
  1. +10
    -1
      src/etc/Makefile
  2. +32
    -201
      src/etc/rc
  3. +9
    -3
      src/etc/rc.conf
  4. +11
    -0
      src/etc/rc.d/apmd
  5. +11
    -0
      src/etc/rc.d/bgpd
  6. +15
    -0
      src/etc/rc.d/bootparamd
  7. +9
    -0
      src/etc/rc.d/cron
  8. +15
    -0
      src/etc/rc.d/dhcpd
  9. +11
    -0
      src/etc/rc.d/dhcrelay
  10. +11
    -0
      src/etc/rc.d/dvmrpd
  11. +11
    -0
      src/etc/rc.d/ftpd
  12. +11
    -0
      src/etc/rc.d/ftpproxy
  13. +9
    -0
      src/etc/rc.d/hostapd
  14. +9
    -0
      src/etc/rc.d/hotplugd
  15. +15
    -0
      src/etc/rc.d/httpd
  16. +11
    -0
      src/etc/rc.d/identd
  17. +9
    -0
      src/etc/rc.d/ifstated
  18. +17
    -0
      src/etc/rc.d/iked
  19. +9
    -0
      src/etc/rc.d/inetd
  20. +17
    -0
      src/etc/rc.d/isakmpd
  21. +9
    -0
      src/etc/rc.d/ldapd
  22. +15
    -0
      src/etc/rc.d/ldattach
  23. +11
    -0
      src/etc/rc.d/ldpd
  24. +9
    -0
      src/etc/rc.d/lpd
  25. +15
    -0
      src/etc/rc.d/mopd
  26. +9
    -0
      src/etc/rc.d/mrouted
  27. +11
    -0
      src/etc/rc.d/named
  28. +9
    -0
      src/etc/rc.d/nsd
  29. +11
    -0
      src/etc/rc.d/ntpd
  30. +15
    -0
      src/etc/rc.d/rarpd
  31. +9
    -0
      src/etc/rc.d/rbootd
  32. +2
    -2
      src/etc/rc.d/rc.subr
  33. +11
    -0
      src/etc/rc.d/relayd
  34. +11
    -0
      src/etc/rc.d/ripd
  35. +9
    -0
      src/etc/rc.d/route6d
  36. +11
    -0
      src/etc/rc.d/rtadvd
  37. +11
    -0
      src/etc/rc.d/rtsold
  38. +9
    -0
      src/etc/rc.d/rwhod
  39. +11
    -0
      src/etc/rc.d/sasyncd
  40. +11
    -0
      src/etc/rc.d/sendmail
  41. +9
    -0
      src/etc/rc.d/sensorsd
  42. +9
    -0
      src/etc/rc.d/smtpd
  43. +11
    -0
      src/etc/rc.d/snmpd
  44. +9
    -0
      src/etc/rc.d/sshd
  45. +24
    -0
      src/etc/rc.d/syslogd
  46. +11
    -0
      src/etc/rc.d/timed
  47. +9
    -0
      src/etc/rc.d/watchdogd

+ 10
- 1
src/etc/Makefile View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.296 2011/07/06 18:32:58 miod Exp $
# $OpenBSD: Makefile,v 1.297 2011/07/06 18:55:36 robert Exp $
TZDIR= /usr/share/zoneinfo
LOCALTIME= Canada/Mountain
@ -30,6 +30,13 @@ BIN1+= wsconsctl.conf
# -rw-rw-r--
BIN2= motd
# -r-xr-xr-x
RCDAEMONS= apmd bgpd bootparamd cron dhcpd dhcrelay dvmrpd ftpd ftpproxy \
hostapd hotplugd httpd identd ifstated iked inetd isakmpd ldapd \
ldattach ldpd lpd mopd mrouted named nsd ntpd rarpd rbootd relayd \
ripd route6d rtadvd rtsold rwhod sasyncd sendmail sensorsd smtpd \
snmpd sshd syslogd timed watchdogd
MISETS= base${OSrev}.tgz comp${OSrev}.tgz \
man${OSrev}.tgz game${OSrev}.tgz etc${OSrev}.tgz
@ -249,6 +256,8 @@ distribution-etc-root-var: distrib-dirs
${DESTDIR}/etc/sudoers
cd rc.d; \
${INSTALL} -c -o root -g wheel -m 644 rc.subr \
${DESTDIR}/etc/rc.d && \
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 555 ${RCDAEMONS} \
${DESTDIR}/etc/rc.d
distribution:


+ 32
- 201
src/etc/rc View File

@ -1,4 +1,4 @@
# $OpenBSD: rc,v 1.352 2011/04/22 06:08:14 ajacoutot Exp $
# $OpenBSD: rc,v 1.353 2011/07/06 18:55:36 robert Exp $
# System startup script run by init on autoboot
# or after single-user.
@ -142,6 +142,17 @@ fill_baddynamic()
}
}
start_daemon()
{
local _n;
for _n; do
eval _do=\${${_n}_flags}
if [ X"${_do}" != X"NO" ]; then
/etc/rc.d/${_n} start
fi
done
}
# End subroutines
stty status '^T'
@ -340,26 +351,9 @@ rm -f /var/spool/uucp/STST/*
# save a copy of the boot messages
dmesg >/var/run/dmesg.boot
echo 'starting system logger'
rm -f /dev/log
if [ X"${httpd_flags}" != X"-u" ]; then
rm -f /var/www/dev/log
syslogd_flags="${syslogd_flags} -a /var/www/dev/log"
fi
if [ X"${named_flags}" != X"NO" ]; then
rm -f /var/named/dev/log
syslogd_flags="${syslogd_flags} -a /var/named/dev/log"
fi
if [ X"${nsd_flags}" != X"NO" ]; then
rm -f /var/nsd/dev/log
syslogd_flags="${syslogd_flags} -a /var/nsd/dev/log"
fi
if [ -d /var/empty ]; then
rm -f /var/empty/dev/log
mkdir -p -m 0555 /var/empty/dev
syslogd_flags="${syslogd_flags} -a /var/empty/dev/log"
fi
syslogd ${syslogd_flags}
echo -n 'starting system logger: '
start_daemon syslogd
echo '.'
if [ X"${pf}" != X"NO" ]; then
ifconfig pflog0 create >/dev/null 2>&1
@ -381,13 +375,11 @@ if [ X"${named_flags}" != X"NO" ]; then
echo failed.
fi
fi
echo 'starting named'; named $named_flags
fi
if [ X"${nsd_flags}" != X"NO" ]; then
echo 'starting nsd'; nsd $nsd_flags
fi
echo -n 'starting name service daemons:'
start_daemon named nsd
echo '.'
if [ ! -f /etc/isakmpd/private/local.key ]; then
echo -n "openssl: generating new isakmpd/iked RSA key... "
@ -409,23 +401,9 @@ if [ ! -f /etc/iked/private/local.key ]; then
cp /etc/isakmpd/local.pub /etc/iked/local.pub
fi
if [ X"${isakmpd_flags}" != X"NO" ]; then
if [ X"${sasyncd_flags}" != X"NO" ]; then
isakmpd_flags="-S ${isakmpd_flags}"
fi
echo 'starting isakmpd'; isakmpd ${isakmpd_flags}
fi
if [ X"${iked_flags}" != X"NO" ]; then
if [ X"${sasyncd_flags}" != X"NO" ]; then
iked_flags="-S ${iked_flags}"
fi
echo 'starting iked'; iked ${iked_flags}
fi
if [ X"${sasyncd_flags}" != X"NO" ]; then
echo 'starting sasyncd'; sasyncd ${sasyncd_flags}
fi
echo -n 'starting IPsec daemons:'
start_daemon isakmpd iked sasyncd
echo '.'
if [ X"${ipsec}" != X"NO" ]; then
if [ -f ${ipsec_rules} ]; then
@ -493,17 +471,8 @@ if [ X"${rdate_flags}" != X"NO" ]; then
echo -n ' rdate'; rdate -s ${rdate_flags}
fi
if [ X"${timed_flags}" != X"NO" ]; then
echo -n ' timed'; timed $timed_flags
fi
if [ X"${ldattach_flags}" != X"NO" -a -n "${ldattach_flags}" ]; then
echo -n ' ldattach'; ldattach ${ldattach_flags}
fi
start_daemon timed ldattach ntpd
if [ X"${ntpd_flags}" != X"NO" ]; then
echo -n ' ntpd'; ntpd $ntpd_flags
fi
echo '.'
mount -a
@ -619,83 +588,23 @@ fi
/usr/bin/ssh-keygen -A
echo -n starting network daemons:
if [ X"${sshd_flags}" != X"NO" ]; then
echo -n ' sshd'; /usr/sbin/sshd ${sshd_flags}
fi
if [ X"${snmpd_flags}" != X"NO" ]; then
echo -n ' snmpd'; /usr/sbin/snmpd $snmpd_flags
fi
if [ X"${ldpd_flags}" != X"NO" ]; then
echo -n ' ldpd'; /usr/sbin/ldpd $ldpd_flags
fi
if [ X"${ripd_flags}" != X"NO" ]; then
echo -n ' ripd'; /usr/sbin/ripd $ripd_flags
fi
if [ X"${mrouted_flags}" != X"NO" ]; then
echo -n ' mrouted'; mrouted $mrouted_flags
fi
if [ X"${dvmrpd_flags}" != X"NO" ]; then
echo -n ' dvmrpd'; /usr/sbin/dvmrpd $dvmrpd_flags
fi
if [ X"${ospfd_flags}" != X"NO" ]; then
echo -n ' ospfd'; /usr/sbin/ospfd $ospfd_flags
fi
if [ X"${ospf6d_flags}" != X"NO" ]; then
echo -n ' ospf6d'; /usr/sbin/ospf6d $ospf6d_flags
fi
if [ X"${bgpd_flags}" != X"NO" ]; then
echo -n ' bgpd'; /usr/sbin/bgpd $bgpd_flags
fi
if [ X"${ifstated_flags}" != X"NO" ]; then
echo -n ' ifstated'; ifstated $ifstated_flags
fi
if [ X"${relayd_flags}" != X"NO" ]; then
echo -n ' relayd'; /usr/sbin/relayd $relayd_flags
fi
if [ X"${dhcpd_flags}" != X"NO" -a -f /etc/dhcpd.conf ]; then
touch /var/db/dhcpd.leases
echo -n ' dhcpd'; /usr/sbin/dhcpd ${dhcpd_flags}
fi
echo -n 'starting network daemons:'
if [ X"${dhcrelay_flags}" != X"NO" ]; then
echo -n ' dhcrelay'; /usr/sbin/dhcrelay $dhcrelay_flags
fi
start_daemon sshd snmpd ldpd ripd bgpd ifstated relayd dhcpd \
dhcrelay mrouted dvmrpd
if ifconfig lo0 inet6 >/dev/null 2>&1; then
fw=`sysctl -n net.inet6.ip6.forwarding`
if [ X"${fw}" = X"0" ]; then
if [ X"${rtsold_flags}" != X"NO" ]; then
echo -n ' rtsold'
/usr/sbin/rtsold ${rtsold_flags}
fi
start_daemon rtsold
else
if [ X"${route6d_flags}" != X"NO" ]; then
echo -n ' route6d'
/usr/sbin/route6d ${route6d_flags}
fi
if [ X"${rtadvd_flags}" != X"NO" ]; then
echo -n ' rtadvd'
/usr/sbin/rtadvd ${rtadvd_flags}
fi
start_daemon route6d
start_daemon rtadvd
fi
fi
if [ X"${hostapd_flags}" != X"NO" ]; then
echo -n ' hostapd'; /usr/sbin/hostapd ${hostapd_flags}
fi
start_daemon hostapd rwhod lpd ldapd sendmail smtpd httpd ftpd \
ftpproxy identd inetd rarpd bootparamd rbootd mopd
if [ X"${bt}" != X"NO" ]; then
echo -n ' btd'; /usr/sbin/btd
@ -704,52 +613,6 @@ if [ X"${bt}" != X"NO" ]; then
fi
fi
if [ X"${rwhod}" = X"YES" ]; then
echo -n ' rwhod'; rwhod
fi
if [ X"${lpd_flags}" != X"NO" ]; then
echo -n ' lpd'; lpd ${lpd_flags}
fi
if [ X"${ldapd_flags}" != X"NO" ]; then
echo -n ' ldapd'; /usr/sbin/ldapd ${ldapd_flags}
fi
# We call sendmail with a full path so that SIGHUP works.
# Note that /usr/sbin/sendmail may actually call a
# mailer other than sendmail, depending on /etc/mailer.conf.
if [ X"${sendmail_flags}" != X"NO" -a -s /etc/mailer.conf ]; then
echo -n ' sendmail'; ( /usr/sbin/sendmail ${sendmail_flags} >/dev/null 2>&1 & )
fi
if [ X"${smtpd_flags}" != X"NO" ]; then
echo -n ' smtpd'; smtpd $smtpd_flags
fi
if [ X"${httpd_flags}" != X"NO" ]; then
# Clean up left-over httpd locks
rm -f /var/www/logs/{ssl_mutex,httpd.lock,accept.lock}.*
echo -n ' httpd'; /usr/sbin/httpd ${httpd_flags}
fi
if [ X"${ftpd_flags}" != X"NO" ]; then
echo -n ' ftpd'; /usr/libexec/ftpd ${ftpd_flags}
fi
if [ X"${ftpproxy_flags}" != X"NO" ]; then
echo -n ' ftp-proxy'; /usr/sbin/ftp-proxy ${ftpproxy_flags}
fi
if [ X"${identd_flags}" != X"NO" ]; then
echo -n ' identd'; /usr/libexec/identd ${identd_flags}
fi
if [ X"${inetd}" = X"YES" -a -e /etc/inetd.conf ]; then
echo -n ' inetd'; inetd
fi
if [ X"${spamd_flags}" != X"NO" ]; then
if [ X"${spamd_black}" != X"NO" ]; then
spamd_flags="${spamd_flags} -b"
@ -762,22 +625,6 @@ if [ X"${spamd_flags}" != X"NO" ]; then
fi
fi
if [ X"${rarpd_flags}" != X"NO" -a -s /etc/ethers ]; then
echo -n ' rarpd'; rarpd ${rarpd_flags}
fi
if [ X"${bootparamd_flags}" != X"NO" -a -s /etc/bootparams ]; then
echo -n ' rpc.bootparamd'; rpc.bootparamd ${bootparamd_flags}
fi
if [ X"${rbootd_flags}" != X"NO" -a -s /etc/rbootd.conf ]; then
echo -n ' rbootd'; rbootd ${rbootd_flags}
fi
if [ X"${mopd_flags}" != X"NO" -a -d /tftpboot/mop ]; then
echo -n ' mopd'; mopd ${mopd_flags}
fi
echo '.'
mixerctl_conf
@ -819,25 +666,9 @@ fi
[ -f /etc/rc.local ] && . /etc/rc.local
echo -n starting standard daemons:
if [ X"${apmd_flags}" != X"NO" -a -x /usr/sbin/apmd ]; then
echo -n ' apmd'; /usr/sbin/apmd ${apmd_flags}
fi
if [ X"${sensorsd_flags}" != X"NO" ]; then
echo -n ' sensorsd'; /usr/sbin/sensorsd ${sensorsd_flags}
fi
if [ X"${hotplugd_flags}" != X"NO" -a -x /usr/sbin/hotplugd ]; then
echo -n ' hotplugd'; /usr/sbin/hotplugd ${hotplugd_flags}
fi
if [ X"${watchdogd_flags}" != X"NO" -a -x /usr/sbin/watchdogd ]; then
echo -n ' watchdogd'; /usr/sbin/watchdogd ${watchdogd_flags}
fi
echo -n 'starting standard daemons:'
echo -n ' cron'; cron
start_daemon apmd sensorsd hotplugd watchdogd cron
# disable carp interlock
ifconfig -g carp -carpdemote 128


+ 9
- 3
src/etc/rc.conf View File

@ -1,6 +1,6 @@
#!/bin/sh -
#
# $OpenBSD: rc.conf,v 1.141 2011/02/12 11:21:01 ajacoutot Exp $
# $OpenBSD: rc.conf,v 1.142 2011/07/06 18:55:36 robert Exp $
# set these to "NO" to turn them off. otherwise, they're used as flags
ldpd_flags=NO # for normal use: ""
@ -47,6 +47,8 @@ snmpd_flags=NO # for normal use: ""
smtpd_flags=NO # for normal use: ""
aucat_flags=NO # for normal use: ""
ldapd_flags=NO # for normal use: ""
inetd_flags="" # for normal use: ""
rwhod_flags=NO # for normal use: ""
# use -u to disable chroot, see httpd(8)
httpd_flags=NO # for normal use: "" (or "-DSSL" after reading ssl(8))
@ -70,7 +72,6 @@ xdm_flags=NO # for normal use: ""
wsmoused_flags=NO # for ps/2 or usb mice: "", serial: "-p /dev/cua00"
# set the following to "YES" to turn them on
rwhod=NO
nfs_server=NO # see sysctl.conf for nfs client configuration
lockd=NO
amd=NO
@ -78,7 +79,6 @@ pf=YES # Packet filter / NAT
ipsec=NO # IPsec
bt=NO # Bluetooth
portmap=NO # Note: inetd(8) rpc services need portmap too
inetd=YES # almost always needed
check_quotas=YES # NO may be desirable in some YP environments
accounting=NO # process accounting (using /var/account/acct)
@ -113,4 +113,10 @@ rc_scripts=
local_rcconf="/etc/rc.conf.local"
unset inetd_flags rwhod_flags
[ -f ${local_rcconf} ] && . ${local_rcconf} # Do not edit this line
# backward compatibility for inetd and rwhod
: ${inetd_flags=$([ X"${inetd-YES}" = XYES ] || echo NO)}
: ${rwhod_flags=$([ X"${rwhod-NO}" = XYES ] || echo NO)}

+ 11
- 0
src/etc/rc.d/apmd View File

@ -0,0 +1,11 @@
#!/bin/sh
#
# $OpenBSD: apmd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/apmd"
. /etc/rc.d/rc.subr
rc_reload=NO
rc_cmd $1

+ 11
- 0
src/etc/rc.d/bgpd View File

@ -0,0 +1,11 @@
#!/bin/sh
#
# $OpenBSD: bgpd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/bgpd"
. /etc/rc.d/rc.subr
pexp="bgpd: parent.*"
rc_cmd $1

+ 15
- 0
src/etc/rc.d/bootparamd View File

@ -0,0 +1,15 @@
#!/bin/sh
#
# $OpenBSD: bootparamd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/rpc.bootparamd"
. /etc/rc.d/rc.subr
rc_reload=NO
rc_pre() {
[ -s /etc/bootparams ] || return 1
}
rc_cmd $1

+ 9
- 0
src/etc/rc.d/cron View File

@ -0,0 +1,9 @@
#!/bin/sh
#
# $OpenBSD: cron,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/cron"
. /etc/rc.d/rc.subr
rc_cmd $1

+ 15
- 0
src/etc/rc.d/dhcpd View File

@ -0,0 +1,15 @@
#!/bin/sh
#
# $OpenBSD: dhcpd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/dhcpd"
. /etc/rc.d/rc.subr
rc_pre() {
touch /var/db/dhcpd.leases
}
rc_reload=NO
rc_cmd $1

+ 11
- 0
src/etc/rc.d/dhcrelay View File

@ -0,0 +1,11 @@
#!/bin/sh
#
# $OpenBSD: dhcrelay,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/dhcrelay"
. /etc/rc.d/rc.subr
rc_reload=NO
rc_cmd $1

+ 11
- 0
src/etc/rc.d/dvmrpd View File

@ -0,0 +1,11 @@
#!/bin/sh
#
# $OpenBSD: dvmrpd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/dvmrpd"
. /etc/rc.d/rc.subr
rc_reload=NO
rc_cmd $1

+ 11
- 0
src/etc/rc.d/ftpd View File

@ -0,0 +1,11 @@
#!/bin/sh
#
# $OpenBSD: ftpd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/libexec/ftpd"
. /etc/rc.d/rc.subr
rc_reload=NO
rc_cmd $1

+ 11
- 0
src/etc/rc.d/ftpproxy View File

@ -0,0 +1,11 @@
#!/bin/sh
#
# $OpenBSD: ftpproxy,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/ftp-proxy"
. /etc/rc.d/rc.subr
rc_reload=NO
rc_cmd $1

+ 9
- 0
src/etc/rc.d/hostapd View File

@ -0,0 +1,9 @@
#!/bin/sh
#
# $OpenBSD: hostapd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/hostapd"
. /etc/rc.d/rc.subr
rc_cmd $1

+ 9
- 0
src/etc/rc.d/hotplugd View File

@ -0,0 +1,9 @@
#!/bin/sh
#
# $OpenBSD: hotplugd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/hotplugd"
. /etc/rc.d/rc.subr
rc_cmd $1

+ 15
- 0
src/etc/rc.d/httpd View File

@ -0,0 +1,15 @@
#!/bin/sh
#
# $OpenBSD: httpd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/httpd"
. /etc/rc.d/rc.subr
pexp="httpd: parent.*"
rc_pre() {
rm -f /var/www/logs/{ssl_mutex,httpd.lock,accept.lock}.*
}
rc_cmd $1

+ 11
- 0
src/etc/rc.d/identd View File

@ -0,0 +1,11 @@
#!/bin/sh
#
# $OpenBSD: identd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/libexec/identd"
. /etc/rc.d/rc.subr
rc_reload=NO
rc_cmd $1

+ 9
- 0
src/etc/rc.d/ifstated View File

@ -0,0 +1,9 @@
#!/bin/sh
#
# $OpenBSD: ifstated,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/ifstated"
. /etc/rc.d/rc.subr
rc_cmd $1

+ 17
- 0
src/etc/rc.d/iked View File

@ -0,0 +1,17 @@
#!/bin/sh
#
# $OpenBSD: iked,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/sbin/iked"
. /etc/rc.d/rc.subr
pexp="iked:.*parent.*"
rc_pre() {
[ X"${sasyncd_flags}" != X"NO" ] && \
daemon_flags="-S ${daemon_flags}"
return 0
}
rc_cmd $1

+ 9
- 0
src/etc/rc.d/inetd View File

@ -0,0 +1,9 @@
#!/bin/sh
#
# $OpenBSD: inetd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/inetd"
. /etc/rc.d/rc.subr
rc_cmd $1

+ 17
- 0
src/etc/rc.d/isakmpd View File

@ -0,0 +1,17 @@
#!/bin/sh
#
# $OpenBSD: isakmpd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/sbin/isakmpd"
. /etc/rc.d/rc.subr
pexp="isakmpd: monitor \[priv\]"
rc_pre() {
[ X"${sasyncd_flags}" != X"NO" ] && \
daemon_flags="-S ${daemon_flags}"
return 0
}
rc_cmd $1

+ 9
- 0
src/etc/rc.d/ldapd View File

@ -0,0 +1,9 @@
#!/bin/sh
#
# $OpenBSD: ldapd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/ldapd"
. /etc/rc.d/rc.subr
rc_cmd $1

+ 15
- 0
src/etc/rc.d/ldattach View File

@ -0,0 +1,15 @@
#!/bin/sh
#
# $OpenBSD: ldattach,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/sbin/ldattach"
. /etc/rc.d/rc.subr
rc_reload=NO
rc_pre() {
[ -n "${ldattach_flags}" ] || return 1
}
rc_cmd $1

+ 11
- 0
src/etc/rc.d/ldpd View File

@ -0,0 +1,11 @@
#!/bin/sh
#
# $OpenBSD: ldpd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/ldpd"
. /etc/rc.d/rc.subr
pexp="ldpd: parent.*"
rc_cmd $1

+ 9
- 0
src/etc/rc.d/lpd View File

@ -0,0 +1,9 @@
#!/bin/sh
#
# $OpenBSD: lpd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/lpd"
. /etc/rc.d/rc.subr
rc_cmd $1

+ 15
- 0
src/etc/rc.d/mopd View File

@ -0,0 +1,15 @@
#!/bin/sh
#
# $OpenBSD: mopd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/mopd"
. /etc/rc.d/rc.subr
rc_reload=NO
rc_pre() {
[ -d /tftpboot/mop ] || return 1
}
rc_cmd $1

+ 9
- 0
src/etc/rc.d/mrouted View File

@ -0,0 +1,9 @@
#!/bin/sh
#
# $OpenBSD: mrouted,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/mrouted"
. /etc/rc.d/rc.subr
rc_cmd $1

+ 11
- 0
src/etc/rc.d/named View File

@ -0,0 +1,11 @@
#!/bin/sh
#
# $OpenBSD: named,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/named"
. /etc/rc.d/rc.subr
pexp="named: \[priv\]"
rc_cmd $1

+ 9
- 0
src/etc/rc.d/nsd View File

@ -0,0 +1,9 @@
#!/bin/sh
#
# $OpenBSD: nsd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/nsd"
. /etc/rc.d/rc.subr
rc_cmd $1

+ 11
- 0
src/etc/rc.d/ntpd View File

@ -0,0 +1,11 @@
#!/bin/sh
#
# $OpenBSD: ntpd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/ntpd"
. /etc/rc.d/rc.subr
pexp="ntpd: \[priv\]"
rc_cmd $1

+ 15
- 0
src/etc/rc.d/rarpd View File

@ -0,0 +1,15 @@
#!/bin/sh
#
# $OpenBSD: rarpd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/rarpd"
. /etc/rc.d/rc.subr
rc_reload=NO
rc_pre() {
[ -s /etc/ethers ] || return 1
}
rc_cmd $1

+ 9
- 0
src/etc/rc.d/rbootd View File

@ -0,0 +1,9 @@
#!/bin/sh
#
# $OpenBSD: rbootd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/rbootd"
. /etc/rc.d/rc.subr
rc_cmd $1

+ 2
- 2
src/etc/rc.d/rc.subr View File

@ -1,4 +1,4 @@
# $OpenBSD: rc.subr,v 1.39 2011/07/03 16:09:06 schwarze Exp $
# $OpenBSD: rc.subr,v 1.40 2011/07/06 18:55:36 robert Exp $
# Default functions and variables used by rc.d(8) scripts.
@ -74,7 +74,7 @@ rc_cmd() {
rc_do rc_check
;;
start)
rc_do rc_check && exit 0
[ -z "${INRC}" ] && rc_do rc_check && exit 0
while true; do # no real loop, only needed to break
if type rc_pre >/dev/null; then
rc_do rc_pre || break


+ 11
- 0
src/etc/rc.d/relayd View File

@ -0,0 +1,11 @@
#!/bin/sh
#
# $OpenBSD: relayd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/relayd"
. /etc/rc.d/rc.subr
pexp="relayd: parent.*"
rc_cmd $1

+ 11
- 0
src/etc/rc.d/ripd View File

@ -0,0 +1,11 @@
#!/bin/sh
#
# $OpenBSD: ripd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/ripd"
. /etc/rc.d/rc.subr
pexp="ripd: parent.*"
rc_cmd $1

+ 9
- 0
src/etc/rc.d/route6d View File

@ -0,0 +1,9 @@
#!/bin/sh
#
# $OpenBSD: route6d,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/route6d"
. /etc/rc.d/rc.subr
rc_cmd $1

+ 11
- 0
src/etc/rc.d/rtadvd View File

@ -0,0 +1,11 @@
#!/bin/sh
#
# $OpenBSD: rtadvd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/rtadvd"
. /etc/rc.d/rc.subr
rc_reload=NO
rc_cmd $1

+ 11
- 0
src/etc/rc.d/rtsold View File

@ -0,0 +1,11 @@
#!/bin/sh
#
# $OpenBSD: rtsold,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/rtsold"
. /etc/rc.d/rc.subr
rc_reload=NO
rc_cmd $1

+ 9
- 0
src/etc/rc.d/rwhod View File

@ -0,0 +1,9 @@
#!/bin/sh
#
# $OpenBSD: rwhod,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/rwhod"
. /etc/rc.d/rc.subr
rc_cmd $1

+ 11
- 0
src/etc/rc.d/sasyncd View File

@ -0,0 +1,11 @@
#!/bin/sh
#
# $OpenBSD: sasyncd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/sasyncd"
. /etc/rc.d/rc.subr
pexp="sasyncd: \[priv\]"
rc_cmd $1

+ 11
- 0
src/etc/rc.d/sendmail View File

@ -0,0 +1,11 @@
#!/bin/sh
#
# $OpenBSD: sendmail,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/sendmail"
. /etc/rc.d/rc.subr
pexp="sendmail: accepting.*"
rc_cmd $1

+ 9
- 0
src/etc/rc.d/sensorsd View File

@ -0,0 +1,9 @@
#!/bin/sh
#
# $OpenBSD: sensorsd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/sensorsd"
. /etc/rc.d/rc.subr
rc_cmd $1

+ 9
- 0
src/etc/rc.d/smtpd View File

@ -0,0 +1,9 @@
#!/bin/sh
#
# $OpenBSD: smtpd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/smtpd"
. /etc/rc.d/rc.subr
rc_cmd $1

+ 11
- 0
src/etc/rc.d/snmpd View File

@ -0,0 +1,11 @@
#!/bin/sh
#
# $OpenBSD: snmpd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/snmpd"
. /etc/rc.d/rc.subr
pexp="snmpd: parent.*"
rc_cmd $1

+ 9
- 0
src/etc/rc.d/sshd View File

@ -0,0 +1,9 @@
#!/bin/sh
#
# $OpenBSD: sshd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/sshd"
. /etc/rc.d/rc.subr
rc_cmd $1

+ 24
- 0
src/etc/rc.d/syslogd View File

@ -0,0 +1,24 @@
#!/bin/sh
#
# $OpenBSD: syslogd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/syslogd"
. /etc/rc.d/rc.subr
pexp="syslogd: \[priv\]"
rc_pre() {
[ X"${httpd_flags}" != X"-u" ] && rm -f /var/www/dev/log && \
daemon_flags="${daemon_flags} -a /var/www/dev/log"
[ X"${named_flags}" != X"NO" ] && rm -f /var/named/dev/log && \
daemon_flags="${daemon_flags} -a /var/named/dev/log"
[ X"${nsd_flags}" != X"NO" ] && rm -f /var/nsd/dev/log && \
daemon_flags="${daemon_flags} -a /var/nsd/dev/log"
[ -d /var/empty ] && rm -f /var/empty/dev/log && \
mkdir -p -m 0555 /var/empty/dev && \
daemon_flags="${daemon_flags} -a /var/empty/dev/log"
rm -f /dev/log
}
rc_cmd $1

+ 11
- 0
src/etc/rc.d/timed View File

@ -0,0 +1,11 @@
#!/bin/sh
#
# $OpenBSD: timed,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/timed"
. /etc/rc.d/rc.subr
rc_reload=NO
rc_cmd $1

+ 9
- 0
src/etc/rc.d/watchdogd View File

@ -0,0 +1,9 @@
#!/bin/sh
#
# $OpenBSD: watchdogd,v 1.1 2011/07/06 18:55:36 robert Exp $
daemon="/usr/sbin/watchdogd"
. /etc/rc.d/rc.subr
rc_cmd $1

Loading…
Cancel
Save