2011-01-09 23:10:41 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: openoffice
|
|
|
|
# REQUIRE: NETWORKING SERVERS
|
|
|
|
# BEFORE: DAEMON
|
|
|
|
# KEYWORD: shutdown
|
|
|
|
#
|
|
|
|
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
|
|
|
|
# to enable this service:
|
|
|
|
#
|
|
|
|
# openoffice_enable (bool): Set to NO by default.
|
|
|
|
# Set it to YES to enable openoffice.
|
|
|
|
# openoffice_user (username): Set to www by default.
|
|
|
|
# Set it to required username.
|
|
|
|
# openoffice_group (group): Set to www by default.
|
|
|
|
# Set it to required group.
|
2011-01-15 13:10:57 +01:00
|
|
|
# openoffice_home (string): Set to /var/spool/%%PORTNAME%% by default.
|
|
|
|
# Set it to required dir.
|
2011-01-09 23:10:41 +01:00
|
|
|
# openoffice_bin (string): Set by default - see below.
|
|
|
|
# Set it to soffice.bin path.
|
|
|
|
# openoffice_args (string): Set by default - see below.
|
|
|
|
# Set it to required command line args.
|
|
|
|
#
|
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="openoffice"
|
2012-01-14 09:57:23 +01:00
|
|
|
rcvar=openoffice_enable
|
2011-01-09 23:10:41 +01:00
|
|
|
load_rc_config $name
|
|
|
|
|
|
|
|
: ${openoffice_enable:=NO}
|
|
|
|
: ${openoffice_user:="www"}
|
|
|
|
: ${openoffice_group:="www"}
|
2011-01-15 13:10:57 +01:00
|
|
|
: ${openoffice_home:="/var/spool/%%PORTNAME%%"}
|
2011-01-09 23:10:41 +01:00
|
|
|
: ${openoffice_bin:="%%SOFFICEBIN%%"}
|
|
|
|
: ${openoffice_args:="-accept=socket,host=localhost,port=8100;urp -headless -nofirststartwizard"}
|
|
|
|
|
|
|
|
pidfile=/var/run/${name}.pid
|
|
|
|
command="${openoffice_bin}"
|
|
|
|
start_cmd="${name}_start"
|
|
|
|
start_precmd="${name}_precmd"
|
|
|
|
|
|
|
|
openoffice_start() {
|
|
|
|
echo "Starting ${name}."
|
2011-01-15 13:10:57 +01:00
|
|
|
env HOME=${openoffice_home} /usr/sbin/daemon \
|
|
|
|
-f -p ${pidfile} -u ${openoffice_user} \
|
2011-01-09 23:10:41 +01:00
|
|
|
${openoffice_bin} ${openoffice_args}
|
|
|
|
}
|
|
|
|
|
|
|
|
openoffice_precmd() {
|
|
|
|
touch ${pidfile}
|
|
|
|
chown ${openoffice_user}:${openoffice_group} ${pidfile}
|
|
|
|
}
|
|
|
|
|
|
|
|
run_rc_command "$1"
|