Ad Widget

Collapse

zabbix-server locations

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cm2000
    Junior Member
    • Mar 2009
    • 29

    #1

    zabbix-server locations

    I'm having a few problems with my init.d script, and getting zabbix running.

    I was running 1.6.2, with no problems, and then i upgrade to 1.6.5 by following the info in the PDF Doc.

    The front end is running 1.6.5, but the server process isnt.

    when i run zabbix_server from /usr/sbin - it runs 1.6.5
    when i run the init.d script - it runs 1.6.2

    My init.d script is as below:

    Code:
    #! /bin/sh
    ### BEGIN INIT INFO
    # Provides:          zabbix-server
    # Required-Start:    $local_fs $network
    # Required-Stop:     $local_fs
    # Default-Start:     S
    # Default-Stop:      0 6
    # Short-Description: Start zabbix-server daemon
    ### END INIT INFO
    DAEMON=/usr/sbin/zabbix_server
    NAME=zabbix_server
    DESC="Zabbix server"
    PID=/var/run/zabbix-server/$NAME.pid
    
    DIR=/var/run/zabbix-server
    
    if test ! -d "$DIR"; then
            mkdir "$DIR"
            chown -R zabbix:zabbix "$DIR"
    fi
    
    test -f $DAEMON || exit 0
    
    set -e
    # add these lines after "set -e"
    if ! [ -d `dirname $PID` ]; then
    mkdir -p `dirname $PID`s
    chown zabbix:zabbix `dirname $PID`
    fi
    
    export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
    
    case "$1" in
      start)
        rm -f $PID
            echo "Starting $DESC: $NAME"
            start-stop-daemon --oknodo --start --pidfile $PID \
                    --exec $DAEMON >/dev/null 2>&1
            ;;
      stop)
            echo "Stopping $DESC: $NAME"
            start-stop-daemon --oknodo --stop --pidfile $PID \
                    --exec $DAEMON
            ;;
      restart|force-reload)
            $0 stop
            sleep 2
            $0 start
            ;;
      *)
            N=/etc/init.d/$NAME
            echo "Usage: $N {start|stop|restart|force-reload}" >&2
            exit 1
            ;;
    esac
    
    exit 0

    Whats going on?

    Can someone help me fix my init.d script run 1.6.5 please? It's probably something very simple, but i cannot do it! (I see the paths in the script, but they match fine?)

    Thanks in advance,

    Tom
  • tchjts1
    Senior Member
    • May 2008
    • 1605

    #2
    What OS are you running on? I am installed on Ubuntu and here is my zabbix-server script in init.d

    Code:
    /etc/init.d$ cat zabbix-server
    #! /bin/sh
    #
    # Zabbix daemon start/stop script.
    #
    # Written by Alexei Vladishev <[email protected]>.
    
    NAME=zabbix_server
    PATH=/bin:/usr/bin:/sbin:/usr/sbin:/home/zabbix/bin
    DAEMON=/usr/sbin/${NAME}
    DESC="Zabbix server daemon"
    PID=/var/tmp/$NAME.pid
    
    test -f $DAEMON || exit 0
    
    set -e
    
    case "$1" in
      start)
            echo "Starting $DESC: $NAME"
            start-stop-daemon --oknodo --start --pidfile $PID \
                    --exec $DAEMON
            ;;
      stop)
            echo "Stopping $DESC: $NAME"
            start-stop-daemon --oknodo --stop --pidfile $PID \
                    --exec $DAEMON
            ;;
      restart|force-reload)
            #
            #       If the "reload" option is implemented, move the "force-reload"
            #       option to the "reload" entry above. If not, "force-reload" is
            #       just the same as "restart".
            #
    #       echo -n "Restarting $DESC: zabbix_server"
            $0 stop
            $0 start
    #       start-stop-daemon --stop --quiet --pidfile \
    #               /tmp/$NAME.pid --user zabbix --exec $DAEMON
    #       sleep 1
    #       start-stop-daemon --start --quiet --pidfile \
    #               /tmp/$NAME.pid --user zabbix --exec $DAEMON
    #       echo "$NAME."
            ;;
      *)
            N=/etc/init.d/$NAME
            # echo "Usage: $N {start|stop|restart|force-reload}" >&2
            echo "Usage: $N {start|stop|restart|force-reload}" >&2
            exit 1
            ;;
    esac
    
    exit 0

    Comment

    • cm2000
      Junior Member
      • Mar 2009
      • 29

      #3
      Hi,

      I'm running Ubuntu 8.10 Server.

      I'm guessing i could just copy yours then?

      Ta

      Comment

      • tchjts1
        Senior Member
        • May 2008
        • 1605

        #4
        I would think so. I am running on Ubuntu 8.0.4
        Make any necessary path changes though.

        What is more curious to me is why you are able to launch 2 different versions of Zabbix depending on the way you call the launch script. Sounds to me like you have multiple binaries on your sysetem and your paths are in the start-up scripts are not lined up.

        Comment

        Working...