[EMAIL PROTECTED] wrote:
See Thread at: http://www.techienuggets.com/Detail?tx=31984 Posted on
behalf of a User

You shouldn't be messing about with the ownership of the PID file. It is
created by jsvc at startup. If you use jsvc properly it will start as
root, create the pid file, startup tomcat ...

Ah, but what if you are using jsvc to run something other than tomcat?

I am using jsvc to run a standalone java application as a daemon that
starts whenever the server is restarted.  However, I would like a certain
user other than root to be able to run the same launching script for this
daemon to start and stop the service as needed.

I find I cannot do it because of the permission on the .pid file.  No
matter where I put the pidfile and no matter whether or not I run umask in
the launching script, the pidfile gets created with an owner of root and
perms of 600.
If I run umask 133 and then create a file, I get perm 644 as I want on the
file.  But the same does not work from within my jsvc-launch script with
the pid file.

Nothing I've tried works.

In Response To:

Hi,

I can start and stop Tomcat 5.5 with the jsvc program but the problem is
that the pid file is created with permissions 600 and owned by root.
I want to be able to read the pid file to check if the Tomcat process is up
and running and also for other purposes.

Is it possible to make the pid file be owned by the user that runs Tomcat or
have the permissions to be set to 666?

Regards
Gunnar

I am the anonymous author of the piece you're responding to. What a coincidence seeing it bounce back here on the Tomcat list - Of course, my example did NOT concern Tomcat.

Anyway my JSVC daemon needs to fulfill two needs:
1) restart the application on bootup - which is done by root
2) allow non-root user to start-stop the application using the standard daemon start/stop/restart kinds of commands.

The only way I could get this to work was to modify my shell script to change the permissions and the group of the pid file after the jsvc start call was made. This works very nicely. Putting a call to umask in the script before the jsvc invocation did not work. I still don't know why.




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to