Closed Spredzy closed 11 years ago
In /etc/init.d/tomcat7: ...
NAME="$(basename $0)"
...
# Get instance specific config file
if [ -r "/etc/sysconfig/${NAME}" ]; then
. /etc/sysconfig/${NAME}
fi
So, it fetches instance specific configuration from /etc/sysconfig/APPLICATION, which means that multiple tomcats can live in same server without interfering with each other.
As TomiTakussaari pointed out, it is possible to have multiple Tomcat applications because the name of the application is inferred from the name of file.
_Tomcat7rhel creates a symbolic link from /etc/init.d/your-application
into /etc/init.d/tomcat7
. Now, when you invoke service your-application start
, the Tomcat scripts will see NAME
being bound to your-application
(again, as Tomi pointed out). This is because of the symbolic linking.
In short, _Tomcat7rhel relies on symbolic links and scripts from the Tomcat RHEL package.
I was reading through the module code and there is a part that does not make sense to me, would you mind explaining it ?
So basically if I have a app1 and app2 if I do
service app1 restart
it will do the same thing as doingservice app2 restart
, it will restart the whole tomcat server, is this correct ?If so, based on my understanding of puppet, the place of those two resources should be in tomcat7_rhel since tomcat7 is a singleton.
Note : If one installs only 1 application to a server that would make sense
service my_app restart
but if one installs 2 or 3 application on the same tomcat server, the restart action will break the other application too.Thanks,