blob: 1bec33245d7a91f847c50dd3f6ff12cf52a2f900 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
#!/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.
# openoffice_home (string): Set to /var/spool/%%PORTNAME%% by default.
# Set it to required dir.
# 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"
rcvar=${name}_enable
load_rc_config $name
: ${openoffice_enable:=NO}
: ${openoffice_user:="www"}
: ${openoffice_group:="www"}
: ${openoffice_home:="/var/spool/%%PORTNAME%%"}
: ${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}."
env HOME=${openoffice_home} /usr/sbin/daemon \
-f -p ${pidfile} -u ${openoffice_user} \
${openoffice_bin} ${openoffice_args}
}
openoffice_precmd() {
touch ${pidfile}
chown ${openoffice_user}:${openoffice_group} ${pidfile}
}
run_rc_command "$1"
|