Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Seems this is an open problem -- streaming over Samba apparently doesn't pause the idle timer on Ubuntu (12.10 Unity), so the machine will suspend after the usual 30 minutes despite the fact that I'm streaming something.

I found this solution for Gnome, but nothing for Unity:

Any advice?

share|improve this question
up vote 1 down vote accepted

For what it's worth, Caffeine works if you tell it to active when smbd is running, but smbd doesn't stop or start based on when you're streaming -- it'll make the machine effectively never sleep and the display never turns off.

share|improve this answer
For a workaround so far I've just been VNCing into the machine and turning on caffeine whenever I start streaming media over samba. Not too clean, but it works. – serilain Jan 12 '13 at 21:44

from the linked thread: this works fine in unity as an */30 * * * * cron job:

if [ `/usr/bin/smbstatus | grep DENY | wc -l` == "0" ] ; then
else echo “Got user on SMB”
exit 0
share|improve this answer

See this question. You can use this script provided there to prevent Ubuntu from suspend while any upload or download in progress. Change wlan0 to eth0 or use both if its applies.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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