tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: How can Tomcat be started at boot time as a non-root user
Date Tue, 14 Oct 2014 16:46:34 GMT
-----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

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.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJUPVNqAAoJEBzwKT+lPKRYZJ8P/1DXo1ow0Zq++J4ECW/J80wx
P4CRFc5pclJoO6sh+P5jYdzec7GTcXk4eK/i8yJypa5cVmvpLFsZeeupeyQC0xob
s3rovHYdp10jnx/JtxyQIotG+lABWG3kL+ujdVs0OBrN/4aV7MLvKdWaEa6L4S7k
F9NbyD6U5iAfmBooeyZP+5gCLTTSlFKv9yJ3Yh0BnsAzd8yAbXiBTEex9rfi2VfO
cynKXKrtMlnmaEfTidwjlQ+sb4z+waNl5HIVf9RWZNBP4n6ov4BBP51FqzkyfmB4
qZcwu32C3PRwzarP6d3ZSD6oy8aEu4YcvLJz7cwSg9zLI843Pq1YfX/2eZEJZfFY
MTH1Ct2gMqlYuStUVw1bq0qf0i2kso4s+q6Yp5gJlc3k9JbAQUNjoBEzM9+L93zp
CwB/oVgVpj6h9hn803ZAghi+wAPtuwNnXDbDb0QzTC94TLv6/H5epua+H6ySDfWF
d6eah/ju0aZS2+4MliT5pBfbeUg+DM9duQig92LNDZEvpdUmBqgkugSTE40+OQnF
miCl6EQpy08Xb9xZkSwQ07r9FrLwhf02NwaP2SxJ5XGiWsUkU7uBI2lWNXbr9wBu
TyONCdX2q6nbAFF3smlszlwbUqmGM6itspNaVS1cepi7M3znvoiXB46axbxXTzEI
KHGuNSXOuAUpZZTEcK53
=6cGF
-----END PGP SIGNATURE-----

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


Mime
View raw message