I have seen several ways to add programs or daemons to startup in Ubuntu 12.04 but I am kind of perturbed with the meaning of each method.

The point of that I am needing is

  • A way to run a daemon before login with root as owner
  • A way to run a program after the login of one user
  • A way to run a program after the login of any user
  • A way to run a program when all gnome environment is setted up

Thanks

share|improve this question

closed as off topic by Cody Gray, Paul R, tripleee, Tim Post May 10 '12 at 8:35

Questions on Stack Overflow are expected to relate to programming within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here. If this question can be reworded to fit the rules in the help center, please edit the question.

3  
Are you familiar with our Ask Ubuntu site? – Cody Gray May 8 '12 at 9:27
    
Do you mean after a graphical login at the console, or ssh logins too? What about new terminal windows in an existing session? – tripleee May 8 '12 at 11:36
    
  • To run a daemon or any command as root before login, add it to /etc/rc.local or add a cron job with @reboot as its time field. You can also write a proper init script based on /etc/init.d/skeleton.
  • To run a command after login, add it to ~/.bash_profile (provided you're using bash). Contrary to ~/.bashrc, this file will be executed by login shells only.
  • To run a command after login of any new user, add an appropriate .bash_profile to /etc/skel and new users will get this file automatically on account creation.
share|improve this answer
    
That's great general info to know. – apesa May 8 '12 at 15:36
    
old school yoooo – Prospero Oct 9 '12 at 23:56

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