Ad Widget

Collapse

HOWTO: Creating Zabbix 1.4.4 packages for Ubuntu 6.06 LTS (Dapper Drake)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jml
    Junior Member
    • Jan 2008
    • 4

    #1

    HOWTO: Creating Zabbix 1.4.4 packages for Ubuntu 6.06 LTS (Dapper Drake)

    Hello Zabbix users,

    I like to use the stable releases for my servers. I also like to use software packages for easy administration and maintenance. As you probably know, finding packages for the latest and greatest(?) on the old stable releases can be a bit problematic at times.

    Here's how I backported the Zabbix 1.4.4 packages from Debian Lenny to Ubuntu 6.06 LTS (Dapper Drake).

    I use these packages myself and they are working just fine (so far).

    This was created on my Ubuntu 7.10 (Gutsy Gibbon) workstation. Other versions of Ubuntu might work with some modifications.

    If you want to follow along step by step, boot up a Gutsy box, workstation or server.


    -- Install prevu --

    Code:
    sudo apt-get install prevu
    Set up a Dapper build environment for prevu.

    Code:
    DIST=dapper sudo prevu-init

    -- Download the Zabbix source --

    I downloaded the Zabbix source package from Debian Lenny.

    Code:
    mkdir ~/tmpdir
    cd ~/tmpdir
    wget http://ftp.de.debian.org/debian/pool/main/z/zabbix/zabbix_1.4.4-2.dsc
    wget http://ftp.de.debian.org/debian/pool/main/z/zabbix/zabbix_1.4.4.orig.tar.gz
    wget http://ftp.de.debian.org/debian/pool/main/z/zabbix/zabbix_1.4.4-2.diff.gz

    -- Unpack the source --

    Code:
    dpkg-source -x zabbix_1.4.4-2.dsc

    -- Edit the control file --

    Code:
    cd ~/tmpdir/zabbix-1.4.4/debian
    Edit the file 'control' and change the build-dep libcurl4-gnutls-dev to libcurl3-gnutls-dev


    -- Fix the init.d scripts --

    Ubuntu uses a tmpfs for /var/run so we need to edit the start scripts a bit.

    Code:
    cd ~/tmpdir/zabbix-1.4.4/misc/init.d/debian
    Edit this file:

    zabbix-agent.init

    Insert this piece of code just before the 'case "$1" in' row.

    Code:
    create_dir_in_var_run() {
        # Create the /var/run/zabbix-agent dir
        if [ ! -d /var/run/zabbix-agent ]; then
            mkdir /var/run/zabbix-agent
            chown zabbix:zabbix /var/run/zabbix-agent
        fi
    }
    Then just after the row 'echo "Starting $DESC: $NAME"' add 'create_dir_in_var_run' like this:

    Code:
    case "$1" in
      start)
        rm -f $PID
            echo "Starting $DESC: $NAME"
            create_dir_in_var_run
            start-stop-daemon --oknodo --start --pidfile $PID \
    Now change BOTH the following files in the same way.

    zabbix-server-mysql.zabbix-server.init
    zabbix-server-pgsql.zabbix-server.init


    Here's a ready block for the lazy ones.

    Code:
    create_dir_in_var_run() {
        # Create the /var/run/zabbix-server dir
        if [ ! -d /var/run/zabbix-server ]; then
            mkdir /var/run/zabbix-server
            chown zabbix:zabbix /var/run/zabbix-server
        fi
    }
    Then again... just after the row 'echo "Starting $DESC: $NAME"' add 'create_dir_in_var_run' like this:

    Code:
    case "$1" in
      start)
        rm -f $PID
            echo "Starting $DESC: $NAME"
            create_dir_in_var_run
            start-stop-daemon --oknodo --start --pidfile $PID \
    I'm sure you didn't forget to edit both files, so let's move on.


    -- Build a new source package --

    Code:
    cd ~/tmpdir/zabbix-1.4.4
    debuild-pbuilder -us -uc -S

    -- Backport to Dapper --

    Now run prevu on the new source package.

    Code:
    cd ~/tmpdir
    DIST=dapper sudo prevu zabbix_1.4.4-2.dsc

    -- Backport the dbconfig-common package --

    Let's satisfy the dbconfig-common (>= 1.8.19) package dependency. The one in Gutsy will do just fine.

    Code:
    DIST=dapper sudo prevu dbconfig-common

    -- Almost done! --

    Code:
    cd /var/cache/prevu/dapper-debs/
    Copy *.deb to your Dapper box.


    -- Installing the packages on your Dapper box --

    UNcomment the universe sources in your /etc/apt/sources.list and run sudo apt-get update

    Now install the packages you want on this machine. The server packages depend on the dbconfig-common package so you want to start with that one.

    Code:
    sudo dpkg -i dbconfig-common_1.8.35~6.06prevu1_all.deb
    Do the same for the any other package you wish to install... like the mysq-server or the pgsql-server or maybe just the agent.

    If you get any dependency problems here just apt-get (-f) install the missing packages.

    Follow the on screen instructions and you're done!


    I'm sure there are ways to cut corners here and there, especially in the script editing. Feel free to share!

    // jml
  • raghaven.kumar
    Member
    • Mar 2008
    • 34

    #2
    Can we install the packages created like above for gutsy(7.10)???
    Last edited by raghaven.kumar; 22-03-2008, 14:04.

    Comment

    • jml
      Junior Member
      • Jan 2008
      • 4

      #3
      I don't think so, although the process to make your own Gutsy packages is similar. Luckily someone has already done that for you.

      Check out this blog post for your Gutsy Zabbix packages.

      Comment

      • raghaven.kumar
        Member
        • Mar 2008
        • 34

        #4
        Thanks to you im able to backport zabbix for all ubuntu distros.

        Comment

        Working...