Question

I have written a monitor script for tomcat which checks if tomcat/bin/bootstrap.jar is running.

ps ax -o cmd|grep tomcat/bin/bootstrap.jar |grep -v grep | awk {'print $1'}

This command works fine when run in terminal, but from init.d ps ax -o cmd gives partial output only.

"/usr/bin/java -Djava.util.logging.config.file=/home/webserver/tomcat/"

actually it should be

"/usr/bin/java -Djava.util.logging.config.file=/home/webserver/tomcat/conf/logging.properties -Dsun.net.inetaddr.ttl=30 -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xmx650m -Djava.endorsed.dirs=/home/webserver/tomcat/endorsed -classpath /home/webserver/tomcat/bin/bootstrap.jar -Dcatalina.base=/home/webserver/tomcat -Dcatalina.home=/home/webserver/tomcat -Djava.io.tmpdir=/home/webserver/tomcat/temp org.apache.catalina.startup.Bootstrap start"

Does init.d scripts limit command output length? How can I get this to work?

OS : Debian (Works fine in RedHat machines)

Was it helpful?

Solution

Try using the -ww option to specify unlimited width of output. -w option gives wide output and -ww option specifies unlimited width.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top