Ad Widget

Collapse

debian zabbix-frontend-php uninstall error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • almostdvs
    Junior Member
    • Nov 2015
    • 1

    #1

    debian zabbix-frontend-php uninstall error

    So you're trying to uninstall or reinstall zabbix and getting the very helpful
    Code:
      /usr/bin/dpkg returned an error code (1)
    error message.

    The real error occurs a few lines up in
    Code:
    invoke-rc.d: initscript apache2, action "restart" failed.
    dpkg: error processing package zabbix-frontend-php (--remove):
      subprocess installed post-removal script returned error exit status 1

    Essentially what's happening is the post removal script for debian is trying to restart apache2. Now if your zabbix or zabbix-frontend-php specifically was the only reason apache2 was installed apache2 was already uninstalled when you ran 'apt remove zabbix-frontend-php'. Obviously you can't restart a service that no longer exists.

    So what i did was edit /var/lib/dpkg/info/zabbix-frontend-php.postrm and commented out the if statement that restarts apache webserver

    # db_get zabbix-frontend-php/restart-webserver
    # res="$RET"
    # db_stop || true
    # if [ "$res" = "true" ] && [ -x /etc/init.d/apache2 ]; then
    # invoke-rc.d apache2 restart
    # fi
    save that and either run it manually with

    Code:
    sh /var/lib/dpkg/info/zabbix-frontend-php.postrm remove
    or go ahead and run
    Code:
    apt remove zabbix-frontend-php
    which will call the same script

    I'm not good enough linux sys admin wise to suggest a code change to this script but at the very least it should complete the rest of the script if this apache2 restart statement fails. Ideally it should probably check if apache2 is still installed before it tries to restart it.

    A very helpful guy on the irc channel suggested I submit an issue. But I am switching positions tomorrow and won't be managing zabbix for a while. I'm making this forum post to help anyone who googles this issue.

    This was version 2.4.6 installed on a fresh debian 8 'jessie' using the zabbix repo from repo.zabbix.com
Working...