Re: Run script as often as possible

From: Dave Carrigan (dave_at_rudedog.org)
Date: 09/28/04

  • Next message: Wim De Smet: "Re: Computer not running at highest possible speed"
    Date: Tue, 28 Sep 2004 08:28:03 -0700
    To: debian-user@lists.debian.org
    
    
    

    On Tue, Sep 28, 2004 at 11:23:15AM +0200, Jacob Larsen wrote:
    > I have a script that I'd like to run as often as possible.
    > The script may only run in 1 instance.
    > My idea is to have a cron script to start it once every hour. The script
    > should write a run file, and if the run file exists, exit.
    > Is this the best way?

    Run it from init by putting an entry into your inittab. As soon as it
    exits, init will respawn it. The upside is that there is no need to do
    locking or process synchronization. The following inittab entry would
    work.

    mysc:2345:respawn:/path/to/myscript

    -- 
    Dave Carrigan
    Seattle, WA, USA
    dave@rudedog.org | http://www.rudedog.org/ | ICQ:161669680
    UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-C++-DNS-PalmOS-PostgreSQL-MySQL
    Dave is currently listening to Creedence Clearwater Revival - Travellin' Band (Chronicle)
    
    

    -- 
    To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
    


  • Next message: Wim De Smet: "Re: Computer not running at highest possible speed"

    Relevant Pages

    • Re: Oracle on RHEL4 with ASM problem
      ... When ASM throws this error I have to comment out this entry in inittab, run 'init q', uncomment the inittab entry and run 'init q' again. ... you may able to hack that script to put e.g. "sleep 5" at the top -- this is a dirty hack; hopefully running the script by hand should give you some more information. ... If the sleep trick fixes it, then I'd suggest that that script is restarting too quickly for initto assume that it's successful - you should see messages in /var/log/messages that say something like ...
      (RedHat)
    • Re: Solaris 10: cannot gracefully shutdown legacy services?
      ... Oracle starts up just fine. ... > processes with a SIGTERM. ... > Reading `man init`, I find: ... > This invokes the script, ...
      (comp.unix.solaris)
    • Re: Python init
      ... that is needed for scripts running at init time. ... I think 2.5Mb would be sufficient to serve as an init platform and natively ... cover more than 80-90% of any operation an init script would need. ... python stuff to /bin and /lib and remove it from /usr, ...
      (Debian-User)
    • Re: Python init
      ... that is needed for scripts running at init time. ... I think 2.5Mb would be sufficient to serve as an init platform and natively ... cover more than 80-90% of any operation an init script would need. ... python stuff to /bin and /lib and remove it from /usr, ...
      (Debian-User)
    • Re: [SLE] SUSE 9.3: buggy as hell
      ... The thing is that once upon a time I made a temporary backup of an init ... script while I decided which to use. ... * service postfix did not start on boot, nor did it stop on halt ... network named syslog xntpd ldap ypbind ...
      (SuSE)