Restart/manage services from ssh command line

Is it possible to restart services from the command line?
e.g I’d like to restart nginx using service nginx restart
I’m sure part of this is that I don’t understand enough docker … yet.

1 Like

Hey @mcheck, welcome to the Community Forum! :smiley:
You can indeed restart those services from the command line, and using this exact command.

What you do get when you type it?
Are you using Windows or MacOS?

To be able to see all the services running and its status, you can type
service --status-all

That way you’ll get a list of services running and their names, so you can give commands (start/stop/status/restart).
If you are not running nginx on the environment, you’ll get nginx: unrecognized service when you type the command you provided.

If you are not running nginx on the environment, you’ll get nginx: unrecognized service when you type the command you provided.

This is a little embarrassing. I had been working on systems all afternoon that were nginx, but at that moment, it was an apache installation. So, of course there is no nginx service!

I’ll just quietly back out of the room… :slight_smile:

Thanks for answering the question!

1 Like

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.