start-stop-daemon and java
Have a question which i think relates to s-s-d more than java but as i've
been learning, what do i know?
part of my init.d script.
------------
APPDIR="/usr/jsyncmanager"
APPUSER="jsync"
ARGS="-Xmx256M -jar jsyncmanager.jar --server"
PIDFILE="/var/run/jsyncmanager.pid"
# Carry out specific functions when asked to by the system
case "$1" in
start)
echo "Starting jsyncmanager"
start-stop-daemon -Sbm -p $PIDFILE -c $APPUSER -d $APPDIR -x
"/usr/bin/java" -- $ARGS
------------
this was derived from a command line
java -Xmx256M -jar jsyncmanager.jar --server 2>>out2 &
The problem is getting a java application to start using an init.d script,
honouring the pidfile to keep it from running more than once (which the
s-s-d does) but also trap stderr in a log file.
if I modify $ARGS to include ...--server 2>>/home/jsync/out2.txt
the out2.txt file never gets created or added to.
there is a ~jsync folder in that location and both root and jsync have
permissions to write there so I'm wondering if this is a quirk of how s-s-d
works.
anyone been in this area themselves?
This is Sarge and JRE 1.5 (build 5 i think)
Confirmation that this is the same or different for non-java stuff would
also be appreciated.
Thanks,
S.
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.13.13/197 - Release Date: 12/9/2005
Reply to: