So you're trying to uninstall or reinstall zabbix and getting the very helpful
error message.
The real error occurs a few lines up in
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
save that and either run it manually with
or go ahead and run
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
Code:
/usr/bin/dpkg returned an error code (1)
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
# res="$RET"
# db_stop || true
# if [ "$res" = "true" ] && [ -x /etc/init.d/apache2 ]; then
# invoke-rc.d apache2 restart
# fi
Code:
sh /var/lib/dpkg/info/zabbix-frontend-php.postrm remove
Code:
apt remove zabbix-frontend-php
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