Hello Norbert Wojtowicz!
On Sun, 05 Nov 2006 23:21:31 -0600 you wrote:
> I am also interested in how others have solved this. I hope I'm not
> hijacking the thread, but could we see your Debian approach to this
> problem?
init.d file:
#! /bin/sh
### BEGIN INIT INFO
# Provides: anastas-fcgi
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: Anastasia FastCGI daemon
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
### END INIT INFO
set -e
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="Anastasia FastCGI daemon"
NAME=manage.py
DAEMON=/var/www/vhosts/domain.com/anastas/$NAME
SCRIPTNAME=/etc/init.d/anastas-fcgi
PIDFILE=/var/www/vhosts/domain.com/anastas/anastas-fcgi.pid
MINSPARE=5
MAXSPARE=10
MAXCHILDREN=100
# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0
#
# Function that starts the daemon/service.
#
d_start() {
start-stop-daemon --start --quiet -c anastas7
--pidfile=$PIDFILE \ --exec $DAEMON -- runfcgi host=127.0.0.1 port=8000
daemonize=true \ pidfile=$PIDFILE \
minspare=$MINSPARE maxspare=$MAXSPARE
maxchildren=$MAXCHILDREN \ method=prefork \
|| echo -n " already running"
}
#
# Function that stops the daemon/service.
#
d_stop() {
start-stop-daemon --stop --quiet -c anastas7 --pidfile=$PIDFILE
\ || echo -n " not running"
}
case "$1" in
start)
echo -n "Starting $DESC: $NAME"
d_start
echo "."
;;
stop)
echo -n "Stopping $DESC: $NAME"
d_stop
echo "."
;;
restart|force-reload)
#
# If the "reload" option is implemented, move the
"force-reload" # option to the "reload" entry above. If not,
"force-reload" is # just the same as "restart".
#
echo -n "Restarting $DESC: $NAME"
d_stop
# One second might not be time enough for a daemon to stop,
# if this happens, d_start will fail (and dpkg will break if
# the package is being upgraded). Change the timeout if needed
# be, or change d_stop to have start-stop-daemon use --retry.
# Notice that using --retry slows down the shutdown process
somewhat. sleep 2
d_start
echo "."
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
exit 3
;;
esac
exit 0
then:
sudo update-rc.d anastas-fcgi defaults
--
Всего наилучшего! Григорий
greg [at] anastasia [dot] ru
Письмо отправлено: 2006/11/06 16:38
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---