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

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

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


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.