Start Openfire at boot?

Discussion in 'Server Operation' started by tfunky, Dec 31, 2007.

  1. tfunky

    tfunky New Member

    Hi All!

    I know this is a noob question, but I can't figure it out...

    I've followed the openfire on Etch howto and have the server up and running if I manually start the service after a reboot.

    How do I make the server start at boot?

    The command to start the server is:
    Code:
    /opt/openfire/bin/openfire start
    Can someone please tell me how to make it restart (on Etch) at boot?

    Thanks!
     
  2. falko

    falko Super Moderator ISPConfig Developer

    Isn't there an Openfire init script in /etc/init.d? What's the output of
    Code:
    ls -l /etc/init.d
    ?
     
  3. tfunky

    tfunky New Member

    Code:
    LOpenFire:~# ls -l /etc/init.d
    total 194
    -rwxr-xr-x 1 root root  1850 2006-01-14 06:12 acpid
    -rwxr-xr-x 1 root root  4842 2007-09-19 15:45 apache2
    -rwxr-xr-x 1 root root  5089 2006-09-20 07:33 bootclean
    -rwxr-xr-x 1 root root  2146 2006-09-12 17:30 bootlogd
    -rwxr-xr-x 1 root root  1915 2006-09-20 07:27 bootmisc.sh
    -rwxr-xr-x 1 root root  2930 2006-09-14 04:20 checkfs.sh
    -rwxr-xr-x 1 root root  9548 2006-09-23 03:34 checkroot.sh
    -rwxr-xr-x 1 root root  6110 2006-09-05 12:15 console-screen.sh
    -rwxr-xr-x 1 root root  1761 2006-10-12 14:55 cron
    -rwxr-xr-x 1 root root  7104 2007-01-18 12:45 exim4
    -rwxr-xr-x 1 root root  5823 2007-07-30 16:39 glibc.sh
    -rwxr-xr-x 1 root root  1360 2007-01-13 13:52 halt
    -rwxr-xr-x 1 root root  1287 2006-09-12 17:31 hostname.sh
    -rwxr-xr-x 1 root root  3886 2007-02-21 12:48 hwclock.sh
    -rwxr-xr-x 1 root root  2518 2006-09-15 14:03 ifupdown
    -rwxr-xr-x 1 root root  1046 2006-09-15 14:03 ifupdown-clean
    -rwxr-xr-x 1 root root  3484 2006-10-15 23:38 keymap.sh
    -rwxr-xr-x 1 root root   944 2006-09-12 17:31 killprocs
    -rwxr-xr-x 1 root root  1375 2006-05-25 05:38 klogd
    -rwxr-xr-x 1 root root   417 2006-08-08 18:38 libdevmapper1.02
    -rwxr-xr-x 1 root root  2358 2005-08-01 15:49 lvm
    -rwxr-xr-x 1 root root  1054 2006-09-06 17:43 makedev
    -rwxr-xr-x 1 root root  1793 2006-11-14 06:12 module-init-tools
    -rwxr-xr-x 1 root root   617 2006-01-15 06:04 mountall-bootclean.sh
    -rwxr-xr-x 1 root root  1718 2006-09-12 17:30 mountall.sh
    -rwxr-xr-x 1 root root  2206 2006-10-03 14:22 mountdevsubfs.sh
    -rwxr-xr-x 1 root root  2394 2006-09-25 04:36 mountkernfs.sh
    -rwxr-xr-x 1 root root   615 2006-01-15 06:04 mountnfs-bootclean.sh
    -rwxr-xr-x 1 root root  2299 2006-11-26 08:35 mountnfs.sh
    -rwxr-xr-x 1 root root  3668 2006-11-26 10:13 mtab.sh
    -rwxr-xr-x 1 root root  6127 2007-11-19 23:52 mysql
    -rwxr-xr-x 1 root root  2547 2007-11-19 23:52 mysql-ndb
    -rwxr-xr-x 1 root root  1931 2007-11-19 23:52 mysql-ndb-mgm
    -rwxr-xr-x 1 root root  2550 2007-01-06 10:36 networking
    -rwxr-xr-x 1 root root  2324 2007-02-25 15:29 openbsd-inetd
    -rwxr-xr-x 1 root root   997 2006-09-12 21:42 procps.sh
    -rwxr-xr-x 1 root root  8045 2006-11-27 17:23 rc
    -rwxr-xr-x 1 root root   798 2006-09-28 13:25 rc.local
    -rwxr-xr-x 1 root root   117 2005-12-02 12:44 rcS
    -rw-r--r-- 1 root root  1386 2006-09-13 02:10 README
    -rwxr-xr-x 1 root root   655 2006-09-22 10:21 reboot
    -rwxr-xr-x 1 root root   994 2006-09-12 17:30 rmnologin
    -rwxr-xr-x 1 root root  1376 2006-11-27 17:23 sendsigs
    -rwxr-xr-x 1 root root   585 2006-09-12 17:32 single
    -rw-r--r-- 1 root root  4187 2006-09-12 17:32 skeleton
    -rwxr-xr-x 1 root root  1891 2007-03-05 11:38 ssh
    -rwxr-xr-x 1 root root   520 2006-09-12 17:26 stop-bootlogd
    -rwxr-xr-x 1 root root   730 2006-10-02 13:14 stop-bootlogd-single
    -rwxr-xr-x 1 root root  2037 2006-05-25 05:38 sysklogd
    -rwxr-xr-x 1 root root  8178 2006-12-19 05:21 udev
    -rwxr-xr-x 1 root root  1252 2006-03-28 02:44 udev-mtab
    -rwxr-xr-x 1 root root  3175 2006-11-25 04:22 umountfs
    -rwxr-xr-x 1 root root  2128 2006-11-26 13:23 umountnfs.sh
    -rwxr-xr-x 1 root root  1122 2006-09-30 10:37 umountroot
    -rwxr-xr-x 1 root root  1815 2006-09-12 17:30 urandom
    -r-xr-xr-x 1 root root 27730 2007-12-31 09:17 vmware-tools
    -rwxr-xr-x 1 root root  1805 2007-02-13 05:02 x11-common
    LOpenFire:~#
    
    It's not there.

    The howto had me copy everything to /opt.

    I'm wondering if I need to copy the startup file to that init.d dir?
     
  4. falko

    falko Super Moderator ISPConfig Developer

    Try this:
    Code:
    cp /opt/openfire/bin/openfire /etc/init.d
    update-rc.d openfire defaults
     
  5. tfunky

    tfunky New Member

    I thought that would do it! That was what I was looking for thinking it would work.

    Somethings still not right though...

    if I do a
    Code:
    /etc/init.d/openfire start
    
    I get a error:
    Code:
    The directory /etc/lib does not exist.
    
    but if I do a search in the openfire file, it doesn't have a line with /etc/lib in it.

    Any ideas?

    Thanks!
     
  6. falko

    falko Super Moderator ISPConfig Developer

    Ok, try this:

    Code:
    rm -f /etc/init.d/openfire
    vi /etc/init.d/openfire
    Put this into the file:
    Code:
    #!/bin/bash
    /opt/openfire/bin/openfire start
    Afterwards make the file executable:
    Code:
    chmod 755 /etc/init.d/openfire
     
  7. tfunky

    tfunky New Member

    That worked!

    That got it squared away like a charm!

    If you don't mind me troubling you for a bit more info...

    Do you have any idea why that worked and the

    cp /opt/openfire/bin/openfire /etc/init.d
    update-rc.d openfire defaults

    didn't work?

    I thought the way to do it was the update-rc.d part was the correct way to do it.

    Do you know what would cause it not to work vs. the 2nd option where it did?

    Thanks for your help Falko!!!!!!
     
  8. falko

    falko Super Moderator ISPConfig Developer

    I guess the /opt/openfire/bin/openfire script is somehow looking for files in the current working directory (/opt/openfire/bin/); if the script is in /etc/init.d, that's not working because the directory has changed.
     
  9. tfunky

    tfunky New Member

    Interesting! I'll keep this in mind in the future!

    Thanks for your help!
     

Share This Page