Diskussion:Server/SRS1/2017

Aus Wiki StuRa HTW Dresden
Version vom 12. April 2012, 17:19 Uhr von 141.56.56.93 (Diskussion)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springen Zur Suche springen

Plone startup script

  • aktuell nur für altes Plone

Problem mit su Meldung: su:Sorry

Lösung noch keine gefunden


#!/bin/sh

# PROVIDE: plone
# REQUIRE: DAEMON
# KEYWORD: shutdown

#
# Add the following lines to /etc/rc.conf to enable plone
#
#
# plone_enable (bool):		Set to "NO" by default,
#                              	Set it to "YES" to enable 
#                              	plone
#
# plone_buildout (str):		The path to plone buildout env
#                              	file (defaults to 
#                              	/usr/local/Plone)
#
# plone_user (str):		The username of the user the daemon will
# 		     	       	run as (defaults to www)
#

. /etc/rc.subr

name="plone"
rcvar=`set_rcvar`

load_rc_config $name
eval "${rcvar}=\${${rcvar}:-'NO'}"
plone_buildout=${plone_buildout:-"/usr/local/Plone/zinstance"}
plone_user=${plone_user:-"admin fragen"}

#command="${plone_buildout}/${name}"
#command_interpreter="/bin/sh"

start_cmd="${name}_start"
stop_cmd="${name}_stop"

plone_start()
{
    plone_pid=`pgrep -f "/usr/local/bin/python2.4 ${plone_buildout}"`
    if [ ${plone_pid} ]
        then
	    echo "${name} already running (pid: ${plone_pid})"
        else
            echo "Starting ${name}."
            su ${plone_user} -c "${plone_buildout}/bin/instance start"
    fi

    # ensure the server is started
    plone_pid=`pgrep -f "/usr/local/bin/python2.4 ${plone_buildout}"`
    if [ ${plone_pid} ]
      then
        echo "${name} started."
      else
	echo "${name} could not be started, please check the log files (${plone_buildout}/var/log/)"
    fi 
}


plone_stop()
{
    plone_pid=`pgrep -f "/usr/local/bin/python2.4 ${plone_buildout}"`
    if [ ${plone_pid} ]
	then
	    echo "Stopping ${name}."
	     su ${plone_user} -c "${plone_buildout}/bin/instance stop"
	else
            echo "${name} not running?"
    fi

    # ensure the server is stopped
    plone_pid=`pgrep -f "/usr/local/bin/python2.4 ${plone_buildout}"`
    if [ ${plone_pid} ]
      then
	echo "${name} could not be stopped"
    fi  
}

load_rc_config $name
run_rc_command "$1"