Search code examples
linuxshellshaws-code-deploynohup

Script at specified location: failed to close STDERR


I have a script that gets the following error:

Error

InstanceAgent::Plugins::CodeDeployPlugin::HookExecutor: Script at specified location: scripts/powwow-deploy.sh failed to close STDERR

Script at specified location: scripts/powwow-deploy.sh failed to close STDERR

powwow-deploy.sh

nohup java -jar -Dspring.profiles.active=uat target/pow-wow-0.0.2-SNAPSHOT.jar > logs/nohup.out &

I think the problem is because I am writing the output to nohup.out, i.e. > logs/nohup.out.

How can I make it write to logs/nohup.out without getting the error?


Solution

  • >logs/nohup.out redirects STDOUT. But you also want to redirect STDERR. You could add 2>&1 to send both STDOUT and STDERR to logs/nohup.out.