[Zope] rc script

Tom Deprez tom.deprez@uz.kuleuven.ac.be
Wed, 02 Feb 2000 18:55:29 +0100


Hi,

Now, I'm trying to make it autostart (with ksysv and the following rc)

From mcdonc's how-to and some changes to my system:

                           #! /bin/sh
                           #
                           # processname: zope2

                           # Source function library.
                           . /etc/rc.d/init.d/functions

                           # Get config.
                           . /etc/sysconfig/network

                           # Check that networking is up.
                           if [ ${NETWORKING} = "no" ]
                           then
                                   exit 0
                           fi

                           # See how we were called.
                           case "$1" in
                             start)
                                   echo -n "Starting Zope2 service: "
                                   daemon /usr/local/zope/start 
                                   ;;
                             stop)
                                   echo -n "Stopping Zope2 service: "
                                   /usr/local/zope/stop
                                   ;;
                             restart|reload)
                                   $0 stop
                                   $0 start
                                   ;;
                             *)
                                   echo "Usage: zope {start|stop|restart}"
                                   exit 1
                           esac

                           exit 0

I changed  daemon /usr/local/zope/start 
to  daemon su nobody /usr/local/zope/start &
           ^^^^^^^^^				  ^

and 

/usr/local/zope/stop
to  su nobody /usr/local/zope/stop
    ^^^^^^^^^

Am I allowed to use 'su nobody' in an rc? And using '&' so unix can go
further 
with loading all other modules? Can these give security risks? Is there
another way?

It also looks that 'su nobody' isn't even neseccary. Why? I want to use
Zope with Apache, so I gave permission to nobody to start/stop Zope. How
comes that I don't have to use 'su nobodoy'?

Regards, Tom.