During the upgrade of Debian or Ubuntu server you may encounter strange failing of scripts which are restarting services.
For some reason it’s not possible to call systemcl and any operation fails with Access denied even for root.
Here is example:
The fix to this problem it is sufficient to send TERM signal to process with PID #1: