From: srittau Date: Thu, 7 Feb 2002 23:39:20 +0000 (+0000) Subject: Back-port from trunk: NetBSD init scripts. X-Git-Tag: netatalk-1-5-2~51 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=commitdiff_plain;h=a84a8bfe7627648ef78db0924f16f23c5cd2e342 Back-port from trunk: NetBSD init scripts. --- diff --git a/distrib/initscripts/Makefile.am b/distrib/initscripts/Makefile.am index 2a46bf6e..76534607 100644 --- a/distrib/initscripts/Makefile.am +++ b/distrib/initscripts/Makefile.am @@ -15,10 +15,14 @@ pkgconfdir = @PKGCONFDIR@ <$< >$@ GENERATED_FILES = \ + rc.afpd.netbsd \ rc.atalk.redhat \ rc.atalk.tru64 \ rc.atalk.bsd \ - rc.atalk.suse + rc.atalkd.netbsd \ + rc.atalk.suse \ + rc.papd.netbsd \ + rc.timelord.netbsd TEMPLATES = $(foreach f,$(GENERATED_FILES),$(f).tmpl) CLEANFILES = $(GENERATED_FILES) @@ -86,3 +90,30 @@ atalk: rc.atalk.tru64 chmod a+x atalk endif + +# +# checking for NetBSD init scripts +# + +if USE_NETBSD + +sysvdir = /etc/rc.d +sysv_SCRIPTS = afp atalk pap timelord + +afpd: rc.afpd.netbsd + cp -f $< $@ + +atalkd: rc.atalkd.netbsd + cp -f $< $@ + chmod a+x $@ + +papd: rc.papd.netbsd + cp -f $< $@ + chmod a+x $@ + +timelord: rc.timelord.netbsd + cp -f $< $@ + chmod a+x $@ + +endif + diff --git a/distrib/initscripts/rc.afpd.netbsd.tmpl b/distrib/initscripts/rc.afpd.netbsd.tmpl new file mode 100644 index 00000000..7f289072 --- /dev/null +++ b/distrib/initscripts/rc.afpd.netbsd.tmpl @@ -0,0 +1,22 @@ +#!/bin/sh +# +# PROVIDE: afpd +# REQUIRE: atalkd +# +# AppleTalk daemons. Make sure not to start atalkd in the background: +# its data structures must have time to stablize before running the +# other processes. +# + +. /etc/rc.subr + +name="afpd" +rcvar=$name +command=":SBINDIR:/afpd" +etcdir=":ETCDIR:" +pidfile="/var/run/${name}.pid" +required_files="$etcdir/papd.conf $etcdir/AppleVolumes.default $etcdir/AppleVolumes.system" + +load_rc_config $name +run_rc_command "$1" + diff --git a/distrib/initscripts/rc.atalkd.netbsd.tmpl b/distrib/initscripts/rc.atalkd.netbsd.tmpl new file mode 100644 index 00000000..16fff488 --- /dev/null +++ b/distrib/initscripts/rc.atalkd.netbsd.tmpl @@ -0,0 +1,39 @@ +#!/bin/sh +# +# PROVIDE: atalkd +# REQUIRE: DAEMON +# +# AppleTalk daemons. Make sure not to start atalkd in the background: +# its data structures must have time to stablize before running the +# other processes. +# + +. /etc/rc.subr + +name="atalkd" +rcvar=$name +command=":SBINDIR:/atalkd" +pidfile="/var/run/${name}.pid" +register=":BINDIR:/nbprgstr" +myhostname=`hostname|sed 's/\..*$//'` +required_files=":ETCDIR:/atalkd.conf $register" + +start_cmd="atalkd_start" + +atalkd_start() +{ + if [ -x $command ]; then + echo 'Starting atalkd.' + $command $command_args + fi + + if [ -x $register ]; then + echo 'Setting AppleTalk info with nbprgstr.' + $register -p 4 $myhostname:Workstation + $register -p 4 $myhostname:netatalk + fi +} + +load_rc_config $name +run_rc_command "$1" + diff --git a/distrib/initscripts/rc.papd.netbsd.tmpl b/distrib/initscripts/rc.papd.netbsd.tmpl new file mode 100644 index 00000000..bcce58e6 --- /dev/null +++ b/distrib/initscripts/rc.papd.netbsd.tmpl @@ -0,0 +1,21 @@ +#!/bin/sh +# +# PROVIDE: papd +# REQUIRE: atalkd +# +# AppleTalk daemons. Make sure not to start atalkd in the background: +# its data structures must have time to stablize before running the +# other processes. +# + +. /etc/rc.subr + +name="papd" +rcvar=$name +command=":SBINDIR:/papd" +pidfile="/var/run/${name}.pid" +required_files=":ETCDIR:/papd.conf" + +load_rc_config $name +run_rc_command "$1" + diff --git a/distrib/initscripts/rc.timelord.netbsd.tmpl b/distrib/initscripts/rc.timelord.netbsd.tmpl new file mode 100644 index 00000000..23d3ae27 --- /dev/null +++ b/distrib/initscripts/rc.timelord.netbsd.tmpl @@ -0,0 +1,20 @@ +#!/bin/sh +# +# PROVIDE: timelord +# REQUIRE: atalkd +# +# AppleTalk daemons. Make sure not to start atalkd in the background: +# its data structures must have time to stablize before running the +# other processes. +# + +. /etc/rc.subr + +name="timelord" +rcvar=$name +command=":SBINDIR:/timelord" +pidfile="/var/run/${name}.pid" + +load_rc_config $name +run_rc_command "$1" +