On Fri, Dec 8, 2017 at 11:33 AM, Christopher Schultz <ch...@christopherschultz.net> wrote: > -----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
So yes, I was making it more complicated than it needed to be. Cheers :) --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org