-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Chris,

On 12/7/17 3:47 PM, Chris Cheshire wrote:
> Apologies in advance for semi-OT sysadmin question.
> 
> Tomcat 8.5.24, running on Centos 6. I have built jsvc according to 
> instructions in distribution. I have two tomcat instances under 
> different users (sandbox1, sandbox2) that have their own 
> CATALINA_BASE. I can start these manually from the command line 
> without a problem.
> 
> How do I set up daemon.sh to run on boot for multiple users? Do I
> need to (as root), make a copy of daemon.sh under /etc/init.d for
> each user (tc_sandbox1, tc_sandbox2) and edit those to set the
> environment variables in it (CATALINA_HOME, CATALINA_BASE,
> JAVA_HOME, TOMCAT_USER), then use chkconfig to install the
> scripts?
> 
> This seems kind of clunky to set up. Is this the right way to go
> about it or am I making it more complicated than it needs to be?

Don't duplicate daemon.sh. Instead, build a wrapper script that looks
like this:

#!/bin/sh

export JAVA_HOME=... [if necessary]
export TOMCAT_USER=...
export CATALINA_HOME=...
export CATALINA_BASE=...

$CATALINA_HOME/bin/daemon.sh

That will ensure you are always up-to-date with the latest daemon.sh
that exists in your CATALINA_BASE. It also makes your scripts
super-easy to write and maintain.

If you are using a systemd-based OS, I think there are better options
available, but I'm not really sure.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQJRBAEBCAA7FiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAloqvtcdHGNocmlzQGNo
cmlzdG9waGVyc2NodWx0ei5uZXQACgkQHPApP6U8pFgHFBAAwL0fCO0jRxtgZs8O
0oscj30jjBPVUhaJYHIG0NxWn2m9Il4jZawhrRJVl6ipkUSjBmFJweLq2FwCAidA
jGe8E8CgL6ZMG/pPeEr1xD5bHk8i+UbpdkXIDwxcn+1Yuv0W6ARe5XZoi3eWSPr9
9BbrRBKbrd4T66nOM2VH2U0yb85eaATncajUySpFpKWMosSiDiS6hm3NagYmxTwk
xB5/kQ78qqyFQr0OsKyFOuCPvW9qBKKW3rl8wIwSoHLwKEegVA7OdGHxSQ79JsAQ
FJo0PYQYxFmum3PV3QbNgf6AyzuKXTCv3cKZWCXxEfBTNqqerPvNhdxKLWvGWnZd
l8Em2I/QFbMkjo0aRO+ySEa9Focf6igqyfilf4TaSDBvtmGIwt541SGXE3hB37iu
vF3Tse8E9+golc1dwnKrijsB13OF2dYNtT5oAw7zlONLLBsm045fWCNB/SFyjrge
FgiLwF6vv3cjthNSm/1a1iqTktNm+fgV1rxHS1AEPlQat63Bz8lEnqnllhQSeHJh
g+4mwN/hQt9Ocxz8Us2XjEtu3U7qev4C3metW5z8TJCCMtoOwf7powgGkHMb21HZ
JWY0mVdSTYfyV/v+5am0Ou9WfLCue/ls3pm0Q+f2K4cJQT3q5+1UCS/GhCPZZJCX
MCzIkSI+wM6N72REFbfWT3CbBBc=
=3nZt
-----END PGP SIGNATURE-----

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

Reply via email to