Autostart OpenKM on boot - FreeBSD 9.0 RELEASE - 2012/02/28
PostPosted:Mon Feb 27, 2012 6:58 am
Hi Just thought of share the script I used for autostart OpenKM at boot in FreeBSD 9.0 RELEASE.
This is my /usr/local/etc/rc.d/openkm.sh
/usr/local/etc/rc.d/soffice.sh
I haven't tried with soffice_flags for soffice, I will check and post if sucessful.
Hope this helps someone.
Cheers,
EDIT: last edited to improve OpenKM starting and shutting down process and modify Java to Sun Java as with OpenJDK I had some issues in properly starting OpenKM.war.
This is my /usr/local/etc/rc.d/openkm.sh
Code: Select all
and add the following to /etc/rc.conf#!/bin/sh
#
#
#
# PROVIDE: openkm
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf to enable openkm:
#
# openkm_enable="YES"
#
. /etc/rc.subr
name=openkm
rcvar=`set_rcvar`
start_cmd="${name}_start"
stop_cmd="${name}_stop"
openkm_start()
{
echo "Starting OpenKM...."
/home/okmuser/jboss/bin/run.sh -b 0.0.0.0 &
}
openkm_stop()
{
echo "Shutting down OpenKM...."
/home/okmuser/jboss/bin/shutdown.sh -S
}
# set defaults
openkm_enable=${openkm_enable:-"NO"}
load_rc_config ${name}
JAVA_HOME="/usr/local/linux-sun-jdk1.6.0/";
export JAVA_HOME
run_rc_command "$1"
Code: Select all
For some reason openkm in FreeBSD doesn't start libreoffice at startup so at the moment I start soffice manually.openkm_enable="YES"
/usr/local/etc/rc.d/soffice.sh
Code: Select all
and add the following to /etc/rc.conf#!/bin/sh
#
#
#
# PROVIDE: soffice
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf to enable soffice:
#
# soffice_enable="YES"
#
. /etc/rc.subr
name=soffice
rcvar=`set_rcvar`
command="/usr/local/lib/libreoffice/program/soffice[b]x[/b].sh"
# set defaults
soffice_enable=${soffice_enable:-"YES"}
load_rc_config ${name}
run_rc_command "$1"
Code: Select all
and create a sofficex file in /usr/local/lib/libreoffice/program/ withsoffice_enable="YES"
Code: Select all
please note the above code (/usr/local...... -norestore &) is on single line.#!/bin/sh
#
/usr/local/lib/libreoffice/program/soffice "-accept=socket,host=127.0.0.1,port=2222,tcpNoDelay=1;urp;" -headless -nodefault
-nofirststartwizard -nolockcheck -nologo -norestore &
I haven't tried with soffice_flags for soffice, I will check and post if sucessful.
Hope this helps someone.
Cheers,
EDIT: last edited to improve OpenKM starting and shutting down process and modify Java to Sun Java as with OpenJDK I had some issues in properly starting OpenKM.war.