SSH Command to shutdown server?

What is the problem?

Is there a way to shutdown only the OctoPrint Server without shutdown the raspberry?

Additional information about your setup

Octoprint installed on Raspbian

Assuming OctoPi:

sudo systemctl stop octoprint

It says:
Failed to stop octoprint.service: Unit octoprint.service not loaded.

But i can open it in the browser.

Ah nevermind I missed the Raspbian bit. Can't really say as it depends on how you installed it.

If you have fallowed the guide "Setting up OctoPrint on a Raspberry Pi running Raspbian or Raspberry Pi OS" you can see in the "Automatic start up" section the command:

sudo service octoprint {start|stop|restart}

I'd expect the same result since service is essentially just a wrapper for systemd's systemctl. Curious to find out though.

So in some way your install appears to be non-standard. You can search which process it is by

ps aux|grep octoprint
dp        3372  0.0  0.0   7680   548 pts/0    S+   20:57   0:00 grep --color=auto octoprint
pi       27692  9.7 13.3 443100 118840 ?       Ssl  Mar07 306:22 /home/pi/oprint/bin/python3 /home/pi/oprint/bin/octoprint serve --host= --port=5000

which yields 2 processes when I do that here, my search and the server. You can ignore the search, it has already finished once you read the output. If you want to just terminate the server process, the command 'kill' will do that.

sudo kill -s KILL 27692

In spite of it's name kill just sends a signal to the process identified by the process id (27692 in this example). And the signal is KILL. A request to self-destruct.

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