1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-27 00:57:50 +00:00

- Add rcng'ified startup-script

- Move pid-file to /var/spool/jabber/ (/var/run/ would be better but we
    can't use it since jabberd drops its privs to early)

PR:		ports/77028
Submitted by:	Vivek Khera
This commit is contained in:
Volker Stolz 2005-03-10 16:27:39 +00:00
parent 15e9280a69
commit c9c05d2623
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=130815
6 changed files with 60 additions and 64 deletions

View File

@ -19,6 +19,7 @@ COMMENT= Online presence and instant messaging server
LIB_DEPENDS= pth.20:${PORTSDIR}/devel/pth \
expat.5:${PORTSDIR}/textproc/expat2
USE_RC_SUBR= yes
USE_BZIP2= yes
GNU_CONFIGURE= yes
USE_GMAKE= yes
@ -45,6 +46,6 @@ post-configure:
post-install:
PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
${INSTALL_DATA} ${FILESDIR}/jabberd.sh ${PREFIX}/etc/rc.d/
${INSTALL_SCRIPT} ${FILESDIR}/jabberd.sh ${PREFIX}/etc/rc.d/
.include <bsd.port.mk>

View File

@ -1,38 +1,35 @@
#!/bin/sh
#
if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/jabberd\.sh\$"); then
echo "$0: Cannot determine the PREFIX" >&2
exit 1
fi
# PROVIDE: jabber
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable rsyncd:
#
#jabber_enable="YES"
#
. /usr/local/etc/rc.subr
name=jabber
rcvar=`set_rcvar`
command=/usr/local/sbin/jabberd
required_files=/usr/local/etc/${name}.xml
USER="jabber"
RUNDIR="/var/tmp"
HOSTNAME=`/bin/hostname`
test -x ${PREFIX}/sbin/jabberd || exit 1
# set defaults
export PATH=/sbin:/bin:/usr/bin:${PREFIX}/bin:${PREFIX}/sbin
umask 077
jabber_enable=${jabber_enable:-"NO"}
jabber_pidfile=${jabber_pidfile:-"/var/spool/jabber/${name}.pid"}
jabber_flags=${jabber_flags:-"-B -h ${HOSTNAME} -c ${required_files}"}
jabber_user=${jabber_user:-"jabber"}
jabber_group=${jabber_group:-"jabber"}
echo -n " jabberd "
cd ${RUNDIR} || exit
pidfile=${jabber_pidfile}
case ${1:-start} in
start)
if [ -f jabber.pid ]; then
pid=`cat jabber.pid`
if [ ! -z "$pid" ] && kill -0 -- "$pid"; then
echo "A pidfile already exists at the specified location."
echo "Check to ensure another copy of the server is not running, or remove the existing file."
exit 1
fi
rm -f ${RUNDIR}/jabber.pid;
fi
su -f -m ${USER} -c "jabberd -B -h ${HOSTNAME} -c ${PREFIX}/etc/jabber.xml"
;;
stop)
killall -SIGKILL -u ${USER} jabberd;
rm -f ${RUNDIR}/jabber.pid;
esac
load_rc_config ${name}
run_rc_command "$1"

View File

@ -43,7 +43,7 @@
This specifies the file to store the pid of the process in.
-->
- <pidfile>./jabber.pid</pidfile>
+ <pidfile>/var/tmp/jabber.pid</pidfile>
+ <pidfile>/var/spool/jabber/jabber.pid</pidfile>
</jabber>

View File

@ -19,6 +19,7 @@ COMMENT= Online presence and instant messaging server
LIB_DEPENDS= pth.20:${PORTSDIR}/devel/pth \
expat.5:${PORTSDIR}/textproc/expat2
USE_RC_SUBR= yes
USE_BZIP2= yes
GNU_CONFIGURE= yes
USE_GMAKE= yes
@ -45,6 +46,6 @@ post-configure:
post-install:
PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
${INSTALL_DATA} ${FILESDIR}/jabberd.sh ${PREFIX}/etc/rc.d/
${INSTALL_SCRIPT} ${FILESDIR}/jabberd.sh ${PREFIX}/etc/rc.d/
.include <bsd.port.mk>

View File

@ -1,38 +1,35 @@
#!/bin/sh
#
if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/jabberd\.sh\$"); then
echo "$0: Cannot determine the PREFIX" >&2
exit 1
fi
# PROVIDE: jabber
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable rsyncd:
#
#jabber_enable="YES"
#
. /usr/local/etc/rc.subr
name=jabber
rcvar=`set_rcvar`
command=/usr/local/sbin/jabberd
required_files=/usr/local/etc/${name}.xml
USER="jabber"
RUNDIR="/var/tmp"
HOSTNAME=`/bin/hostname`
test -x ${PREFIX}/sbin/jabberd || exit 1
# set defaults
export PATH=/sbin:/bin:/usr/bin:${PREFIX}/bin:${PREFIX}/sbin
umask 077
jabber_enable=${jabber_enable:-"NO"}
jabber_pidfile=${jabber_pidfile:-"/var/spool/jabber/${name}.pid"}
jabber_flags=${jabber_flags:-"-B -h ${HOSTNAME} -c ${required_files}"}
jabber_user=${jabber_user:-"jabber"}
jabber_group=${jabber_group:-"jabber"}
echo -n " jabberd "
cd ${RUNDIR} || exit
pidfile=${jabber_pidfile}
case ${1:-start} in
start)
if [ -f jabber.pid ]; then
pid=`cat jabber.pid`
if [ ! -z "$pid" ] && kill -0 -- "$pid"; then
echo "A pidfile already exists at the specified location."
echo "Check to ensure another copy of the server is not running, or remove the existing file."
exit 1
fi
rm -f ${RUNDIR}/jabber.pid;
fi
su -f -m ${USER} -c "jabberd -B -h ${HOSTNAME} -c ${PREFIX}/etc/jabber.xml"
;;
stop)
killall -SIGKILL -u ${USER} jabberd;
rm -f ${RUNDIR}/jabber.pid;
esac
load_rc_config ${name}
run_rc_command "$1"

View File

@ -43,7 +43,7 @@
This specifies the file to store the pid of the process in.
-->
- <pidfile>./jabber.pid</pidfile>
+ <pidfile>/var/tmp/jabber.pid</pidfile>
+ <pidfile>/var/spool/jabber/jabber.pid</pidfile>
</jabber>