run java app as init.d service

Posted on 2005-04-06
Last Modified: 2013-12-15
I have a java app that I can startup using a shell script. Where in /etc/init.d do I put a file to run this shell script?

And then, once I put it there, how do I tell it to start without having to reboot the server? I can't just run the script because then it'd quit as soon as I logged out.
Question by:HappyEngineer
    1 Comment
    LVL 38

    Accepted Solution

    > I have a java app that I can startup using a shell script.
    Which Linux do you have?
    Say you run the java app in shell like:
    java &   (& means run in background, so it won't quit when you logout)

    java &

    /etc/rc.d/rc.local     for (Fedora/RedHat)
    /etc/rc.d/boot.local  (SuSE)
    /etc/init.d/local  (Debian) (If not there, create one with first line "#!/bin/sh" )



    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
    SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now