RedHat startup script

  • The linux manual comes with a startup script for debian based systems. I have conquest compiled on my redhat system, so I wanted a startup script init.d could use. This is what I came up with:


    However, it's very rough and I think it could be better, but not sure what to add. Any comments appreciated.

  • OK actually the above script didn't work at all. I'm attaching one I've developed further, and it still doesn't work:

    Bash
    #!/bin/sh## Startup script for Conquest## chkconfig: 345 85 15 - start or stop process definition within the boot process# description: Conquest DICOM Server# processname: conquest# pidfile: /var/run/conquest.pid# Source function library. This creates the operating environment for the process to be started. /etc/rc.d/init.d/functionsCONQ_DIR=/usr/local/conquestcase "$1" in start) echo -n "Starting Conquest DICOM server: " cd $CONQ_DIR && daemon --user mruser ./dgate -v - Starts only one process of a given name. echo touch /var/lock/subsys/conquest ;; stop) echo -n "Shutting down Conquest DICOM server: " killproc conquest echo rm -f /var/lock/subsys/conquest rm -f /var/run/conquest.pid - Only if process generates this file ;; status) status conquest ;; restart) $0 stop $0 start ;; reload) echo -n "Reloading process-name: " killproc conquest -HUP echo ;; *) echo "Usage: $0 {start|stop|restart|reload|status}" exit 1esacexit 0


    What I'm getting is

    Code
    # ./conquest start
    Starting Conquest DICOM server: -bash: ./dgate: No such file or directory
    [FAILED]


    Can someone please tell me why this redhat init.d script isn't working? Or perhaps provide one that will?

  • Quote from churnd

    OK actually the above script didn't work at all. I'm attaching one I've developed further, and it still doesn't work:

    Bash
    #!/bin/sh## Startup script for Conquest## chkconfig: 345 85 15 - start or stop process definition within the boot process# description: Conquest DICOM Server# processname: conquest# pidfile: /var/run/conquest.pid# Source function library. This creates the operating environment for the process to be started. /etc/rc.d/init.d/functionsCONQ_DIR=/usr/local/conquestcase "$1" in start) echo -n "Starting Conquest DICOM server: " cd $CONQ_DIR && daemon --user mruser ./dgate -v - Starts only one process of a given name. echo touch /var/lock/subsys/conquest ;; stop) echo -n "Shutting down Conquest DICOM server: " killproc conquest echo rm -f /var/lock/subsys/conquest rm -f /var/run/conquest.pid - Only if process generates this file ;; status) status conquest ;; restart) $0 stop $0 start ;; reload) echo -n "Reloading process-name: " killproc conquest -HUP echo ;; *) echo "Usage: $0 {start|stop|restart|reload|status}" exit 1esacexit 0


    What I'm getting is

    Code
    # ./conquest start
    Starting Conquest DICOM server: -bash: ./dgate: No such file or directory
    [FAILED]


    Can someone please tell me why this redhat init.d script isn't working? Or perhaps provide one that will?


    Little rusty with RH..


    Can you start dgate manually from the terminal?


    IIRC, there is a configuration file somewhere to declare env path.
    Otherwise, maybe put


    cd /usr/local/conquest/


    before trying to ./dgate


    looks like you are not getting to the correct directory to start dgate.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!