Author Topic: [SOLVED]How do you configure a custom command to be run on start up and shutdown  (Read 1697 times)

fatbob

  • Zen Warrior
  • ***
  • Posts: 102
  • Karma: +1/-0
    • View Profile
Hi

I have an online backup solution called jungledisk. The local backup software can be started by firing up a command line program called jungledisk.

I hacked my previous suse configuration to start this thing up in the boot scripts.

Given that all the configuration of zentyal is template driven and I'm not familiar with the boot configuration system (and it's a long time since I did it on suse :)  ) how would I go about calling this program on startup and then again on shutdown?

« Last Edit: March 04, 2013, 04:24:03 pm by fatbob »

fatbob

  • Zen Warrior
  • ***
  • Posts: 102
  • Karma: +1/-0
    • View Profile
I edited the /etc/rc.local file and added my command in. It worked fine on reboot, just wondering if this file will be recreated by some zentyal process at any point?

half_life

  • Bug Hunter
  • Zen Hero
  • *****
  • Posts: 867
  • Karma: +59/-0
    • View Profile
That would be the correct place to put it for startup.  That file will not be called again during shutdown.  You might be better writing a script to put into /etc/init.d/ to handle starting and stopping the utility.  The script would need to respond to the start and stop parameters at a minimum.  Take a look at some of the other scripts there for ideas how to do this.

fatbob

  • Zen Warrior
  • ***
  • Posts: 102
  • Karma: +1/-0
    • View Profile
Hi there.

Yeah I figured it wouldn't but it seems to shut down nicely and there's nothing in the log to indicate that any problems were cause so I'm going to leave my simple mod to rc.local as the solution. :) Thanks for the feedback.

Solution then is if you want something started the a simple solution is to put  it in rc.local. For more complex stuff write an init script.

Ta.