I have an SBC (pine64) running Ubuntu 16_04 and I have a long process to do (build tensorflow). I'm using the nohup command to detach the process from my SSH session but two days consecutively my board rebooted at midnight. I saw that I can inhibit reboot, sleep and shutdown with systemd-inhibit.

Is there a way to use this command without sudo? Bazel build doesn't recognize my %JAVA_HOME when launched with sudo...

This is the command I'm trying to run:

systemd-inhibit --why="Compiling TF" nohup bazel build -c opt --copt="-funsafe-math-optimiza
tions" --copt="-ftree-vectorize" --copt="-fomit-frame-pointer" --verbose_failures tensorflow/tools/pip_package:build_pip_pa
ckage &  

which gives me:

Failed to inhibit: Access denied

Any advice?

  • Maybe you can run systemd-inhibit sleep 100000 in parallel with your build? Mar 11, 2019 at 14:54
  • @Scott, I launched sudo sudo systemd-inhibit sleep 518400 to be safe for 6 days and then run my build command without the systemd-inhibit. I still had to use sudo, is it normal? Mar 11, 2019 at 15:02
  • It seems reasonable that you would need to use sudo on a command that modifies the behavior of the system. Mar 11, 2019 at 15:04
  • Yes ok seems reasonable. Also I used sudo nohup systemd-inhibit sleep 518400 to detach the process from my SSH session. Thanks for your advice. Mar 11, 2019 at 15:17
  • The real question is why your board reboots at night? Have you configured it to reboot at specific times?
    – Daniel
    Jan 27, 2021 at 18:59

1 Answer 1


You can use systemd-inhibit --what=idle as a normal user to prevent the machine from suspending due to system idleness. Other locks require elevated privileges.

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.