0

I need a script that will murder java processes that have been on for more than one hour.

So I am trying this

timeout -k 10s nohup cpulimit -l 40 -- java -jar file.jar

Any idea why this isn't working?

1

You should have the nohup first, then timeout. nohup's disassociation with the controlling terminal breaks the ownership relationship that timeout uses to kill.

Also 10s tells timeout "Ten Seconds", not "One Hour".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.