Comments (3)
To the best of my knowledge, this is the correct setting:
If you are running OctoPrint in a container you can only affect events in the container so you are limited to restarting the OctoPrint service (or any other process running inside the container).
Even were it shown to be possible, a process running inside a container shouldn't be instructing the host system to shutdown or reboot because that breaks containerisation. But, if your goal is to let the OctoPrint UI control the host system, I think the question to ask is why you want to run OctoPrint in a container? Why not just install it natively? Then it can do what you want.
If you simply want to do the equivalent of shutting down or rebooting the container remotely (which is what clicking on the UI buttons actually is - you're "remote" in a browser) then you can try alternatives like Portainer or SSH. Sending remote SSH commands to terminate+start or restart containers is something I do a fair bit, usually as part of a script doing something else.
I think, though, a better question might be to ask what you are trying to achieve? Why do you want OctoPrint to be able to restart either the container itself or the host system? I leave OctoPrint running all the time so I can upload GCODE files even when the printer is not switched on. Then, when I want to print something, I turn on the printer, tell OctoPrint to connect to the printer, select a file, and away it goes. I can't think of any benefit to not having it running 24x7.
from octoprint-docker.
After a bit more tinkering:
$ docker exec octoprint killall s6-svscan
seems to have the same effect as a reboot - the container terminates and the docker-compose restart: unless-stopped
policy kicks in. So, at a pinch, you could change the "Restart system" field to killall s6-svscan
but I don't think it does anything more than the Restart OctoPrint
. In particular, it doesn't look like a killall has the effect of terminating and recreating the container (in the docker sense) so, if there is any "mess" left around as a side effect of the killall, you're not getting a clean slate, in the same way you would if OctoPrint was a native install and you rebooted the host.
from octoprint-docker.
Your absolutely right. I was using a Pi3 until now for octoprint and when I didn't need the printer I shut everything down. But of crouse this doesn't make sense with a docker container. I went for it because of the easier installation but it seems I have to do the work 😏
from octoprint-docker.
Related Issues (20)
- marlin-binary-protocol missing
- Config_Directory not properly initiated HOT 3
- Q: what is the preffered method of updating the octoprint-docker container? HOT 1
- [BUG] octoprint/octoprint:latest or :1.8.6 not up to date HOT 4
- Q: octoprint-docker on Windows HOT 2
- Multiple Webcam Support
- [BUG] Multi camera support uses wrong port HOT 1
- Can't get webcam working
- Multiple processes of mjpg streamer started HOT 7
- [BUG] Webassets are not loaded when X-Script-Name is set HOT 3
- [BUG] Loading error: Passive login failed. raspi 4 HOT 8
- Docker container with camera-streamer HOT 3
- [BUG] `undefined` tag is present on Dockerhub HOT 1
- AttributeError: 'Babel' object has no attribute 'app' HOT 5
- [BUG] validating /<path>/docker-compose.yml: (root) Additional property payload is not allowed HOT 2
- upgrade to bookworm release python HOT 3
- [BUG] and proposed fix for "PermissionError: [Errno 1] Operation not permitted" due to libseccomp2 HOT 1
- [BUG] mjpg_steamer fails and needs to be restarted
- Q: How do I use with CasaOS HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from octoprint-docker.