Results 1 to 5 of 5

Thread: Run an application at startup

  1. #1
    Join Date
    Jun 2009
    Location
    Argentina
    Posts
    65

    Default Run an application at startup

    Hi:

    I want to start an application at startup, independently of which user logs in. I know I should configure this in the runlevels, but I just don't remember how to do this, or whether there's an easier way. Thanks.
    It's only cheating... if you get caught!

    -- Al Bundy

  2. #2
    Join Date
    Mar 2008
    Location
    Oz
    Posts
    11,728
    Blog Entries
    2

    Default Re: Run an application at startup

    Quote Originally Posted by mchojrin View Post
    Hi:

    I want to start an application at startup, independently of which user logs in. I know I should configure this in the runlevels, but I just don't remember how to do this, or whether there's an easier way. Thanks.
    Put the command in the file /etc/init.d/boot.local
    Leap 42.3 & 15.1 &KDE
    FYIs from the days of yore

  3. #3
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,380

    Default Re: Run an application at startup

    Swerdnas advice is sound (as allways) and it is by far the easyest way of doing it. But boot.local is run very early in the boot sequence. The network will not run at that moment. So when your app needs the network you must go for a more difficult way.

    In that case take a look at /etc/init.d/skeleton. Make a copy of it in /etc/init.d/ with the name of your app. Edit it in the proper places te see that it does start/stop what you want. Also see that the correct runlevel is configured there (when you want it to run with running network start it on runlevel 3 and above, when it should run only when the GUI is started use runlevel 5).

    After this you can start/stop your app in different ways, but the most easy way is to use YaST > System > System Services (Runlevel). When you did the adaption of the skeleton correct, you will find your app in the list and can activate it from there. YaST wiill then start it and register it for starting at every boot.
    Henk van Velden

  4. #4
    Join Date
    Mar 2008
    Location
    Oz
    Posts
    11,728
    Blog Entries
    2

    Default Re: Run an application at startup

    Would it be easier to put the command in a root cron job with a 10 second sleep before it, set to go at boot time?
    Cron line:
    Code:
    @reboot sleep 10;command_you_want
    Inelegant but effective (& maybe even a bit elegant).
    Leap 42.3 & 15.1 &KDE
    FYIs from the days of yore

  5. #5
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,380

    Default Re: Run an application at startup

    I just read the man page for this. Seems to be an Extension. I suppose it is not in POSIX. But never mind, when you do not want to port this to another Unix, it may serve you for years to come
    Henk van Velden

Posting Permissions

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