#!/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"