So, here's what I'd really love to do. My Arch Linux laptop is put to sleep with the help of pm-utils, some X apps (transmission, banshee, etc.) need to be manually shutdown (via script in /etc/pm/sleep.d/00script.sh) and restarted on sleep resume. However, as pm hooks are run as root user running a X app for normal user AS root is quite a challenge. It all comes down to having DISPLAY and XAuthority exported, I know, but I've ran out of ideas how to make it work, and I've tried a number of approaches but none of them ever worked.

So, I decided to throw this out and see if any of the superusers here know what can be done about this :)

link|improve this question
You shouldn't have to shut down any programs - they get suspended along with the rest of the system. Transmission does not need any special treatment, it will gradually resume transfers on wake. – grawity Nov 21 '11 at 12:54
If I put a laptop into sleep and transmission actively even reads data, or banshee for that matter, upon resume something weird happens. Best illustration is the following. If I'm on console in /media/disk/tmp directory and send laptop to sleep, when resumed running ls in that dir will fail to produce output. Even though disk is mounted in the same location. Leaving the path with cd and returning back to it "fixes" the issue. I believe other apps hang the laptop for the same reason. So I have to kill them off prior to switching to sleep mode. – ILIV Dec 5 '11 at 16:42
feedback

1 Answer

In answer to the question itself, you want to set the file to SUID root. As commented by grawity, there shouldn't be any necessity to having to shut these programs down though for when it goes to sleep.

link|improve this answer
True, but something weird happens when I do. Read my comment above, please. I don't think SUID is a great idea. Isn't there a less risky way of doing this? – ILIV Dec 5 '11 at 16:45
feedback

Your Answer

 
or
required, but never shown

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