Archive

Archive for November, 2012

add plone to startup /etc/init.d

November 21, 2012 Leave a comment

script that needs to be placed in /etc/init.d/ with permisions to execute chmod +x

chkconfig –add plone
chkconfig plone on

its chkconfig compliant

#!/bin/sh
 #chkconfig: 2345 95 20
 # description: script for plone making a service, not official solution.
 # processname: plone
start () {
 echo -e "Starting plone..."
# start daemon
 sudo -u plone /usr/local/Plone/zinstance/bin/plonectl start
 RETVAL=$?
 if [ $RETVAL = 0 ]
 then
 echo "done."
 else
 echo "failed. See error code for more information."
 fi
 return $RETVAL
 }
 stop () {
 # stop daemon
 echo -e "Stopping plone...\n"
sudo -u plone /usr/local/Plone/zinstance/bin/plonectl stop
 RETVAL=$?
if [ $RETVAL = 0 ]
 then
 echo "done."
 else
 echo "failed. See error code for more information."
 fi
 return $RETVAL
 }
case "$1" in
 start)
 start
 ;;
 stop)
 stop
 ;;
 *)
 echo $"Usage: plone {start|stop}"
 exit 3
 ;;
 esac
exit $RETVALexit $RETVAL
Categories: Linux