1

My wireless is a bit buggy on Ubuntu, every now and then the DNS will cut out for no reason, and I'll need to run sudo restart network-manager to actually fix it.

However I just upgraded to 15.04, and after experiencing the DNS problem again I tried to restart network manager- however, I was greeted with the error restart: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused

I saw another AskUbuntu question which said the problem was related to systemd vs upstart, and that to fix I could reinstall upstart. I did so, using the command

sudo apt-get install upstart-sysv

However this did not seem to fix my not being able to restart network manager.

My question is twofold- if necessary, how can I roll back the changes I made to my system by installing upstart, and how can I make so that I can actually restart network manager?

Alternatively, I'd accept some help with solving my DNS errors, but historically no one has really been able to help me with that.

2 Answers2

2

The service management system has changed.

Every system management toolset has own utilities. The utility that you are used to using is one of the ones that come with upstart, which is a trivial shim for initctl restart. But this is Ubuntu version 15. You aren't using upstart any more.

You're using systemd, and the service control commands are subcommands of systemctl rather than of initctl. So services are started with systemctl start, stopped with systemctl stop, enabled with systemctl enable, disabled with systemctl disable, queried with systemctl status, and restarted with systemctl restart.

upstart was already there.

Upstart was already installed on your system. Otherwise there wouldn't have been its restart program to run in the first place and you wouldn't have even seen its error messages. It simply wasn't running as the active system management system.

Installing the upstart-sysv package is using a sledgehammer to crack a walnut. You can switch to upstart on the fly from the GRUB menu. Doing that in this case wouldn't have got you into the mess that you are in now, where you now want to switch back. Indeed, switching to upstart at all is using a sledgehammer to crack a walnut, when all that you really needed to do was learn the systemd commands, which aren't that different from the initctl ones.

The Release Notes say that installing that package has removed two others. So fairly obviously you need to install those two others again. ☺

killall is yet another sledgehammer.

As the name suggests, it doesn't discriminate, and just kills everything by a particular name. You don't need this, even with upstart. Both systemd and upstart track exactly which processes they need to kill in order to restart services, and only those services, because they spawned the processes in the first place. If you have even halfway-decent service managers on your system, then you should never be approaching things with killall. Just use the commands that are provided by the service management toolsets.

On similar grounds, sudo NetworkManager is another clanger. That will start NetworkManager in the wrong execution context. Again, use the service management toolset's commands for starting dæmons.

Further reading

  • Lennart Poettering (2013-10-07). systemctl. systemd manual pages. freedesktop.org.
  • James Hunt and Clint Byrum (2014). "Utilities". Upstart Cookbook.
  • Sebastien Bacher (2015-04-24). "Boot and service management". Ubuntu 15 Release Notes. Canonical.
JdeBP
  • 3,959
0

As of 15.04, Ubuntu is now using systemd, not upstart, similar to most other distro releases now. Do not install upstart and run upstart commands to manipulate services unless you really know what you're doing. If you have upstart installed, I'd recommend uninstalling it.

To restart network manager as non-root, since it runs as a daemon process:

sudo killall NetworkManager && sudo NetworkManager

should work fine

theferrit32
  • 551
  • 4
  • 9