Find the answer to your Linux question:
Results 1 to 5 of 5
Hi all, I want to start a java program when the system starts. How to achieve that ? Thank you very much indeed...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2011
    Posts
    11

    How to start an application when the system starts ?


    Hi all,

    I want to start a java program when the system starts. How to achieve that ?

    Thank you very much indeed

  2. #2
    Administrator jayd512's Avatar
    Join Date
    Feb 2008
    Location
    Kentucky
    Posts
    5,023
    Are you wanting to start the application on login? Or on actual system start-up?
    If it's the latter, you can add it to your preferred applications (or similar) for your DE.

    If the former, a simple method would be to add it to your /etc/rc.d/rc.M file.
    Jay

    New users, read this first.
    New Member FAQ
    Registered Linux User #463940
    I do not respond to private messages asking for Linux help. Please keep it on the public boards.

  3. #3
    Just Joined!
    Join Date
    Mar 2011
    Posts
    11
    I want to start the application on actual system start-up. What do you mean by DE ? And how to add to the preferred applications as you said ?

  4. #4
    Administrator jayd512's Avatar
    Join Date
    Feb 2008
    Location
    Kentucky
    Posts
    5,023
    DE = Desktop Environment. Like KDE or Gnome.
    But since you want the app to launch on startup, you can just add it to your /etc/rc.d/rc.M file.
    You'll need to be root to edit the file. But just tack on the command to launch your program to the end of the file, reboot.
    You should be good to go.
    Jay

    New users, read this first.
    New Member FAQ
    Registered Linux User #463940
    I do not respond to private messages asking for Linux help. Please keep it on the public boards.

  5. #5
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Just a note, it can depend slightly, based upon your distro.

    e.g., in Fedora/RH, i would put the startup code in a file called /etc/init.d/myJavaProg. This script would have simple case statements in it to handle start|stop|status|restart commands and have the LSB stuff at the top (#description and #chkconfig) so that the init process and the /sbin/service script can control it during startup/shutdown, etc.

    Of course we are moving from SysVInit to systemd, so this is already "legacy"...

    or more simply, it could be tacked onto the end of /etc/rc.d/rc.local

Posting Permissions

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