Start Cascade on Server Reboot

Kris's Avatar

Kris

07 May, 2010 05:38 PM

I am running Cascade on SuSE 11. Does anyone know how to start Cascade when the server reboots. It starts fine manually but every time I reboot, I have to go back in and start it.

Thanks,
Kris

  1. 1 Posted by Bradley Wagner on 07 May, 2010 07:26 PM

    Bradley Wagner's Avatar

    I'm not sure about the specifics of SuSE 11 but usually, you can add something like:

    sudo -u <cascade_user> /path/to/cascade/cascade.sh start
    

    in the /etc/rc.local file. You'll need to make sure that the $JAVA_HOME system variable is set in the cascade.sh script.

  2. 2 Posted by Kris on 07 May, 2010 09:27 PM

    Kris's Avatar

    Hmmm, unfortunately I do not have a /etc/rc.local file. Any other ideas? I'm going to keep playing around with it.

  3. 3 Posted by Bradley Wagner on 10 May, 2010 06:42 PM

    Bradley Wagner's Avatar

    Ok, try placing a script like the following in your /etc/init.d directory and make sure it has executable permissions.

    #!/bin/bash
    # Cascade startup script
    
    # chkconfig: 345 90 90
    # description: Cascade Startup Script
    
    CASCADE_HOME=/path/to/cascade
    CASCADE_BIN=$CASCADE_HOME/bin
    
    start() {
            echo "Starting Cascade: "
            if [ "x$USER" != "x$RUN_AS_USER" ]; then
              su - $RUN_AS_USER -c "$CASCADE_HOME/cascade.sh start"
            else
              $CASCADE_HOME/cascade.sh start
            fi
            echo "done."
    }
    stop() {
            echo "Shutting down Cascade: "
            if [ "x$USER" != "x$RUN_AS_USER" ]; then
              su - $RUN_AS_USER -c "$CASCADE_HOME/cascade.sh stop"
            else
              $CASCADE_HOME/cascade.sh stop
            fi
            echo "done."
    }
    
    case "$1" in
      start)
            start
            ;;
      stop)
            stop
            ;;
      restart)
            stop
            sleep 10
            start
            ;;
      *)
            echo "Usage: $0 {start|stop|restart}"
    esac
    exit 0
    
  4. Bradley Wagner closed this discussion on 10 May, 2010 06:42 PM.

  5. Kris re-opened this discussion on 10 May, 2010 07:42 PM

  6. 4 Posted by Kris on 10 May, 2010 07:42 PM

    Kris's Avatar

    YES!!! THANK YOU!!! I've been beating my head against the wall all day on this. I knew what I had to do (i.e. build that script and put in init.d) but trying to read through the /etc/init.d/skeleton file to learn how to write that script was killing me.

    Thanks again,
    Kris

  7. 5 Posted by Kris on 10 May, 2010 08:39 PM

    Kris's Avatar

    One final note which may be specific to my environment but thought I would throw it out there for anyone else that may have this problem.

    You have to edit the
    /etc/init.d/.depend.start

    file by adding the name of your script, I called it cascade, to the TARGETS list. You also have to add symbolic links to the appropriate runlevel, I chose 3, to your script. Do this by adding symbolic links to your cascade script in
    /etc/init.d/rc3.d

    called KXXcascade and SXXcascade. Replace the "XX" in each link with the order of importance where you want them to start be called. I didn't see much difference when I moved the numbers around but I used K01 and S10 which placed them just above apache2 in my installation. My reasoning for this was that I was having some issues with Cascade not starting manually after Apache had started so I just wanted to make sure it started before Apache, though even if I used a number higher than Apache, Cascade still started first so ...

    Hope that helps someone else.

    Kris

  8. Support Staff 6 Posted by Tim on 10 May, 2010 09:00 PM

    Tim's Avatar

    Thanks for that information Kris!

  9. Tim closed this discussion on 10 May, 2010 09:00 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac