0

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
chaos
  • 1,505
  • 1
  • 15
  • 21
wondergoat77
  • 101
  • 3

2 Answers2

0

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
tripleee
  • 1,416
  • 3
  • 15
  • 24
0

As stated in the Tomcat Doc the startup.shshould 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.