Automic Workload Automation

Expand all | Collapse all

Startup Script for Unix / Linux

  • 1.  Startup Script for Unix / Linux

    Posted 01-17-2013 10:59 AM
      |   view attached
    Attached is an example startup script for the Unix / Linux Service Manager. Usage: startsmgr.sh

    Attachment(s)

    txt
    uc4_servicemanager.txt   2K 1 version


  • 2.  Startup Script for Unix / Linux

    Posted 01-18-2013 04:21 PM
    Great stuff Dave. I put in a request to be able to attach batch files directly so that you wouldn't have to change to a .txt.  Same for .xml and other file formats.


  • 3.  Startup Script for Unix / Linux

    Posted 01-19-2013 05:21 PM
    Also often get asked by users how to set up the init.d file to autostart Service Manager at reboot. Would be good to have detailed instructions here


  • 4.  Startup Script for Unix / Linux

    Posted 01-20-2013 05:03 PM
    I just saw a ticket come through in Support asking for assistance on setting this up for HPUX. :-)


  • 5.  Startup Script for Unix / Linux

    Posted 02-05-2013 08:48 AM
      |   view attached
    I had extended Dave script, it starts the service manager but also makes sure that the environment variables are correctly defined. The ZIP archive includes also a short installation note, incl. the preparation of the start and stop scripts.

    Attachment(s)



  • 6.  Startup Script for Unix / Linux

    Posted 02-22-2013 11:18 AM
    Thanks for the examples.  Here are couple other useful tricks: pkill Linux & Solaris support the command "pkill".  This command is simple to use to kill things (no looking up PIDs): syntax pkill -U user process-search-string example pkill -U uc4 ucybsmgr Service Manager Command Line Many of the java agents (SQL, RAs) do not stop when Service Manager is killed.  So prior to killing Service Manager using the Service Manager Command Line to stop these Agents. syntax ./ucybsmcl -c STOP_PROCESS -h Server:ServiceManagerPort -n UC4System -s "uc4.smdProcessDescription" example ./ucybsmcl -c STOP_PROCESS -h localhost:8871 -n UC4 -s "UC4 RA_FTP"


  • 7.  Startup Script for Unix / Linux

    Posted 07-26-2013 06:29 AM
    New version of the Startup Script. It uses Automic instead of UC4. Beside that no new features except for one fix.


  • 8.  Startup Script for Unix / Linux

    Posted 10-28-2013 11:11 AM
    New version of the script. It fixes an issue on Solaris machines


  • 9.  Startup Script for Unix / Linux

    Posted 01-28-2014 10:46 AM

    This new update supports the Linux 'chkconfig' feature.




  • 10.  Startup Script for Unix / Linux

    Posted 09-25-2014 08:47 AM
    Being happy for eventually managed to create an init.d script for uc4 service manager on linux (centos 6), I feel the need to share my "achievement"  ;).  So far it seems to be simple, readable and working. The only prerequisite is the "daemonize" util (yum install deamonize) which as fas as I know is available to any unix/linux distro.

    Cheers
    Feel free to comment or suggest.

    ## =================UC4 Service Manager Init Script ============================
    #!/bin/bash
    #
    # uc4.svcmgr    UC4 Service Manager
    #
    # chkconfig: 345 70 30
    # description: uc4 service manager
    # processname: ucybsmgr  

    # Source function library.
    . /etc/init.d/functions

    # Service settings
    # see: http://ae.koroglu.org/alternative-way-to-daemonize-java-applications-on-red-hat-centos-linux/

    service_dir="/home/uc4/automic/svcmgr/bin"
    service_name="ucybsmgr"
    service_prog="$service_dir/$service_name"                         # Service name
    service_user="root"                                               # User/group of process
    pid_file="/var/run/$service_name.pid"                             # Pid file
    log_file="/var/log/$service_name.log"                             # StdOut log file
    errlog_file="/var/log/$service_name-error.log"                    # StdErr log file
     
    RETVAL=0
    start() {
        echo -n $"Starting $service_name: "
        if [ $EUID -ne 0 ]; then
            RETVAL=1
            failure
        elif [ -s /var/run/$service_name.pid ]; then
            RETVAL=1
            echo -n $"already running.."
            failure
        else
            daemonize -u $service_user -p $pid_file -o $log_file -e $errlog_file -c $service_dir $service_prog && success || failure
            RETVAL=$?
            [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$service_name
        fi;
        echo
        return $RETVAL
    }
     
    stop() {
        echo -n $"Stopping $service_name: "
        if [ $EUID -ne 0 ]; then
            RETVAL=1
            failure
        else
            killproc -p $pid_file
            RETVAL=$?
            [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$service_name
        fi;
        echo
        return $RETVAL
    }
     
    restart(){
        stop
        start
    }
     
    case "$1" in
        start)
            start
            RETVAL=$?
            ;;
        stop)
            stop
            RETVAL=$?
            ;;
        restart)
            restart
            RETVAL=$?
            ;;
        status)
            status $service_name
            RETVAL=$?
            ;;
        *)
            echo $"Usage: $0 {start|stop|status|restart}"
            RETVAL=2
    esac
    exit $RETVAL