2

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: http://aikar.co/2011/03/03/ubuntu-prevent-sleep-samba/

Any advice?

serilain
  • 508

3 Answers3

2

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.

serilain
  • 508
  • 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
2

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

#!/bin/bash
if [ `/usr/bin/smbstatus | grep DENY | wc -l` == "0" ] ; then
    pm-suspend
else echo “Got user on SMB”
fi
exit 0
belacqua
  • 23,120
serilain
  • 508
1

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.

dhiya
  • 953