[Zope] starting zope in bsd

David Bear David.Bear at asu.edu
Fri Dec 12 12:12:30 EST 2003


On Fri, Dec 12, 2003 at 10:31:03AM +0100, PieterB wrote:
> > How can I get the startup scripts
> > to launch zope as user 'www'?
> Install /usr/ports/security/sudo and use something like:
> sudo -u zopeuser /path/to/zope/start
> 
> That way FreeBSD will make sure the startup script of Zope is
> executed as user 'zopeuser'.
> 

Thanks for all the replies.  Below is the script I wrote to start
zope.  Its simple.. I'd appreciate any comments on how it might be
enhanced.


#!/bin/sh
#
# zope startup for bsd rc script by David Bear
#
ZHOME="/somevol/somedir"
ZSTART=${ZHOME}"/start"
ZSTOP=${ZHOME}"/stop"
ZUSER="www"  # or whoever the web user is
SUCMD="/usr/bin/su"
case "$1" in
        'start')
                echo "Starting Zope "
		if test -x ${ZSTART} ; then
		 	${SUCMD} ${ZUSER} "-c" ${ZSTART} &
		fi
                ;;
        'stop')
                echo "Stoping Zope"
		if test -x ${ZSTOP} ; then
			${ZSTOP}
		fi
		;;
	*)
		echo "Usage: $0 {start|stop}"
		;;
esac



-- 
David Bear
phone: 	480-965-8257
fax: 	480-965-9189
College of Public Programs/ASU
Wilson Hall 232
Tempe, AZ 85287-0803
 "Beware the IP portfolio, everyone will be suspect of trespassing"



More information about the Zope mailing list