Results 1 to 3 of 3

Thread: script to start openfire on startup

  1. #1
    Join Date
    Aug 2010
    Location
    INDIA
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    script to start openfire on startup

    Hi friends,

    I configured openfire on my system as a LAN chat server. I want to write a script to start openfire automatically when system starts.
    Lets say I write the script as:

    Code:
    sudo /etc/init.d/openfire start
    The problem is it requires sudo access. It will ask for password or may give an error or something but there are chances that openfire will not be started. Is there anyother way to write this kind of script?

  2. #2
    Join Date
    Jul 2012
    Beans
    57

    Re: script to start openfire on startup

    I haven't tried it before, but supposedly you want to use a program like "sysv-rc-conf" or "sysvconfig" which will start the program at boot time.

    e.g. sysv-rc-conf openfire on

    It won't start the service when you enter that command; it just configures it to do so the next time your system boots.

  3. #3
    Join Date
    Oct 2005
    Location
    /root
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: script to start openfire on startup

    Add it to the /etc/rc.local file, before the exit 0:

    Code:
    #!/bin/sh -e
    #
    # rc.local
    #
    # This script is executed at the end of each multiuser runlevel.
    # Make sure that the script will "exit 0" on success or any other
    # value on error.
    #
    # In order to enable or disable this script just change the execution
    # bits.
    #
    # By default this script does nothing.
    
    /etc/init.d/openfire start
    
    exit 0
    IINM, commands in the rc.local file gets executed as root. There may be no need for sudo.

    HTH.

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
  •