01
2009-05-05
alex
#!/bin/sh
03
2009-05-05
alex
# PROVIDE: ngircd
04
2009-05-05
alex
# REQUIRE: NETWORKING SERVERS
05
2009-05-05
alex
# BEFORE: DAEMON
06
2009-05-05
alex
# KEYWORD: FreeBSD shutdown
08
2009-05-05
alex
# Add the following line to /etc/rc.conf to enable `ngircd':
10
2009-05-05
alex
#ngircd_enable="YES"
13
2009-05-05
alex
. "/etc/rc.subr"
15
2009-05-05
alex
name="ngircd"
16
2009-05-05
alex
rcvar=`set_rcvar`
18
2009-05-05
alex
command="/usr/local/sbin/ngircd"
19
2009-05-05
alex
command_args=""
21
2009-05-05
alex
load_rc_config "$name"
22
2009-05-05
alex
: ${ngircd_enable="NO"}
23
2009-05-05
alex
: ${ngircd_flags=""}
25
2009-05-05
alex
required_files="/usr/local/etc/$name.conf"
26
2009-05-05
alex
pidfile="${ngircd_pidfile:-/var/run/${name}/${name}.pid}"
28
2009-05-05
alex
if [ ! x"${ngircd_chrootdir}" = x ];then
29
2009-05-05
alex
# Mount a devfs in the chroot directory if needed
30
2009-05-05
alex
if [ ! -c ${ngircd_chrootdir}/dev/random \
31
2009-05-05
alex
-o ! -c ${ngircd_chrootdir}/dev/null ]; then
32
2009-05-05
alex
umount ${ngircd_chrootdir}/dev 2>/dev/null
33
2009-05-05
alex
mount_devfs devfs ${ngircd_chrootdir}/dev
36
2009-05-05
alex
devfs -m ${ngircd_chrootdir}/dev rule apply hide
37
2009-05-05
alex
devfs -m ${ngircd_chrootdir}/dev rule apply path null unhide
38
2009-05-05
alex
devfs -m ${ngircd_chrootdir}/dev rule apply path random unhide
40
2009-05-05
alex
# Copy local timezone information if it is not up to date.
41
2009-05-05
alex
if [ -f /etc/localtime ]; then
42
2009-05-05
alex
cmp -s /etc/localtime "${named_chrootdir}/etc/localtime" || \
43
2009-05-05
alex
cp -p /etc/localtime "${named_chrootdir}/etc/localtime"
46
2009-05-05
alex
pidfile="${ngircd_chrootdir}${pidfile}"
49
2009-05-05
alex
run_rc_command "$1"