[Helma-user] debian startscript
Hannes Wallnoefer
hannes at helma.at
Mon Oct 27 13:26:11 CET 2003
Hi Alex,
actually, you don't need startproc/start-stop-daemon to write proper
start scripts. You can use $! to get the PID of the most recently
started background job to create a PID file that will let you stop/check
the running program:
/usr/bin/prog &
echo $! >$PIDFILE
For a practical implementation, have a look at the Jetty start script:
http://cvs.sourceforge.net/viewcvs.py/jetty/Jetty/extra/unix/bin/
hannes
Alex Ostleitner wrote:
> Hi,
>
> does anyone have a startscript for debian? Right now Im messing around
> by replacing startproc by start-stop-daemon, but it seems as if one
> had to replace all the arguments as well. I gave it up for the moment...
>
> btw, maybe someone has a chance to modify the helma script in the
> distribution.
>
> here a way to check the distribution in the script (probably thats
> totally clear to someone more into this than me):
>
> if [ -d /etc/rc2.d ]
> then
> # Debian
> DIST=Debian
> STARTPROG="start-stop-daemon"
> PARAMETERS="--start -b -q --pidfile $PIDFILE --exec $DAEMON $COMMAND"
> else
> # SuSE or RedHat
> DIST=SuSE
> STARTPROG="startproc"
> PARAMETERS="-f $DAEMON $COMMAND"
> fi set -e
>
> case "$1" in
> start)
> echo -n "Starting $DESC: "
> $STARTPROG $PARAMETERS &
>
> ...
>
> thanks,
> a.
>
> _______________________________________________
> Helma-user mailing list
> Helma-user at helma.org
> http://grazia.helma.at/mailman/listinfo/helma-user
>
More information about the Helma-user
mailing list