pkgsrc/chat/jabberd2/files/c2s.sh
gdt 72b3794141 Change sub-daemon start order
Drop dependency of router, sm, s2s on c2s.  This did not make sense --
none of them care if c2s runs.

c2s, s2s, and sm all connect to router.  So make them depend on
router, even though in theory they should retry.

Make c2s depend on sm, because if someone tries to log in before sm is
running, they will get a failure, and some clients do not retry
correctly.  Getting ECONNREFUSED connecting to c2s is more likely to
be handled correctly.

No PKGREVISION; riding the impending update.

(Tested on netbsd-6 i386 in a domU.)
2017-01-06 01:52:20 +00:00

43 lines
813 B
Bash
Executable file

#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: c2s.sh,v 1.5 2017/01/06 01:52:20 gdt Exp $
#
# PROVIDE: c2s
# REQUIRE: DAEMON router sm
if [ -f /etc/rc.subr ]; then
. /etc/rc.subr
fi
name="c2s"
rcvar=$name
command="@PREFIX@/bin/${name}"
required_files="@PKG_SYSCONFDIR@/${name}.xml"
extra_commands="reload"
command_args="2>&1 >/dev/null &"
c2s_user="@JABBERD_USER@"
pidfile="@JABBERD_PIDDIR@/${name}.pid"
stop_postcmd="remove_pidfile"
start_precmd="ensure_piddir"
ensure_piddir()
{
mkdir -p @JABBERD_PIDDIR@
chown @JABBERD_USER@ @JABBERD_PIDDIR@
ulimit -n 1024
}
remove_pidfile()
{
if [ -f @JABBERD_PIDDIR@/${name}.pid ]; then
rm -f @JABBERD_PIDDIR@/${name}.pid
fi
}
if [ -f /etc/rc.subr ]; then
load_rc_config $name
run_rc_command "$1"
else
@ECHO@ -n " ${name}"
${command} ${c2s_flags} ${command_args}
fi