Question

systemctl command not found

  • Posted on November 4, 2014
  • lsidenAsked by lsiden

Our project manager set up a droplet. When I set up a service according to https://www.digitalocean.com/community/tutorials/how-to-deploy-node-js-applications-using-systemd-and-nginx 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?

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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]

respawn

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:

Hello there,

If you want to stop/start the services then use the service command.

service <service-name> status/start/stop