Restart commands for MACOS

What is the problem?
I have setup Octoprint on my Mac mini running MacOS1.15.5.
Got all running and connected. On rebooting my Mac I am now stuck in safe mode.

What did you already try to solve it?
I have tried adding the commands:
sudo service octoprint restart
sudo -A service octoprint restart
sudo -S service octoprint restart
From the logs I need to input password to restart. How do I configure this?

From the looks of it
sudo -S service octoprint restart was the closest but want a password. -A I don have an ask pass program.

Logs
2! STDERR: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
2020-06-12 10:49:58,548 - octoprint.server.heartbeat - INFO - Server heartbeat <3
2020-06-12 10:50:29,197 - octoprint.server.api.system - INFO - Performing command for core:restart: sudo -S service octoprint restart
2020-06-12 10:50:29,383 - octoprint.server.api.system - WARNING - Command for core:restart failed with return code 1:
! STDOUT:
! STDERR: Password:
! sudo: no password was provided
2020-06-12 10:51:58,909 - octoprint.server.api.system - INFO - Performing command for core:restart: sudo -A service octoprint restart
2020-06-12 10:51:58,991 - octoprint.server.api.system - WARNING - Command for core:restart failed with return code 1:
! STDOUT:
! STDERR: sudo: no askpass program specified, try setting SUDO_ASKPASS

I have found a solution of manually rebooting my Mac each time, wonder if there is a simpler way of just restarting the service some how?

Hi,

Any solution for restart octoprint without system reboot on MacOSX?

Thanks

the only solution I have found is stopping the terminal window and reopening with Serve Octoprint etc

Hi,

can u give me the exact codes for doing this?

I could not understand what u mean.

Thanks

What they mean was stopping it manually, by closing the window that they run the octoprint serve command.

ok, i install octoprint from this guide
https://community.octoprint.org/t/setting-up-octoprint-on-macos/

as a service.

So i don't have a running terminal window for octoprint server.

Can i terminate octoprint server from osx activity monitor ? what is the process id ? or any other solution ?

i understand to start with octoprint serve command but first of all i need to terminate the server...

Hi,

I have made a shell script with macos automator; Code is;

killall Python
sleep 3
launchctl load /Library/LaunchDaemons/it.username.octoprint.plist

I use https://community.octoprint.org/t/setting-up-octoprint-on-macos/ guide for auto start on boot as a service.

so you need to change "it.username.octoprint.plist" file name to yours.

This script kills octoprint server and restart it. I made a script shortcut to my desktop.

Everything works now...