[Zope] starting as a certain user

cyrille cyrilleml@kbuilder.net
Tue, 22 Oct 2002 16:00:59 +0200


Stephan Goeldi wrote:

>I know that I can start the Zope service as a certain user by adding the
>option -u user to the start script.
>
>Now when i start Zope automatically at bootup through
>/etc/init.d/zope_instance_xy (which calls the start script), the process
>cannot be stopped by the user (-u user), because there exists 1 root
>process beside the user processes. The pid is not owned by the user.
>
>Did I miss something?
>
I'm not a gurru,
but I had a 'su' or 'sudo' command for calling Zope/start script.

in  /etc/init.d/zope
...
# Execute
case "$1" in
    start)
        [ -f ${zopePath}/var/Z2.pid ] && kill -0 `cat 
${zopePath}/var/Z2.pid` >/dev/null 2>&1
        if [ -f ${zopePath}/var/Z2.pid -a "$?" != "0" ] ; then
            echo "Bad stop of zope daemon..."
            echo -n "Restoring zope file:"

            rm -f ${zopePath}/var/Z2.pid
            rm -f ${zopePath}/var/pcgi.soc
            rm -f ${zopePath}/var/Data.fs.lock
            rm -f ${zopePath}/var/zProcessManager.pid

            echo_success
            echo
        fi

        if [ ! -f ${zopePath}/var/Z2.pid ] ; then
            echo -n "Starting zope daemon: "
            #${zopePath}/start &> /dev/null
            # 2002-10-18 mad@ktaland.com
            ###    ${zopePath}/start
            su --command=${zopePath}/start zope &

            while : ; do [ -f ${zopePath}/var/Z2.pid ] && break
                sleep 1 && echo -n '.'
            done
...