summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorRobert Nagy <robert@cvs.openbsd.org>2011-07-07 01:52:59 +0000
committerRobert Nagy <robert@cvs.openbsd.org>2011-07-07 01:52:59 +0000
commitd9ab959de11abab14c42731da9bc7fbf3232c88e (patch)
tree30bc76b1d782d7516226d57fa40a74d28faa401f /etc
parent55d9f580bc6fadc317e15262e8b0c97fe41ff241 (diff)
add scripts for portmap and the yp daemons
Diffstat (limited to 'etc')
-rw-r--r--etc/Makefile9
-rw-r--r--etc/rc.d/portmap12
-rw-r--r--etc/rc.d/ypbind17
-rw-r--r--etc/rc.d/ypldap9
-rw-r--r--etc/rc.d/yppasswdd28
-rw-r--r--etc/rc.d/ypserv16
6 files changed, 87 insertions, 4 deletions
diff --git a/etc/Makefile b/etc/Makefile
index 17fd40c958f..1c0ed87eab8 100644
--- a/etc/Makefile
+++ b/etc/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.297 2011/07/06 18:55:36 robert Exp $
+# $OpenBSD: Makefile,v 1.298 2011/07/07 01:52:57 robert Exp $
TZDIR= /usr/share/zoneinfo
LOCALTIME= Canada/Mountain
@@ -33,9 +33,10 @@ 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
+ ldattach ldpd lpd mopd mrouted named nsd ntpd portmap rarpd \
+ rbootd relayd ripd route6d rtadvd rtsold rwhod sasyncd sendmail \
+ sensorsd smtpd snmpd sshd syslogd timed watchdogd ypbind ypldap \
+ yppasswdd ypserv
MISETS= base${OSrev}.tgz comp${OSrev}.tgz \
man${OSrev}.tgz game${OSrev}.tgz etc${OSrev}.tgz
diff --git a/etc/rc.d/portmap b/etc/rc.d/portmap
new file mode 100644
index 00000000000..b9c3674130f
--- /dev/null
+++ b/etc/rc.d/portmap
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# $OpenBSD: portmap,v 1.1 2011/07/07 01:52:58 robert Exp $
+
+daemon="/usr/sbin/portmap"
+
+. /etc/rc.d/rc.subr
+
+rc_reload=NO
+rc_restart=NO
+
+rc_cmd $1
diff --git a/etc/rc.d/ypbind b/etc/rc.d/ypbind
new file mode 100644
index 00000000000..fb72f0b4e4e
--- /dev/null
+++ b/etc/rc.d/ypbind
@@ -0,0 +1,17 @@
+#!/bin/sh
+#
+# $OpenBSD: ypbind,v 1.1 2011/07/07 01:52:58 robert Exp $
+
+daemon="/usr/sbin/ypbind"
+
+. /etc/rc.d/rc.subr
+
+rc_bg=YES
+rc_reload=NO
+
+rc_pre() {
+ [ X`domainname` != X"" -a -d /var/yp/binding ] || \
+ return 1
+}
+
+rc_cmd $1
diff --git a/etc/rc.d/ypldap b/etc/rc.d/ypldap
new file mode 100644
index 00000000000..6d1d31879a1
--- /dev/null
+++ b/etc/rc.d/ypldap
@@ -0,0 +1,9 @@
+#!/bin/sh
+#
+# $OpenBSD: ypldap,v 1.1 2011/07/07 01:52:58 robert Exp $
+
+daemon="/usr/sbin/ypldap"
+
+. /etc/rc.d/rc.subr
+
+rc_cmd $1
diff --git a/etc/rc.d/yppasswdd b/etc/rc.d/yppasswdd
new file mode 100644
index 00000000000..99c93049f37
--- /dev/null
+++ b/etc/rc.d/yppasswdd
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# $OpenBSD: yppasswdd,v 1.1 2011/07/07 01:52:58 robert Exp $
+
+daemon="/usr/sbin/rpc.yppasswdd"
+
+. /etc/rc.d/rc.subr
+
+rc_reload=NO
+
+rc_pre() {
+ [ X`domainname` != X"" -a -d /var/yp/`domainname` ] || \
+ return 1
+ _host1=`ypwhich -m passwd 2> /dev/null`
+ _host2=`hostname`
+ if [ `grep '^lookup' /etc/resolv.conf | grep yp | wc -c` -ne 0 ]; then
+ _host1=`ypmatch $_host1 hosts | cut -d' ' -f2`
+ _host2=`ypmatch $_host2 hosts | cut -d' ' -f2 | head -1`
+ else
+ _host1=`echo $_host1 | nslookup | grep '^Name: ' | \
+ sed -e 's/^Name: //'`
+ _host2=`echo $_host2 | nslookup | grep '^Name: ' | \
+ sed -e 's/^Name: //'`
+ fi
+ [ "$_host2" != "$_host1" ] && return 1
+}
+
+rc_cmd $1
diff --git a/etc/rc.d/ypserv b/etc/rc.d/ypserv
new file mode 100644
index 00000000000..199cd610bb5
--- /dev/null
+++ b/etc/rc.d/ypserv
@@ -0,0 +1,16 @@
+#!/bin/sh
+#
+# $OpenBSD: ypserv,v 1.1 2011/07/07 01:52:58 robert Exp $
+
+daemon="/usr/sbin/ypserv"
+
+. /etc/rc.d/rc.subr
+
+rc_reload=NO
+
+rc_pre() {
+ [ X`domainname` != X"" -a -d /var/yp/`domainname` ] || \
+ return 1
+}
+
+rc_cmd $1