0

I have a server with Centos 6. I've installed an configured everything so my server application runs smoothly, however if there is any unexpected reboots I have to manually start an SSH session and start the java program that runs it.

I've looked into several ways to start the software with the server but none of them have been able to run the software. Generally I start the software by running this command: nohup java -jar "/etc/software.exe" -name "Test New York Server". This works when I add it to a script and run it from terminal but not if I add it to /etc/rc.d/rc.local in anyway which is what was recommended in other threads. I issued touch commands to create a test file and those were executed so I'm obviously going at this the wrong way.

2 Answers2

1

Boot scripts executing differently at boot vs on the terminal are usually a result of the script relying on something in the environment. Have your script execute 'env' and write that to a file, and compare that to 'env' when you run it in your shell. The most common issue is with the PATH variable.

Jason Martin
  • 4,865
  • 15
  • 24
0

Compare with your favorite open source (Java) software that is well packaged, to get ideas.

Mine is Graylog. There is a full init script wrapping their jar archive, so it behaves like any other service.

John Mahowald
  • 30,009
  • 1
  • 17
  • 32