]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Added start script for FreeBSD.
authorAlexander Barton <alex@barton.de>
Fri, 12 Aug 2005 21:32:45 +0000 (21:32 +0000)
committerAlexander Barton <alex@barton.de>
Fri, 12 Aug 2005 21:32:45 +0000 (21:32 +0000)
contrib/README
contrib/ngircd.sh [new file with mode: 0644]

index eaa6cb88c5a0b9b2dfe06ff51d2fc7c26dd75144..67bac21bb20436c86d9725ae2652ebd60c00c85c 100644 (file)
@@ -1,7 +1,7 @@
 
                      ngIRCd - Next Generation IRC Server
 
 
                      ngIRCd - Next Generation IRC Server
 
-                      (c)2001-2004 by Alexander Barton,
+                        (c)2001-2005 Alexander Barton,
                     alex@barton.de, http://www.barton.de/
 
                ngIRCd is free software and published under the
                     alex@barton.de, http://www.barton.de/
 
                ngIRCd is free software and published under the
@@ -16,6 +16,9 @@ MacOSX/
 Debian/
  - Various files for building Debian packages.
 
 Debian/
  - Various files for building Debian packages.
 
+ngircd.sh
+ - Start script for FreeBSD.
+
 ngircd.spec
  - RPM "spec" file.
 
 ngircd.spec
  - RPM "spec" file.
 
@@ -24,4 +27,4 @@ systrace.policy
 
 
 --
 
 
 --
-$Id: README,v 1.1 2004/04/28 12:18:50 alex Exp $
+$Id: README,v 1.2 2005/08/12 21:32:45 alex Exp $
diff --git a/contrib/ngircd.sh b/contrib/ngircd.sh
new file mode 100644 (file)
index 0000000..e085646
--- /dev/null
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+# PROVIDE: ngircd
+# REQUIRE: NETWORKING SERVERS
+# BEFORE: DAEMON
+# KEYWORD: FreeBSD shutdown
+
+# Add the following line to /etc/rc.conf to enable `ngircd':
+#
+#ngircd_enable="YES"
+#
+
+. "/etc/rc.subr"
+
+name="ngircd"
+rcvar=`set_rcvar`
+
+command="/usr/local/sbin/ngircd"
+command_args=""
+
+load_rc_config "$name"
+: ${ngircd_enable="NO"}
+: ${ngircd_flags=""}
+
+required_files="/usr/local/etc/$name.conf"
+pidfile="${ngircd_pidfile:-/var/run/${name}/${name}.pid}"
+
+if [ ! x"${ngircd_chrootdir}" = x ];then
+       # Mount a devfs in the chroot directory if needed
+       if [ ! -c ${ngircd_chrootdir}/dev/random \
+         -o ! -c ${ngircd_chrootdir}/dev/null ]; then
+               umount ${ngircd_chrootdir}/dev 2>/dev/null
+               mount_devfs devfs ${ngircd_chrootdir}/dev
+       fi
+
+       devfs -m ${ngircd_chrootdir}/dev rule apply hide
+       devfs -m ${ngircd_chrootdir}/dev rule apply path null unhide
+       devfs -m ${ngircd_chrootdir}/dev rule apply path random unhide
+
+       # Copy local timezone information if it is not up to date.
+       if [ -f /etc/localtime ]; then
+               cmp -s /etc/localtime "${named_chrootdir}/etc/localtime" || \
+                       cp -p /etc/localtime "${named_chrootdir}/etc/localtime"
+       fi
+
+       pidfile="${ngircd_chrootdir}${pidfile}"
+fi
+
+run_rc_command "$1"
+
+# -eof-