Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am making an app using pygtk, glade, and quickly and want to make a daemon that runs in the background to provide unity notifications for alarms and events. I would like to find a way to not require root authentication after installing the *deb file. I have tried adding a script to the users crontab but it seems that would require the restart of crond. (which needs either root or a reboot) I was wondering if there was a project I should look at to see an example of a daemon in python or how I could go about this? Thank you in advance for any help and feel free to tell me I'm wrong!

share|improve this question

1 Answer 1

Daemons are usually run by root (although they sometimes change the user under they run).

For a normal notification you don't need to create a daemon, just create a normal program and let it run at the start of a session. This way it will run with user privileges, and you will run a separate instance for each user.

I have done this program, it's a bit more complex than what you need, as it uses different libraries to run in different systems but it is quite simple and maybe a good example.

share|improve this answer
    
Thank you very much! –  user77588 Jul 24 '12 at 6:04
    
I want to clarify, you are using gobject.timeout_add(interval, callback, ...) to check the alarm at a regular interval, aren't you? Does this function do checking in the main loop (busy waiting rather than idle)? –  BornToCode Nov 22 '13 at 0:21
    
Yes, the gtk version is using gobject.timeout. I don't understand what you mean with checking in the main loop, but anyway it doesn't do any kind of busy waiting. –  Javier Rivera Nov 22 '13 at 14:50

Your Answer

 
discard

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.