Chris,

> On Tuesday, October 14, 2014 9:47 AM, Christopher Schultz 
> <ch...@christopherschultz.net> wrote:

> > -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> Léa,
> 
> On 10/14/14 7:06 AM, Léa Massiot wrote:
>>  My question is about how can Tomcat be started at boot time as a
>>  non-root user.
>> 
>>  The OS is Debian Wheezy.
>> 
>>  Below is what I did already:
>> 
>>  root> chown -R tomcat7.tomcat7 /opt/tomcat7/
>> 
>>  I created a new file: "/etc/init.d/tomcat7" Owner and owner 
> group:
>>  root Permissions: 755 
>>  ------------------------------------------------------- #! /bin/sh
>> 
>>  export JAVA_HOME=/opt/jdk1.7.0_67/ case $1 in
>> 
>>  start) /bin/bash /opt/tomcat7/bin/startup.sh
> 
> Change this to:
> 
> su -c "/bin/bash /opt/tomcat7/bin/startup.sh" tomcat7

You might need to use runuser in the above line if you're running SELinux.

> 
> Look at the man page for "su" to see what's going on.
> 
> Or you can use jsvc as others have suggested. I think jsvc is probably
> more robust (because it can restart Tomcat if it dies) but it's a bit
> more hassle, too.

I've not tried the jsvc route yet, but I'm sorely tempted (especially now with 
systemd).

Writing an init script that takes care of all the issues is complicated.

> 
> - -chris


. . . just my two cents
/mde/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to