How can I add a command at the end of the tomcat startup.sh
script to execute a file.
I think it is something like this. Assuming my file needs start as command passed to it below:
exec "/path/to/file/file" start
How can I add a command at the end of the tomcat startup.sh
script to execute a file.
I think it is something like this. Assuming my file needs start as command passed to it below:
exec "/path/to/file/file" start
What are you actually trying to accomplish? You probbably don't want to edit a script which was installed by the system, but you might want to create a wrapper. Assuming you are overriding /usr/sbin/randomscript
, move it to /usr/sbin/randomscript.real
(maybe using diversions if you are on a Debian-based distro) and write a new /usr/local/sbin/randomscript
something like
#!/bin/sh
/usr/sbin/randomscript.real # Add & at the end to run it in the background
/path/to/file/file start
As stated in the Tomcat Doc the startup.sh
should not be adjusted but a setenv.sh
be created which is expected in the directory "bin" of your tomcat installation. There you can use the shell commands as usual.