[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Problem starting and stopping the jetty daemon



I'm having problems starting and stopping the jetty daemon when I
invoke /etc/init.d/jetty start/stop as root.

The problem appears to be that the recorded PID in /var/run/jetty.pid is
for the "su" command(root) and not for the process launched by "su"
running as the "jetty" user. See command sequence below which supports
this conclusion...

Any help here would be greatly appreciated.

====== From /etc/init.d/jetty:
su -p -s /bin/sh $JETTY_USER \
     -c "$JAVA $ARGUMENTS"   >> $LOGDIR/out.log 2>&1  &
# FIX!!! How do we get the PID for the $JAVA command
# running as $JETTY_USER?
echo $! > "$PIDFILE"
======




# start-stop-daemon --test --start  --pidfile /var/run/jetty.pid
--startas /usr/lib/j2sdk1.5-sun/bin/java
process already running.
# start-stop-daemon --test --start --pidfile /var/run/jetty.pid --user
jetty --startas /usr/lib/j2sdk1.5-sun/bin/java
Would start /usr/lib/j2sdk1.5-sun/bin/java .
# cat /var/run/jetty.pid 
5775
# start-stop-daemon --test --start --pidfile /var/run/jetty.pid --user
root --startas /usr/lib/j2sdk1.5-sun/bin/java
process already running.
# ps -U jetty   
  PID TTY          TIME CMD
 5776 pts/0    00:00:03 java



-- 
Øyvind Harboe
http://www.zylin.com



Reply to: