Changeset View
Changeset View
Standalone View
Standalone View
www/collaboraonline/files/collaboraonline.in
- This file was added.
| #!/bin/sh | |||||
| # PROVIDE: collaboraonline | |||||
| # REQUIRE: DAEMON | |||||
| # KEYWORD: shutdown | |||||
| # | |||||
| # Add the following lines to /etc/rc.conf to enable this service: | |||||
| # | |||||
| # collaboraonline_enable: Set to NO by default. Set it to YES to enable it. | |||||
| # collaboraonline_flags: Additional command line flags to pass to coolwsd | |||||
| # | |||||
| . /etc/rc.subr | |||||
| name=collaboraonline | |||||
| desc="Collabora Online Web Sockets Server" | |||||
| rcvar=collaboraonline_enable | |||||
| start_cmd="${name}_start" | |||||
| start_precmd="${name}_prestart" | |||||
| stop_cmd="${name}_stop" | |||||
| status_cmd="${name}_status" | |||||
| extra_commands="status" | |||||
| load_rc_config $name | |||||
| : ${collaboraonline_enable:=NO} | |||||
| : ${collaboraonline_flags=""} | |||||
| collabora_home="/var/db/collaboraonline" | |||||
| pidfile="/var/run/coolwsd.pid" | |||||
| flags="--o:sys_template_path=$collabora_home/systemplate --o:child_root_path=$collabora_home/child-roots --o:file_server_root_path=%%PREFIX%%/share/coolwsd --o:logging.file[@enable]=true --o:logging.file.property[@path]=/var/log/coolwsd.log --disable-ssl --disable-cool-user-checking" | |||||
| collaboraonline_prestart() | |||||
| { | |||||
| if [ ! -d ${collabora_home} ]; then | |||||
| mkdir -m 700 ${collabora_home} | |||||
| fi | |||||
| } | |||||
| collaboraonline_start() | |||||
| { | |||||
| check_startmsgs && echo "Starting ${name}." | |||||
| # su -l cool -c "exec %%PREFIX%%/bin/coolwsd ${flags} ${collaboraonline_flags}" | |||||
| cd $collabora_home && /usr/sbin/daemon -p $pidfile ${command} \ | |||||
| %%PREFIX%%/bin/coolwsd ${flags} ${collaboraonline_flags} 2>&1 > /dev/null | |||||
| } | |||||
| collaboraonline_stop() | |||||
| { | |||||
| [ -f $pidfile ] \ | |||||
| && /bin/kill -INT `cat $pidfile` \ | |||||
| || echo ${name} not running? \(check ${pidfile}\) | |||||
| } | |||||
| collaboraonline_status() | |||||
| { | |||||
| [ -f $pidfile ] \ | |||||
| && echo ${name} is running as pid `cat $pidfile` \ | |||||
| || echo ${name} is not running. | |||||
| } | |||||
| run_rc_command "$1" | |||||