Deb: skip invoke-rc.d mysql stop if no mysql process is running at all
Quite often in upgrades on systemd systems dpkg emitted an error like: Failed to stop mysql.service: Unit mysql.service not loaded. invoke-rc.d: initscript mysql, action "stop" failed. invoke-rc.d returned 5 There is a MySQL server running, but we failed in our attempts to stop it. Stop it yourself and try again! dpkg: error processing archive /var/cache/apt/archives/mariadb-server-10.2 This is because the mariadb/mysql.service file is not loaded during the upgrade/unpack stage of dpkg in certain situations. With this simple check we can easily skip the shutdown step when it is really not needed, which is for sure the case if no mysqld process at all is running on the entire system.
Showing
Please register or sign in to comment