mirror of
https://github.com/beard7n/bsdports.git
synced 2026-04-13 20:11:19 +02:00
create bsd12 branch
This commit is contained in:
102
java/openfire4/files/openfire.in
Normal file
102
java/openfire4/files/openfire.in
Normal file
@@ -0,0 +1,102 @@
|
||||
#!/bin/sh
|
||||
|
||||
# PROVIDE: openfire
|
||||
# REQUIRE: NETWORKING SERVERS
|
||||
# BEFORE: DAEMON
|
||||
# KEYWORD: shutdown
|
||||
#
|
||||
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
|
||||
# to enable this service:
|
||||
#
|
||||
# openfire_enable (bool): Set to NO by default.
|
||||
# Set it to YES to enable openfire.
|
||||
# openfire_user (username): Set to openfire by default.
|
||||
# Set it to required username.
|
||||
# openfire_group (group): Set to openfire by default.
|
||||
# Set it to required group.
|
||||
# openfire_libdir (path): Set to %%DATADIR%%/lib by default.
|
||||
# Set it to java classes directory.
|
||||
# openfire_home (path): Set to %%DATADIR%% by default.
|
||||
# Set it to java home directory.
|
||||
# openfire_javargs (args): Set to -Xmx256M by default.
|
||||
# See java -h for available arguments.
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="openfire"
|
||||
rcvar=openfire_enable
|
||||
load_rc_config $name
|
||||
|
||||
# Set defaults
|
||||
: ${openfire_enable:=NO}
|
||||
: ${openfire_user:=${name}}
|
||||
: ${openfire_group:=${name}}
|
||||
: ${openfire_libdir:=%%DATADIR%%/lib}
|
||||
: ${openfire_home:=%%DATADIR%%}
|
||||
: ${openfire_javargs:='-Xmx256M'}
|
||||
|
||||
pidfile=/var/run/${name}.pid
|
||||
|
||||
required_files="%%ETCDIR%%/openfire.xml"
|
||||
java_options=" -server -jar ${openfire_javargs} \
|
||||
-Dopenfire.lib.dir=${openfire_libdir} \
|
||||
-DopenfireHome=${openfire_home}"
|
||||
|
||||
java_command=" %%LOCALBASE%%/bin/java ${java_options} \
|
||||
%%DATADIR%%/lib/startup.jar"
|
||||
|
||||
# Subvert the check_pid_file procname check.
|
||||
if [ -f $pidfile ]; then
|
||||
read rc_pid junk < $pidfile
|
||||
if [ ! -z "$rc_pid" ]; then
|
||||
procname=`ps -o command= $rc_pid | awk '{print $1 }'`
|
||||
fi
|
||||
fi
|
||||
|
||||
command="/usr/sbin/daemon"
|
||||
command_args="-f -p ${pidfile} ${java_command}"
|
||||
start_precmd="openfire_precmd"
|
||||
status_cmd="openfire_status"
|
||||
stop_cmd="openfire_stop"
|
||||
|
||||
openfire_precmd() {
|
||||
touch ${pidfile}
|
||||
chown ${openfire_user}:${openfire_group} ${pidfile}
|
||||
}
|
||||
|
||||
openfire_status() {
|
||||
rc_pid=$(check_pidfile $pidfile *$procname*)
|
||||
|
||||
if [ -z "$rc_pid" ]; then
|
||||
[ -n "$rc_fast" ] && return 0
|
||||
if [ -n "$pidfile" ]; then
|
||||
echo "${name} not running? (check $pidfile)."
|
||||
else
|
||||
echo "${name} not running?"
|
||||
fi
|
||||
return 1
|
||||
fi
|
||||
echo "$name is running as pid ${rc_pid}"
|
||||
}
|
||||
|
||||
|
||||
openfire_stop() {
|
||||
rc_pid=$(check_pidfile $pidfile *$procname*)
|
||||
|
||||
if [ -z "$rc_pid" ]; then
|
||||
[ -n "$rc_fast" ] && return 0
|
||||
if [ -n "$pidfile" ]; then
|
||||
echo "${name} not running? (check $pidfile)."
|
||||
else
|
||||
echo "${name} not running?"
|
||||
fi
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "Stopping ${name}."
|
||||
kill ${rc_pid}
|
||||
wait_for_pids ${rc_pid}
|
||||
rm ${pidfile}
|
||||
}
|
||||
|
||||
run_rc_command "$1"
|
||||
42
java/openfire4/files/pkg-install.in
Normal file
42
java/openfire4/files/pkg-install.in
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -x
|
||||
|
||||
case $2 in
|
||||
PRE-INSTALL)
|
||||
|
||||
OPENFIRE_GROUP="%%OPENFIRE_GROUP%%"
|
||||
OPENFIRE_OWNER="%%OPENFIRE_OWNER%%"
|
||||
|
||||
OPENFIRE_GROUP_ID="%%OPENFIRE_GROUP_ID%%"
|
||||
OPENFIRE_OWNER_ID="%%OPENFIRE_OWNER_ID%%"
|
||||
|
||||
PKG_PREFIX="%%PREFIX%%"
|
||||
OPENFIRE_LOGDIR="%%OPENFIRE_LOGDIR%%"
|
||||
OPENFIRE_DBDIR="%%OPENFIRE_DBDIR%%"
|
||||
OPENFIRE_ETCDIR="%%OPENFIRE_ETCDIR%%"
|
||||
|
||||
OPENFIRE_NAME="openfire"
|
||||
OPENFIRE_SHELL="/bin/sh"
|
||||
OPENFIRE_HOME="%%HOME%%"
|
||||
|
||||
pw group add ${OPENFIRE_GROUP} -g ${OPENFIRE_GROUP_ID}
|
||||
pw group show ${OPENFIRE_GROUP}
|
||||
pw user add ${OPENFIRE_OWNER} -u ${OPENFIRE_OWNER_ID} \
|
||||
-g ${OPENFIRE_GROUP} \
|
||||
-d ${OPENFIRE_HOME} \
|
||||
-s "${OPENFIRE_SHELL}" -u ${OPENFIRE_OWNER_ID} \
|
||||
-c "${OPENFIRE_NAME}"
|
||||
pw group mod ${OPENFIRE_GROUP} -M ${OPENFIRE_OWNER}
|
||||
pw user show ${OPENFIRE_OWNER}
|
||||
pw group show ${OPENFIRE_GROUP}
|
||||
install -d -o ${OPENFIRE_OWNER} -g ${OPENFIRE_GROUP} -m 0750 ${OPENFIRE_DBDIR}
|
||||
install -d -o ${OPENFIRE_OWNER} -g ${OPENFIRE_GROUP} -m 0750 ${OPENFIRE_LOGDIR}
|
||||
install -d -o ${OPENFIRE_OWNER} -g ${OPENFIRE_GROUP} -m 0750 ${OPENFIRE_ETCDIR}
|
||||
|
||||
;;
|
||||
POST-INSTALL)
|
||||
;;
|
||||
esac
|
||||
exit 0
|
||||
#EOF
|
||||
12
java/openfire4/files/pkg-message.in
Normal file
12
java/openfire4/files/pkg-message.in
Normal file
@@ -0,0 +1,12 @@
|
||||
-----------------------------------------------------------
|
||||
To enable the openfire startup script please add
|
||||
openfire_enable="YES" to your /etc/rc.conf file.
|
||||
|
||||
The following sample configuration files have been
|
||||
placed in %%EXAMPLESDIR%%:
|
||||
|
||||
openfire.xml.sample
|
||||
security.xml.sample
|
||||
keystore.sample
|
||||
truststore.sample
|
||||
-----------------------------------------------------------
|
||||
Reference in New Issue
Block a user