ngircd-bsd.sh 1.2 KB

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