diff options
author | Martin Wilke <miwi@FreeBSD.org> | 2007-02-08 22:32:06 +0000 |
---|---|---|
committer | Martin Wilke <miwi@FreeBSD.org> | 2007-02-08 22:32:06 +0000 |
commit | 2ad1ee7e800292f4894cdbb8b9d37510f8653fc9 (patch) | |
tree | 93f9920ddbf0ed2f5f76512a6903ed750835f33b /irc/tr-ircd/files/trircd.in | |
parent | - Update to 2.11 (diff) |
- Update to 5.7.3
- Pass maintainership to submitter
Changelog:
- no more run as root, uses own user and group by default
- RCng startup script (trircd)
- fixed build for amd64
- installs bin/tr-ircd instead of bin/ircd
(conflict with irc/ircd-hybrid, irc/ptlink-ircd & co.)
- does not install bin/md5sum (we have our md5)
(conflict with archivers/dpkg and not necessary)
- run and log directories can be defined via
TRIRCD_RUNDIR and TRIRCD_LOGDIR
- configuration directory via TRIRCD_CONFDIR
(can be specified on runtime as well)
- user and group definable via TRIRCD_USER TRIRCD_GROUP
PR: 108835
Submitted by: Martin Matuska <martin@matuska.org>
Notes
Notes:
svn path=/head/; revision=184607
Diffstat (limited to 'irc/tr-ircd/files/trircd.in')
-rw-r--r-- | irc/tr-ircd/files/trircd.in | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/irc/tr-ircd/files/trircd.in b/irc/tr-ircd/files/trircd.in new file mode 100644 index 000000000000..165a2ec11818 --- /dev/null +++ b/irc/tr-ircd/files/trircd.in @@ -0,0 +1,51 @@ +#! /bin/sh +# +# PROVIDE: trircd +# REQUIRE: DAEMON NETWORKING SERVERS +# +# Add the following line to /etc/rc.conf to enable trircd: +# +# trircd_enable="YES" +# +# Tweakable parameters for users to override in rc.conf + +. "%%RC_SUBR%%" + +name=trircd + +load_rc_config ${name} +: ${trircd_enable="NO"} +: ${trircd_user="%%TRIRCD_USER%%"} +: ${trircd_group="%%TRIRCD_GROUP%%"} +: ${trircd_confdir=%%TRIRCD_CONFDIR%%} +: ${trircd_conf=${trircd_confdir}/ircd.conf} +: ${trircd_pidfile=%%TRIRCD_RUNDIR%%/ircd.pid} +: ${trircd_flags="-d ${trircd_confdir} -c ${trircd_conf} >/dev/null 2>&1"} + +rcvar=`set_rcvar` +command=%%PREFIX%%/bin/tr-ircd +pidfile=${trircd_pidfile} +required_files="${trircd_conf}" +start_precmd="start_precmd" + +irandom=%%DATADIR%%/tools/irandom.sh +trircd_rundir=%%TRIRCD_RUNDIR%% +trircd_logdir=%%TRIRCD_LOGDIR%% +trircd_randfile=${trircd_rundir}/ircd.rand + +start_precmd() +{ + [ -d "${trircd_logdir}" ] || { + %%MKDIR%% ${trircd_logdir} + %%CHOWN%% ${trircd_user}:${trircd_group} ${trircd_logdir} + %%CHMOD%% 770 ${trircd_logdir} + } + [ -d "${trircd_rundir}" ] || { + %%MKDIR%% ${trircd_rundir} + %%CHOWN%% ${trircd_user}:${trircd_group} ${trircd_rundir} + %%CHMOD%% 770 ${trircd_rundir} + } + [ -f "${trircd_randfile}" ] || ${irandom} +} + +run_rc_command "$1" |