JSVC Doesn't Properly Daemonize ------------------------------- Key: DAEMON-127 URL: https://issues.apache.org/jira/browse/DAEMON-127 Project: Commons Daemon Issue Type: Bug Environment: ubuntu hardy Reporter: Ben Murphy Priority: Minor
One of the JSVC processes doesn't seem to properly detach from my console. It still has fds attached to my console. I have jsvc version: 1.0.2~svn20061127-6 I start tomcat with the following command line: /usr/bin/jsvc -user root -cp /usr/share/java/commons-daemon.jar:/opt/tomcat/bin/bootstrap.jar -outfile SYSLOG -errfile SYSLOG -pidfile /var/run/mcs.pid -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=18801 -Xmx2048M -Xms128M -XX:MaxPermSize=256m -XX:PermSize=256m -Djava.awt.headless=true -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/mcs/temp/ -XX:+PrintGCDetails -Djava.endorsed.dirs=/opt/tomcat/endorsed -Dcatalina.base=/opt/mcs -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/tmp/tomcat6-temp -Djava.security.manager -Djava.security.policy=/opt/mcs/work/catalina.policy -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/opt/mcs/conf/logging.properties org.apache.catalina.startup.Bootstrap I see three processes: root 26452 0.0 0.0 16516 364 ? Ss 11:31 0:00 /usr/bin/jsvc -user root -cp /usr/share/java/commons-daemon.jar:/opt/tomcat/bin/bootstrap.jar -outfile SYSLOG -errfile SYSLOG -pidfile /var/run/mcs.pid -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=18801 -Xmx2048M -Xms128M -XX:MaxPermSize=256m -XX:PermSize=256m -Djava.awt.headless=true -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/mcs/temp/ -XX:+PrintGCDetails -Djava.endorsed.dirs=/opt/tomcat/endorsed -Dcatalina.base=/opt/mcs -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/tmp/tomcat6-temp -Djava.security.manager -Djava.security.policy=/opt/mcs/work/catalina.policy -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/opt/mcs/conf/logging.properties org.apache.catalina.startup.Bootstrap root 26453 0.0 0.0 16516 492 ? S 11:31 0:00 /usr/bin/jsvc -user root -cp /usr/share/java/commons-daemon.jar:/opt/tomcat/bin/bootstrap.jar -outfile SYSLOG -errfile SYSLOG -pidfile /var/run/mcs.pid -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=18801 -Xmx2048M -Xms128M -XX:MaxPermSize=256m -XX:PermSize=256m -Djava.awt.headless=true -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/mcs/temp/ -XX:+PrintGCDetails -Djava.endorsed.dirs=/opt/tomcat/endorsed -Dcatalina.base=/opt/mcs -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/tmp/tomcat6-temp -Djava.security.manager -Djava.security.policy=/opt/mcs/work/catalina.policy -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/opt/mcs/conf/logging.properties org.apache.catalina.startup.Bootstrap root 26455 113 11.1 2600428 233484 ? Rl 11:31 0:14 /usr/bin/jsvc -user root -cp /usr/share/java/commons-daemon.jar:/opt/tomcat/bin/bootstrap.jar -outfile SYSLOG -errfile SYSLOG -pidfile /var/run/mcs.pid -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=18801 -Xmx2048M -Xms128M -XX:MaxPermSize=256m -XX:PermSize=256m -Djava.awt.headless=true -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/mcs/temp/ -XX:+PrintGCDetails -Djava.endorsed.dirs=/opt/tomcat/endorsed -Dcatalina.base=/opt/mcs -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/tmp/tomcat6-temp -Djava.security.manager -Djava.security.policy=/opt/mcs/work/catalina.policy -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/opt/mcs/conf/logging.properties org.apache.catalina.startup.Bootstrap if i check what processes have opened my pty i get: r...@staging:~# lsof /dev/pts/2 COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME bash 25266 root 0u CHR 136,2 4 /dev/pts/2 bash 25266 root 1u CHR 136,2 4 /dev/pts/2 bash 25266 root 2u CHR 136,2 4 /dev/pts/2 bash 25266 root 255u CHR 136,2 4 /dev/pts/2 jsvc 26453 root 1u CHR 136,2 4 /dev/pts/2 jsvc 26453 root 2u CHR 136,2 4 /dev/pts/2 lsof 26524 root 0u CHR 136,2 4 /dev/pts/2 lsof 26524 root 1u CHR 136,2 4 /dev/pts/2 lsof 26524 root 2u CHR 136,2 4 /dev/pts/2 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.