Results 1 to 6 of 6

Thread: How do I run a daemon automatically at startup?

  1. #1
    Join Date
    Jun 2006
    Beans
    571
    Distro
    Ubuntu 14.04 Trusty Tahr

    Question How do I run a daemon automatically at startup?

    Hi,

    I just installed a little media sharing server called ushare, which I'd like to run as a daemon at startup (it has a daemon mode, so that part is covered). It looks like "scheduled actions" are added using anacron or atd, according to a brief description I found under System --> Services. But I can't find a way to start either task scheduler.

    Anybody know how to have a daemon automatically start at startup?

    Thanks!

    -Mark

  2. #2
    Join Date
    Feb 2008
    Beans
    63

    Re: How do I run a daemon automatically at startup?

    pretty sure you do this in sessions or session manager.use these 2 in the search to see what you can find I have added programs at startup this way.However I do not know enough to walk you through it.The good news is threre is a guide I find from time to time when I need to do it.I also keep forgeting to bookmark it so I don't have the link.I hope this little bit of info helps.

    Edit sorry I think I read your post incorrectly please ignore if this is not what you want to do.
    Last edited by spudratic; May 6th, 2008 at 03:03 AM.

  3. #3
    Join Date
    Oct 2007
    Beans
    135

    Re: How do I run a daemon automatically at startup?

    Open System -> Preferences -> Sessions. Click the "Add" button. The first field is whatever you want to call the scheduled session (what you type here appears as bold in the list). The second field is the most important one - whatever the command that you want to run at startup is. For example, I need to start BTNX when my computer starts to use the extra buttons on my mouse. I filled this field in with "btnx" - the terminal command to start the daemon. The third field is just a short description of whatever your task is doing. Hope this helped.

  4. #4
    Join Date
    Jun 2007
    Beans
    85
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: How do I run a daemon automatically at startup?

    Normally daemon has a initialization script in /etc/init.d/ directory.

    It can be run manually if needed - for example
    Code:
    sudo /etc/init.d/pulseaudio start
    If daemon has to be initialized in startup, then a link to this script is put into startup initialisation directory - they are /etc/rc0.d/ ... /etc/rc6.d/ (number is for runlevel: 0-shutdown, 1-single-user mode, 2-normal operation, 3...5-not used in Ubuntu, 6-reboot).

    Operation is determined by a name of the link - first letter determines the action (S-start, K-kill), following number (01-99) determines the sequence of these scripts in this directory.

    For example btnx has startup file '/etc/rc2.d/S49btnx', which is linked to '/etc/init.d/btnx'

    If some program has to be run in userspace with rights of a current user, then it can be doen by adding the command or script in session startup.

  5. #5
    Join Date
    Jun 2006
    Beans
    571
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: How do I run a daemon automatically at startup?

    Spudratic, I gave you a "thanks" because your post was very helpful, but a the same time hilarious! You sound just like me... I have to revisit these things everytime they come up, and re-learn them.

    Thanks to the rest of you, too... I appreciate all the info! tim71, I might give that a shot if I can set aside the time. Thanks!!!

    -Mark

  6. #6
    Join Date
    Jan 2008
    Location
    /dev/null
    Beans
    2,793
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: How do I run a daemon automatically at startup?

    Quote Originally Posted by mjpatey View Post
    Spudratic, I gave you a "thanks" because your post was very helpful, but a the same time hilarious! You sound just like me... I have to revisit these things everytime they come up, and re-learn them.

    Thanks to the rest of you, too... I appreciate all the info! tim71, I might give that a shot if I can set aside the time. Thanks!!!

    -Mark
    http://ubuntujourney.wordpress.com/2...ogram-at-boot/

    a more in depth look at it if you have the inclination to go the init script route

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •