Hello
What should I do to activate and start parsoid ( server.js) automatically when the server starts working?
CentOS 6.7
Thanks
Not familiar w/ CentOS
Hello
What should I do to activate and start parsoid ( server.js) automatically when the server starts working?
CentOS 6.7
Thanks
None of us are familiar with CentOS 6.7 .. but, someone showed up on IRC recently (not sure if it was you or someone else) asking about CentOS 6.* and said that they would give us updated instructions once they get it figured out. At that point, we'll update our setup instructions so others on similar installs can benefit from it. But, at this point, we ourselves are not able to help you out directly. Sorry about that.
Assuming that you have created a /etc/init.d/parsoid script, to make parsoid auto-start (on centos 6) you need to run (once):
chkconfig parsoid on
BTW, our /etc/init.d/parsoid script is:
#! /bin/bash
#
# parsoid start
#
# chkconfig: 345 86 14
# description: parsoid
#
### BEGIN INIT INFO
# Provides: $parsoid
### END INIT INFO
# Source function library.
. /etc/init.d/functions
rc=0
# See how we were called.
case "$1" in
start)
echo starting parsoid
cd /opt/parsoid
nohup node /opt/parsoid/bin/server.js > /dev/null 2>&1 &
$0 status
;;
stop)
process=`ps -ef | grep 'node /opt/parsoid/bin/server.js'| grep -v grep | awk '{print $2}'`
if [ "${process}" != '' ]
then
echo stopping parsoid
killall -9 node
fi
$0 status
;;
status)
proc_find=`ps -ef | grep 'node /opt/parsoid/bin/server.js'| grep -v grep`
if [ "${proc_find}" = '' ]
then
echo parsoid is not running
else
echo parsoid is running: ${proc_find}
fi
;;
restart|reload)
cd "$CWD"
$0 status
$0 stop
$0 start
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac
exit $rc