Blob


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