1

I have a headless media server running ubuntu 18.04. I'd like to run a power management service on it so it suspends or hibernates 10 - 15 minutes after all the disks spin down. sspender works well for this but there's a problem. It has to be launched from a terminal window, and is only active while that terminal is open. It will survive suspend/wake cycles but not a reboot. I have to relaunch it manually. Can anyone tell me how to do that remotely so it stays running? It's not convenient to haul a monitor and keyboard into my laundry room every time I reboot.

I can launch it from SSH, or by opening a terminal on a remote desktop connection. However the process is killed as soon as I disconnect either session.

I've tried launching it at boot with Crontab entries but it doesn't work.

I've also tried Powernap, but can't get that to work at all.

2
  • 2
    nohup sspender &?
    – AlexP
    Feb 4, 2019 at 3:08
  • 1
    Or lookup how to run the screen application.
    – user535733
    Feb 4, 2019 at 9:49

2 Answers 2

1

The above suggestions by AlexP and user535733 both work.

With screen I start it, detach the screen session, and close the SSH browser. Have to remember not to close the screen session, just detach it.

Nohup works, although the log file can grow quite large since the output is pretty verbose. I think there's a way to direct it to null and no log is created. Still testing that.

Thank you both very much for your help.

1
  • 1
    C. La Mosca's answer shows how to redirect nohup's output and stderror to /dev/null. In this answer are shown few ideas how to create tmux session and execute a command inside during the system startup.
    – pa4080
    Feb 5, 2019 at 17:42
1

I don't have enoughreputation to comment.

Like AlexP sugested i think nohup is the key.

did you tried?

# nohup sspender &> /dev/null &

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .