diff options
author | feld <feld@FreeBSD.org> | 2014-02-10 09:46:33 +0800 |
---|---|---|
committer | feld <feld@FreeBSD.org> | 2014-02-10 09:46:33 +0800 |
commit | fbff1c7ac09d3e9be07222a1771ee84579d71e8e (patch) | |
tree | 72425677aa457c09de98598e50888e0a8d04cb93 /irc | |
parent | b27ad1fcb5a1377ca64c029a748b043485d356b9 (diff) | |
download | freebsd-ports-gnome-fbff1c7ac09d3e9be07222a1771ee84579d71e8e.tar.gz freebsd-ports-gnome-fbff1c7ac09d3e9be07222a1771ee84579d71e8e.tar.zst freebsd-ports-gnome-fbff1c7ac09d3e9be07222a1771ee84579d71e8e.zip |
Change rc script to daemonize inspircd via daemon(8)
inspircd has a curious feature where it exits with signal 15 when it
forks off to the background. This is very confusing and leads users to
believe the service was not started successfully when in fact it was.
https://github.com/inspircd/inspircd/pull/626
Approved by: swills (mentor)
Diffstat (limited to 'irc')
-rw-r--r-- | irc/inspircd/Makefile | 2 | ||||
-rw-r--r-- | irc/inspircd/files/inspircd.in | 20 |
2 files changed, 12 insertions, 10 deletions
diff --git a/irc/inspircd/Makefile b/irc/inspircd/Makefile index 452682146f3e..9a9bc642807f 100644 --- a/irc/inspircd/Makefile +++ b/irc/inspircd/Makefile @@ -3,7 +3,7 @@ PORTNAME= inspircd PORTVERSION= 2.0.14 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= irc MAINTAINER= feld@FreeBSD.org diff --git a/irc/inspircd/files/inspircd.in b/irc/inspircd/files/inspircd.in index ffc5bccfdcd0..074f9b20e596 100644 --- a/irc/inspircd/files/inspircd.in +++ b/irc/inspircd/files/inspircd.in @@ -38,21 +38,23 @@ load_rc_config ${name} : ${inspircd_logfile="%%INSPIRCD_LOG%%"} : ${inspircd_flags="${inspircd_flags} --logfile ${inspircd_logfile} --config ${inspircd_config}"} -command=%%PREFIX%%/bin/inspircd +command=/usr/sbin/daemon +command_args=" -f %%PREFIX%%/bin/inspircd --nofork ${inspircd_flags}" +procname=%%PREFIX%%/bin/inspircd pidfile=${inspircd_pidfile} required_files=${inspircd_config} start_precmd=inspircd_prestart inspircd_prestart() { - piddir=$(dirname ${inspircd_pidfile}) - if [ ! -d ${piddir} ]; then - install -d -m 755 -o ${inspircd_user} -g ${inspircd_group} ${piddir} - fi - logdir=$(dirname ${inspircd_logfile}) - if [ ! -d ${logdir} ]; then - install -d -m 755 -o ${inspircd_user} -g ${inspircd_group} ${logdir} - fi + # inspircd_flags gets applied too early if we don't do this. + # I didn't want to force people to update their rc.conf files + # and change the inspircd_flags to something else. + rc_flags="" + + for i in ${inspircd_pidfile} ${inspircd_logfile}; do + install -d -m 755 -o ${inspircd_user} -g ${inspircd_group} ${i%/*} + done } run_rc_command "$1" |