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