systemctl command not found

November 4, 2014 35.5k views

Our project manager set up a droplet. When I set up a service according to and try to run it with sudo systemctl start my-service there is no systemctl command anywhere (also not in /sbin or /usr/sbin). Is that tutorial up-to-date? Is there a different way to create a service?

1 Answer

That tutorial targets Linux distributions that use the systemd init system. That is also what provides the systemctl command. What Linux distribution are you working with? Ubuntu will be moving to systemd in a future release, but currently does not use it. Fedora, CentOS 7, and CoreOS on the other hand all should come with that command available by default.

If you are using Ubuntu, you can accomplish something similar using Upstart. For instance, the systemd service file from that tutorial can be written as an Upstart script like so:

description "Upstart script to launch a node app"

start on (local-filesystems and net-device-up IFACE=eth0)
stop on runlevel [!12345]


setuid srv-node-sample
setgid srv-node-sample
env NODE_ENV=production
chdir  /home/srv-node-sample/

exec /usr/bin/node index.js

For all the details on how to use Upstart, check out:

by Yasin Soliman
Use Upstart for modern, full-coverage initialization. This tutorial explains the concepts behind initialization and provides two practical examples of initialization jobs with Upstart.
Have another answer? Share your knowledge.