Browse Source

Switch amd and spamlogd to rc scripts and make sure that the

rc_pre() functions are returning correctly. This change
also simplyfies the changes because false || return 1 can be replaced
with false if that's the last call. thanks halex@!
OPENBSD_5_0
robert 13 years ago
parent
commit
8cdc8eb386
13 changed files with 63 additions and 37 deletions
  1. +3
    -3
      src/etc/Makefile
  2. +6
    -15
      src/etc/rc
  3. +4
    -3
      src/etc/rc.conf
  4. +19
    -0
      src/etc/rc.d/amd
  5. +2
    -2
      src/etc/rc.d/bootparamd
  6. +2
    -2
      src/etc/rc.d/ldattach
  7. +2
    -2
      src/etc/rc.d/mopd
  8. +2
    -2
      src/etc/rc.d/rarpd
  9. +2
    -1
      src/etc/rc.d/spamd
  10. +15
    -0
      src/etc/rc.d/spamlogd
  11. +2
    -3
      src/etc/rc.d/ypbind
  12. +2
    -1
      src/etc/rc.d/yppasswdd
  13. +2
    -3
      src/etc/rc.d/ypserv

+ 3
- 3
src/etc/Makefile View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.305 2011/07/08 00:54:04 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.306 2011/07/08 02:15:34 robert Exp $
TZDIR= /usr/share/zoneinfo
LOCALTIME= Canada/Mountain
@ -31,13 +31,13 @@ BIN1+= wsconsctl.conf
BIN2= motd
# -r-xr-xr-x
RCDAEMONS= apmd aucat bgpd bootparamd btd cron dhcpd dhcrelay dvmrpd ftpd \
RCDAEMONS= amd apmd aucat bgpd bootparamd btd cron dhcpd dhcrelay dvmrpd ftpd \
ftpproxy hostapd hotplugd httpd identd ifstated iked inetd isakmpd \
ldapd ldattach ldpd lpd mopd mrouted named nsd ntpd portmap pflogd \
rarpd rbootd relayd ripd route6d rtadvd rtsold rwhod sasyncd \
sendmail sensorsd smtpd snmpd spamd sshd syslogd watchdogd wsmoused \
xdm ypbind ypldap yppasswdd ypserv kdc kadmind kpasswdd nfsd mountd \
lockd statd
lockd statd spamlogd
MISETS= base${OSrev}.tgz comp${OSrev}.tgz \
man${OSrev}.tgz game${OSrev}.tgz etc${OSrev}.tgz


+ 6
- 15
src/etc/rc View File

@ -1,4 +1,4 @@
# $OpenBSD: rc,v 1.376 2011/07/08 02:02:02 deraadt Exp $
# $OpenBSD: rc,v 1.377 2011/07/08 02:15:34 robert Exp $
# System startup script run by init on autoboot
# or after single-user.
@ -446,12 +446,7 @@ start_daemon portmap
if [ X"`domainname`" != X"" ]; then
start_daemon ypserv ypldap ypbind yppasswdd
fi
start_daemon mountd nfsd lockd statd
if [ X"${amd}" = X"YES" -a -e ${amd_master} ]; then
echo -n ' amd'
(cd /etc/amd; amd `cat ${amd_master}`)
fi
start_daemon mountd nfsd lockd statd amd
# run rdate before ntpd
if [ X"${rdate_flags}" != X"NO" ]; then
@ -553,18 +548,14 @@ if ifconfig lo0 inet6 >/dev/null 2>&1; then
fi
start_daemon hostapd rwhod lpd ldapd sendmail smtpd httpd ftpd
start_daemon ftpproxy identd inetd rarpd bootparamd rbootd mopd spamd
start_daemon ftpproxy identd inetd rarpd bootparamd rbootd mopd
start_daemon spamd spamlogd
echo '.'
[ X"${spamd_flags}" != X"NO" ] && \
/usr/libexec/spamd-setup -D
if [ X"${spamd_flags}" != X"NO" -a X"${spamd_black}" = X"NO" ]; then
echo -n ' spamlogd'
/usr/libexec/spamlogd ${spamlogd_flags}
fi
echo '.'
if [ X"${kdc_flags}" != X"NO" ]; then
echo -n 'starting KerberosV daemons:'
start_daemon kdc kadmind kpasswdd


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

@ -1,6 +1,6 @@
#!/bin/sh -
#
# $OpenBSD: rc.conf,v 1.149 2011/07/08 00:54:04 ajacoutot Exp $
# $OpenBSD: rc.conf,v 1.150 2011/07/08 02:15:34 robert Exp $
# set these to "NO" to turn them off. otherwise, they're used as flags
ldpd_flags=NO # for normal use: ""
@ -52,7 +52,8 @@ portmap_flags=NO # for normal use: ""
kdc_flags=NO # for normal use: "" see 'info heimdal' for help
kadmind_flags=NO # for normal use: ""
kpasswdd_flags=NO # for normal use: ""
btd_flags=NO
btd_flags=NO # for normal use: ""
amd_flags=NO
# use -u to disable chroot, see httpd(8)
httpd_flags=NO # for normal use: "" (or "-DSSL" after reading ssl(8))
@ -76,7 +77,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
amd=NO
pf=YES # Packet filter / NAT
ipsec=NO # IPsec
bt=NO # Bluetooth
@ -134,3 +134,4 @@ unset statd_flags
: ${mountd_flags=$([ X"${nfs_server-NO}" = XYES ] || echo NO)}
: ${lockd_flags=$([ X"${lockd-NO}" = XYES ] || echo NO)}
: ${statd_flags=$([ X"${lockd-NO}" = XYES ] || echo NO)}
: ${amd_flags=$([ X"${amd-NO}" = XYES ] || echo NO)}

+ 19
- 0
src/etc/rc.d/amd View File

@ -0,0 +1,19 @@
#!/bin/sh
#
# $OpenBSD: amd,v 1.1 2011/07/08 02:15:34 robert Exp $
daemon="/usr/sbin/amd"
. /etc/rc.d/rc.subr
rc_reload=NO
rc_restart=NO
rc_stop=NO
rc_pre() {
[ -e ${amd_master} ]
daemon_flags=$(cat ${amd_master})
return 0
}
rc_cmd $1

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

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

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

@ -1,6 +1,6 @@
#!/bin/sh
#
# $OpenBSD: ldattach,v 1.1 2011/07/06 18:55:36 robert Exp $
# $OpenBSD: ldattach,v 1.2 2011/07/08 02:15:34 robert Exp $
daemon="/sbin/ldattach"
@ -9,7 +9,7 @@ daemon="/sbin/ldattach"
rc_reload=NO
rc_pre() {
[ -n "${ldattach_flags}" ] || return 1
[ -n "${ldattach_flags}" ]
}
rc_cmd $1

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

@ -1,6 +1,6 @@
#!/bin/sh
#
# $OpenBSD: mopd,v 1.1 2011/07/06 18:55:36 robert Exp $
# $OpenBSD: mopd,v 1.2 2011/07/08 02:15:34 robert Exp $
daemon="/usr/sbin/mopd"
@ -9,7 +9,7 @@ daemon="/usr/sbin/mopd"
rc_reload=NO
rc_pre() {
[ -d /tftpboot/mop ] || return 1
[ -d /tftpboot/mop ]
}
rc_cmd $1

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

@ -1,6 +1,6 @@
#!/bin/sh
#
# $OpenBSD: rarpd,v 1.1 2011/07/06 18:55:36 robert Exp $
# $OpenBSD: rarpd,v 1.2 2011/07/08 02:15:34 robert Exp $
daemon="/usr/sbin/rarpd"
@ -9,7 +9,7 @@ daemon="/usr/sbin/rarpd"
rc_reload=NO
rc_pre() {
[ -s /etc/ethers ] || return 1
[ -s /etc/ethers ]
}
rc_cmd $1

+ 2
- 1
src/etc/rc.d/spamd View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $OpenBSD: spamd,v 1.1 2011/07/07 23:29:45 robert Exp $
# $OpenBSD: spamd,v 1.2 2011/07/08 02:15:34 robert Exp $
daemon="/usr/libexec/spamd"
@ -11,6 +11,7 @@ pexp="spamd: \[priv\]"
rc_pre() {
[ X"${spamd_black}" != X"NO" ] && \
daemon_flags="-b ${daemon_flags}"
return 0
}
rc_cmd $1

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

@ -0,0 +1,15 @@
#!/bin/sh
#
# $OpenBSD: spamlogd,v 1.1 2011/07/08 02:15:34 robert Exp $
daemon="/usr/libexec/spamlogd"
. /etc/rc.d/rc.subr
rc_reload=NO
rc_pre() {
[ X"${spamd_flags}" != X"NO" -a X"${spamd_black}" = X"NO" ]
}
rc_cmd $1

+ 2
- 3
src/etc/rc.d/ypbind View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $OpenBSD: ypbind,v 1.2 2011/07/07 18:23:17 robert Exp $
# $OpenBSD: ypbind,v 1.3 2011/07/08 02:15:34 robert Exp $
daemon="/usr/sbin/ypbind"
@ -10,8 +10,7 @@ rc_bg=YES
rc_reload=NO
rc_pre() {
[ X"`domainname`" != X"" -a -d /var/yp/binding ] || \
return 1
[ X"`domainname`" != X"" -a -d /var/yp/binding ]
}
rc_cmd $1

+ 2
- 1
src/etc/rc.d/yppasswdd View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $OpenBSD: yppasswdd,v 1.2 2011/07/07 18:23:17 robert Exp $
# $OpenBSD: yppasswdd,v 1.3 2011/07/08 02:15:34 robert Exp $
daemon="/usr/sbin/rpc.yppasswdd"
@ -23,6 +23,7 @@ rc_pre() {
sed -e 's/^Name: //'`
fi
[ "$_host2" != "$_host1" ] && return 1
return 0
}
rc_cmd $1

+ 2
- 3
src/etc/rc.d/ypserv View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $OpenBSD: ypserv,v 1.2 2011/07/07 18:23:17 robert Exp $
# $OpenBSD: ypserv,v 1.3 2011/07/08 02:15:34 robert Exp $
daemon="/usr/sbin/ypserv"
@ -9,8 +9,7 @@ daemon="/usr/sbin/ypserv"
rc_reload=NO
rc_pre() {
[ X"`domainname`" != X"" -a -d /var/yp/`domainname` ] || \
return 1
[ X"`domainname`" != X"" -a -d /var/yp/`domainname` ]
}
rc_cmd $1

Loading…
Cancel
Save