Blame


1 701c2593 2005-08-12 alex #!/bin/sh
2 701c2593 2005-08-12 alex
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
7 701c2593 2005-08-12 alex
8 701c2593 2005-08-12 alex # Add the following line to /etc/rc.conf to enable `ngircd':
9 701c2593 2005-08-12 alex #
10 701c2593 2005-08-12 alex #ngircd_enable="YES"
11 701c2593 2005-08-12 alex #
12 701c2593 2005-08-12 alex
13 701c2593 2005-08-12 alex . "/etc/rc.subr"
14 701c2593 2005-08-12 alex
15 701c2593 2005-08-12 alex name="ngircd"
16 701c2593 2005-08-12 alex rcvar=`set_rcvar`
17 701c2593 2005-08-12 alex
18 701c2593 2005-08-12 alex command="/usr/local/sbin/ngircd"
19 701c2593 2005-08-12 alex command_args=""
20 701c2593 2005-08-12 alex
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=""}
24 701c2593 2005-08-12 alex
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}"
27 701c2593 2005-08-12 alex
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
34 701c2593 2005-08-12 alex fi
35 701c2593 2005-08-12 alex
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
39 701c2593 2005-08-12 alex
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"
44 701c2593 2005-08-12 alex fi
45 701c2593 2005-08-12 alex
46 701c2593 2005-08-12 alex pidfile="${ngircd_chrootdir}${pidfile}"
47 701c2593 2005-08-12 alex fi
48 701c2593 2005-08-12 alex
49 701c2593 2005-08-12 alex run_rc_command "$1"
50 701c2593 2005-08-12 alex
51 701c2593 2005-08-12 alex # -eof-