Failed to start service: Unit service not found -- Upgrading Ubuntu from 14.04 to 16.04

Failed to start service: Unit service not found -- Upgrading Ubuntu from 14.04 to 16.04
Photo by Christin Hume / Unsplash

Just this week I decided I would finally make the jump from Ubuntu 14.04 to 16.04 on this server. (I try to stick with the LTS versions of Ubuntu so I never really spent any time in Ubuntu 15.04.) I went ahead and took a snapshot of my EBS in AWS (just in case something went wrong) and started the upgrade. After the upgrade completed and the server was back online... my blog was not. I use the Ember based Ghost blogging platform for managing my personal site and for some reason the service was not starting!

Now, I know that my service is started from a .conf file I created in /etc/init/ but no matter what, Ubuntu kept returning "Failed to start ghost-cameronezell.com.service: Unit ghost-cameronezell.com.service not found". It turns out that between the LTS versions of Ubuntu, Canonical decided that 15.04 would be the start of a transition from upstart to systemd as the default for managing boot and system service startup.

My upstart scripts in /etc/init/ aren't super complex, so I could go ahead and begin rewriting these and transition to systemd, but it was past midnight and I had work the next morning. So, I took the quick and easy route to get up and running and switched back to upstart for my service initialization:

  1. sudo apt-get install upstart-sysv

  2. sudo update-initramfs -u

After a reboot, I was back up and running! And after I go ahead and transition these init scripts to systemd, I'll just need to install systemd-sysv and ubuntu-standard. That way I'll be ready for the next LTS upgrade :)

Mastodon