Hi,
I use this script:
#!/bin/sh
#
# semantic_turkey This shell script takes care of starting and stopping
# the Semantic Turkey server
#
# chkconfig: 345 96 30
# description: Manage Semantic Turkey service
# processname: java
# Source function library.
. /etc/rc.d/init.d/functions
JAVA_HOME='/usr/java/jdk1.7.0_60/'
PATH=$JAVA_HOME/bin:$PATH
ST_HOME="/opt/semantic-turkey/semanticturkey-0.11"
PIDFILE="/var/run/semantic-turkey.pid"
PROG="Semantic Turkey"
RETVAL=0
USER="java"
cd $ST_HOME/bin
CMD="./st_server_run"
export JAVA_HOME PATH
start() {
echo -n "Starting $PROG ..."
su $USER -c "$CMD start > /dev/null 2>&1 &"
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo_success
else
echo_failure
fi
}
stop() {
echo -n "Stopping $PROG ..."
su $USER -c "$CMD stop > /dev/null 2>&1"
RETVAL=$?
echo
if [ $RETVAL = 0 ]; then
echo_success
else
echo_failure
fi
}
case "$1" in
'start')
start
;;
'stop')
stop
;;
*)
echo "Please supply an argument [start|stop]"
esac
HTH,
Cristian
--
You received this message because you are subscribed to the Google Groups "vocbench-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vocbench-use...@googlegroups.com.
Visit this group at https://groups.google.com/group/vocbench-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/vocbench-user/fd687624-300c-483f-99ca-ef37b73539ae%40googlegroups.com.
Dear Thomas,
sorry I’m traveling quite often in these two weeks and it’s hard to follow the list.
I will try to make one step back from where you are now:
Have you read this?
http://karaf.apache.org/manual/latest-2.x/users-guide/start-stop.html
the recommended script here for background work is “start”.
Pls let us know if it works,
Cheers,
Armando
Da: vocben...@googlegroups.com [mailto:vocben...@googlegroups.com] Per conto di Thomas Francart
Inviato: lunedì 16 maggio 2016 18:24
A: Cristian Romanescu <cristian....@gmail.com>
Cc: vocbench-user <vocben...@googlegroups.com>
Oggetto: Re: [vocbench-user] Re: Running semanticturkey on startup ?
To view this discussion on the web visit https://groups.google.com/d/msgid/vocbench-user/CAPugn7X8rfNSSA%3DPkjUncHk3OG_hsHcJDE6ztPzj0iuYmDuJyQ%40mail.gmail.com.
Many thanks for your answers
Thomas
#!/bin/sh
#
# semantic_turkey This shell script takes care of starting and stopping
# the Semantic Turkey server
#
# chkconfig: 345 96 30
# description: Manage Semantic Turkey service
# processname: Semantic Turkey
JAVA_HOME='/usr/lib/jvm/java-8-openjdk-amd64'
PATH=$JAVA_HOME/bin:$PATH
ST_HOME="/var/lib/semanticturkey/semanticturkey-0.12-2016-01-19"
PIDFILE="/var/run/semantic-turkey.pid"
PROG="Semantic Turkey"
RETVAL=0
USER="root"
cd $ST_HOME/bin
# CMD="./st_server_run"
export JAVA_HOME PATH
start() {
echo -n "Starting $PROG ..."
su $USER -c "./start > /dev/null 2>&1 &"
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo "Success"
else
echo "Failed !"
fi
}
stop() {
echo -n "Stopping $PROG ..."
su $USER -c "./stop > /dev/null 2>&1"
RETVAL=$?
echo
if [ $RETVAL = 0 ]; then
echo "Success"
else
echo "Failed !"
fi
}
case "$1" in
'start')
start
;;
'stop')
stop
;;
*)
echo "Please supply an argument [start|stop]"
esac
Yes, the script works when launching "/bin/start" instead of "/bin/st_server_run". The procedure was as follow :
- create /etc/init.d/semanticturkey with the content below;
- test the script with "/etc/init.d/semanticserver start"
- systemctl daemon-reload (don't know if this is really useful)
- add the service to startup services : update-rc.d semanticturkey defaults
--
You received this message because you are subscribed to the Google Groups "vocbench-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vocbench-user+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/vocbench-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/vocbench-user/de859c0d-cfea-49e8-8686-84938aa2041d%40googlegroups.com.