summaryrefslogtreecommitdiff
path: root/etc/rc.d
diff options
context:
space:
mode:
authorRobert Nagy <robert@cvs.openbsd.org>2011-07-08 02:15:35 +0000
committerRobert Nagy <robert@cvs.openbsd.org>2011-07-08 02:15:35 +0000
commitf0fb8b5bb61c60c6c12368ef9a304f442c06f30e (patch)
tree5e189a881daa501b679b9ed6ca6b964e5b8f7f23 /etc/rc.d
parent40dd25982e0c3bdc7a4c1daaf29f50d81d64fff2 (diff)
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@!
Diffstat (limited to 'etc/rc.d')
-rw-r--r--etc/rc.d/amd19
-rw-r--r--etc/rc.d/bootparamd4
-rw-r--r--etc/rc.d/ldattach4
-rw-r--r--etc/rc.d/mopd4
-rw-r--r--etc/rc.d/rarpd4
-rw-r--r--etc/rc.d/spamd3
-rw-r--r--etc/rc.d/spamlogd15
-rw-r--r--etc/rc.d/ypbind5
-rw-r--r--etc/rc.d/yppasswdd3
-rw-r--r--etc/rc.d/ypserv5
10 files changed, 50 insertions, 16 deletions
diff --git a/etc/rc.d/amd b/etc/rc.d/amd
new file mode 100644
index 00000000000..5e474c9541f
--- /dev/null
+++ b/etc/rc.d/amd
@@ -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
diff --git a/etc/rc.d/bootparamd b/etc/rc.d/bootparamd
index e3f45a505be..6b527184801 100644
--- a/etc/rc.d/bootparamd
+++ b/etc/rc.d/bootparamd
@@ -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
diff --git a/etc/rc.d/ldattach b/etc/rc.d/ldattach
index 39d520aeb90..d12f3ff6f9c 100644
--- a/etc/rc.d/ldattach
+++ b/etc/rc.d/ldattach
@@ -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
diff --git a/etc/rc.d/mopd b/etc/rc.d/mopd
index cf46ddae78b..2f806ebfe8b 100644
--- a/etc/rc.d/mopd
+++ b/etc/rc.d/mopd
@@ -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
diff --git a/etc/rc.d/rarpd b/etc/rc.d/rarpd
index 82a8ac77eaf..e63053b211e 100644
--- a/etc/rc.d/rarpd
+++ b/etc/rc.d/rarpd
@@ -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
diff --git a/etc/rc.d/spamd b/etc/rc.d/spamd
index fbf67898ac4..54bd001e162 100644
--- a/etc/rc.d/spamd
+++ b/etc/rc.d/spamd
@@ -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
diff --git a/etc/rc.d/spamlogd b/etc/rc.d/spamlogd
new file mode 100644
index 00000000000..b8620e01a8c
--- /dev/null
+++ b/etc/rc.d/spamlogd
@@ -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
diff --git a/etc/rc.d/ypbind b/etc/rc.d/ypbind
index 7197e895869..e7e470c6cd2 100644
--- a/etc/rc.d/ypbind
+++ b/etc/rc.d/ypbind
@@ -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
diff --git a/etc/rc.d/yppasswdd b/etc/rc.d/yppasswdd
index d3dd731faa2..07b5263452b 100644
--- a/etc/rc.d/yppasswdd
+++ b/etc/rc.d/yppasswdd
@@ -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
diff --git a/etc/rc.d/ypserv b/etc/rc.d/ypserv
index 6c189e036bf..3a94c5f6219 100644
--- a/etc/rc.d/ypserv
+++ b/etc/rc.d/ypserv
@@ -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