Failed to restart octoprint srvc: Unit octoprint.service not found

Happy New Year!


As a continuation to the above post:

I reviewed few posts on this issue but none of them apply in my case.

My octoprint server has been working fine for several months but, I just cannot find where octoprint.service is located at therefore, I can restart it using the web UI.

sudo service octoprint restart doesn't work/exists and
sudo find . -name octoprint-service sudo find . -name octoprint* retuns nothing.

.octoprint/scrips is empty. doesn't help me.

So, where do I go from here?

One more info:

pi@piserver:~/OctoPrint $ cat pyvenv.cfg
home = /usr/bin
include-system-site-packages = false
version = 3.11.2
executable = /usr/bin/python3.11
command = /usr/bin/python -m venv /home/pi/OctoPrint

It does not look like you are using OctoPi, so unless you made a service file (or used a script that generated one) it does not exist.

We definitely need more details about your system and how OctoPrint was installed. If it's Python 3.11 I don't suspect it was that long ago. How was it installed/which guides did you use to install it?

Not sure what is OctoPi. I don't recall making changes during the installation.

Unfortunately, I don't remember which tutorial I followed to install it but it wasn't too long ago as I'm running it on "bookworm". Python's ver. is indeed 3.11.2.

Under the /home/pi/Octoprint directory I've the following:
bin include lib lib64 pyvenv.cfg

This morning I searched in crontab and found the line which starts the server at boot:
@reboot /home/pi/OctoPrint/bin/octoprint serve.

So, what should I put in the "Restart OctoPrint" under the Server settings to restart Octoprint via the web UI?

It seems like your best option would be to follow the "systemd" section of to install the octoprint.service file. Where the instructions on that page say "make necessary modifications", you would need to edit the file so that the ExecStart line matches the location of octoprint on your system (based on your last post, that would be /home/pi/OctoPrint/bin/octoprint).
Once that is done, remove the line that starts octoprint from your crontab to prevent conflicts, and reboot to make sure octoprint starts correctly.
Then you can use one of the standard commands sudo service octoprint restart or sudo systemctl restart octoprint as your "Restart OctoPrint" command.

Hope this helps!

It sure did help. Thank you!

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