5

After a failed Ubuntu version upgrade, a computer started behaving oddly. After initially failing to boot, we managed to make it get to the command line - but it refuses to network (so no apt, no LDAP, no NFS...). I could SSH into the machine, but no outgoing traffic attempts succeeded. Apparently the upgrade uninstalled network-manager, so I tried to get it back by scp-ing the required .deb files, but... no go. modemmanager, network-manager fail with

Error getting authority: Error initializing authority: Error calling StartServiceByName for org.freedesktop.PolicyKit1: GDBus.Error:org.freedesktop.systemd1.UnitMasked: Unit polkitd.service is masked. (g-io-error-quark, 36)

and policykit-1 is saying

polkitd.service is a disabled or a static unit not running, not starting it.

So looking at polkitd, indeed, it is masked:

$ systemctl is-enabled polkitd.service
masked-runtime

(a working system shows static).

What is happening, and how do I repair my failed node?

EDIT in response to comments:

$ ls /etc/systemd/system
avahi-daemon.service
avahi-daemon.socket
click-system-hooks.service
dbus-org.freedesktop.Avahi.service
dbus-org.freedesktop.ModemManager1.service
dbus-org.freedesktop.nm-dispatcher.service
default.target.wants
display-manager.service.wants
gdm.service
getty.target.wants
graphical.target.wants
halt.target.wants
hibernate.target.wants
hybrid-sleep.target.wants
kexec.target.wants
multi-user.target.wants
nfs-client.target
nfs-server.service
ofono.service
osspd.service
plymouth-log.service
plymouth.service
polkitd.service.d
portmap.service
poweroff.target.wants
printer.target.wants
reboot.target.wants
resolvconf.service
shutdown.target.wants
sockets.target.wants
sshd.service
suspend.target.wants
sysinit.target.wants
syslog.service
urfkill.service

EDIT

# ls -al /etc/systemd/system/polkitd.service.d/
total 8
drwxr-xr-x  2 root root 4096 Dec 15 10:50 .
drwxr-xr-x 19 root root 4096 Dec 15 10:50 ..

I deleted the empty directory in question and rebooted; the service is now static as it should be, I managed to install network-manager.

However, network was still unreachable, so something else was wrong. I can ping my gateway... so I took a look at resolv.conf, and it was a broken link:

$ ls -al /etc/resolv.conf
lrwxrwxrwx 1 root root 29 May 14  2015 /etc/resolv.conf -> ../run/resolvconf/resolv.conf

So I copied it from another machine; now network works! I also had to install nfs-common and nfs-kernel-server, because for some reason they had disappeared (and I did not notice) to get my autofs running.

  • 1
    What is the content of /etc/systemd/system/ ? – Jesse Scherer Dec 17 '15 at 15:33
  • @jjjjoe: Edited in. – Amadan Dec 18 '15 at 0:46
  • /etc/systemd/system/polkitd.service.d doesn't exist on my Ubuntu system. Is yours a directory and is it empty? If yes, does rmdir /etc/systemd/system/polkitd.service.d and rebooting help? If no, what's the content of the files in that directory? – blubberdiblub Dec 19 '15 at 13:33
  • @blubberdiblub: I would not have gotten it without your hint - the bounty is yours if you will submit an answer. – Amadan Dec 21 '15 at 2:16
  • Thank you, but it was just guesswork on my behalf, so I'd rather pass. I think it would be more helpful for others having the same problem if you could describe what you actually did to solve it and post that as an answer (answering your own questions is perfectly fine). – blubberdiblub Dec 21 '15 at 9:29
1

Forced by the bounty deadline, I repeat blubberdiblub's answer:

/etc/systemd/system/polkitd.service.d doesn't exist on my Ubuntu system. Is yours a directory and is it empty? If yes, does rmdir /etc/systemd/system/polkitd.service.d and rebooting help?

Yes, it is - and yes, it does. I did precisely as suggested, and the error disappeared.

0

I know I'm late but first check if it is a link to /dev/null

ls -l /lib/systemd/system/xxx.service

if yes, simply unlink it:

sudo unlink /lib/systemd/system/xxx.service

Then you need to reload your daemons:

sudo systemctl daemon-reload

Check again the status:

sudo systemctl status xxx

and finally you can restart it:

sudo systemctl restart xxx

Be aware that you have lost your service file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.