tomcat can't start up or stop often

Kin Fat SZE
Kin Fat SZE used Ask the Experts™
on
Hi,

I follow installation document
http://tomcat.apache.org/tomcat-6.0-doc/setup.html
and success and nothing change on this system

I don't know why tomcat can't start up or stop often
the error log file $CATALINA_HOME\logs\catalina.err
System : Fedora 13, apache, tomcat

Anybody help?
02/07/2010 18:19:40 2582 jsvc.exec error: Cannot open PID file /var/run/jsvc.pid, PID is 2582
02/07/2010 18:19:40 2581 jsvc.exec error: Service exit with a return value of 255

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
You might take a look at this link: http://www.mail-archive.com/user@commons.apache.org/msg01780.html

Also, have you tried starting and stopping Tomcat without using jsvc?  Does it still have errors?  That might help us chase down the issue as well.  You could use scripts to start and stop tomcat without having to use jsvc if it turns out to be the only issue.
Yes, I using
    ./bin/jsvc -cp ./bin/bootstrap.jar \
        -outfile ./logs/catalina.out -errfile ./logs/catalina.err \
        org.apache.catalina.startup.Bootst
to startup tomcat manually
and
place $CATALINA_HOME/bin/jsvc/native/tomcat.sh into /etc/rc.local to auto start

the file PID   /var/run/jsvc.pid is missed often
On the surface, it sounds like a permissions problem.  Can you look int he config file and relocate the PID to something like your home directory to test?  maybe change /var/run/jsvc.pid to ~/jsvc.pid so that it writes the file into your home directory.  If that seems to work, then we can figure out what user is starting tomcat and what permissions are on /var/run to see if maybe the user cannot write files to that directory.
Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

the file /var/run/jsvc.pid is missed
That would make sense if you don't have permission to write to that directory. That would mean the file could not be created and without the pid file, it sounds like tomcat is crashing.
from a terminal window, type "touch /var/run/jsvc.pid" and see if you get an error.  That will tell you if your user account has permissions to create the needed pid file.
On my LInux computer (Fedora 9), /var/run is owned by root and running the command fails for me.  If you could write the pid file to a place where you have permissions, I think your problem would go away.
It seem that file is existing and the owner is su..... please have a look code snippet
could I just chmod 777 jsvc.pid by su and try it again?
[fsze88@fsze88-linux ~]$ touch /var/run/jsvc.pid
touch: cannot touch `/var/run/jsvc.pid': Permission denied
[fsze88@fsze88-linux ~]$ su
Password: 
[root@fsze88-linux fsze88]# touch /var/run/jsvc.pid
[root@fsze88-linux fsze88]# cd /var/run
[root@fsze88-linux run]# ls
abrt                    gdm.pid                ppp
abrt.lock               hald                   pptp
abrt.pid                haldaemon.pid          saslauthd
acpid.pid               httpd                  sendmail.pid
acpid.socket            irqbalance.pid         sepermit
atd.pid                 jsvc.pid               setrans
auditd.pid              libgpod                setroubleshoot
avahi-daemon            mdadm                  sm-client.pid
console                 messagebus.pid         sudo
ConsoleKit              mysqld                 syslogd.pid
console-kit-daemon.pid  netreport              udev-configure-printer
crond.pid               NetworkManager         udisks
cron.reboot             nm-dhclient-eth0.conf  utmp
cups                    nscd                   vpnc
cupsd.pid               openvpn                wpa_supplicant
dbus                    plymouth               wpa_supplicant.pid
dhclient-eth0.pid       pm-utils
gdm                     portreserve

Open in new window

no still having error on log file $CATALINA_HOME\logs\catalina.err
02/07/2010 18:19:40 2582 jsvc.exec error: Cannot open PID file /var/run/jsvc.pid, PID is 2582
02/07/2010 18:19:40 2581 jsvc.exec error: Service exit with a return value of 255
02/07/2010 21:11:13 5878 jsvc.exec error: syscall failed in set_caps
02/07/2010 21:11:13 5878 jsvc.exec error: set_caps(CAPS) failed
02/07/2010 21:11:13 5877 jsvc.exec error: Service exit with a return value of 4

Open in new window

right. likely the problem is that even changing the pid file to 777 will only let the process delete the pid file successfully when the server shuts down. When you start back up, you will have the same problem like you are seeing.
Starting the file in rc.local may be what is causing you some problems. You might be able to get some extra info here for how to start with various run levels with elevated permissions instead of using rc.local:
http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg126745.html 
too complex.
meeting same problem, are you?
Is there a simpler way to solve this issue?

Thank YOU

Francis SZE
I fixed by
yum install tomcat6
 yum install tomcat6-webapps tomcat6-admin-webapps

everything fine now, but I assist your comment to be assist okey?
not finished from his comment

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial