[HPADM] Re: Startup Script Question

From: Dave T. (davidlt77_at_hotmail.com)
Date: 10/20/04

  • Next message: brian irvin: "[HPADM] Script to copy /home"
    To: bill@billhassell.com, hpux-admin@dutchworks.nl
    Date: Wed, 20 Oct 2004 08:51:19 -0400
    
    

    Thnx, Bill!

    ----Original Message Follows----
    From: "Bill Hassell" <bill@billhassell.com>
    Reply-To: bill@billhassell.com
    To: "Dave T." <davidlt77@hotmail.com>
    Subject: Re: [HPADM] Startup Script Question
    Date: Wed, 20 Oct 2004 12:30:33 -0000

    "Dave T." <davidlt77@hotmail.com> said:

    > I'm writing a startup script (/sbin/init.d/sysmon) that calls
    another script
    > (/opt/sysadmin/bin/sysmon) to run as a daemon. Basically,
    > /opt/sysadmin/bin/sysmon runs a continuous "while" loop.

    Oops. Not a good design.

    > In the startup
    > script, I have the following line for the start option to launch
    the daemon:
    >
    > /opt/sysadmin/bin/sysmon &

    While this puts the script in the background, it cannot remain
    there as the startup processing must terminate.

    > When run from the command line, the startup script works
    perfectly, putting
    > the daemon in the background. However, when run from the rc3.d
    link upon
    > boot, the startup script launches the daemon, but then the
    daemon
    > immediately dies. What do I need to do to ensure the daemon
    remains up?

    Very, very different environment in a shell. The simple answer
    is to shield the sysmon process from the termination steps by
    the use of nohup:

    nohup /opt/sysadmin/bin/sysmon &

    However, I would not do this. Startup processes should run by
    themselves like a daemon. So for your sysmon process, that process
    should be rewritten (assuming it is an executable binary program)
    to run as a true daemon. If you don't have the source code or a
    way to compile it, or sysmon is itself a script, use a wrapper to
    start the process in the background with a nohup. Then it will
    work from a shell prompt as well as a startup script.

    --
    Best regards,
    Bill Hassell
    _________________________________________________________________
    Get ready for school! Find articles, homework help and more in the Back to 
    School Guide! http://special.msn.com/network/04backtoschool.armx
    --
                 ---> Please post QUESTIONS and SUMMARIES only!! <---
            To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
           Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
     
     Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
                http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)
    

  • Next message: brian irvin: "[HPADM] Script to copy /home"

    Relevant Pages

    • Re: rc scripts
      ... # REQUIRE: DAEMON ... startup script so that it parses rc.conf for variables. ... Or you can add this to the startup script and then use flags in rc.conf: ... load_rc_config openntpd ...
      (freebsd-questions)
    • executing a process as another user, works for ps/top but not for who
      ... I have an daeomon which I wiould like to execute programs as a specified ... In order to assume the identity of the user I launch the daemon ... run a script which removes the file as me, ...
      (comp.unix.solaris)
    • "who -m" and setuid()
      ... I have an daeomon which I wiould like to execute programs as a specified ... In order to assume the identity of the user I launch the daemon ... run a script which removes the file as me, ...
      (comp.unix.programmer)
    • Daemon Creation
      ... I’ve got a python script which I’m looking to launch as a Daemon on my system. ... Within the Daemon control script we have do_startand do_stopmethods. ...
      (Debian-User)
    • Re: Confused about init scripts expectations
      ... I am developing a daemon application to handle datalogger ... I have developed the init script that is ... I attempt to start the daemon using the services configuration GUI ... figure is that the EOF signal is not being received by the program. ...
      (Fedora)