Comments (16)
This image is actually based on the image you're referring to, but uses a supervisor designed for containers instead of full operating systems.
The command should be (i actually haven't tested it yet):
s6-svc -r /var/run/s6/octoprint
from octoprint-docker.
Just leaving some thoughts here for posterity... @toofewacres to be clear I'm not asking you to respond (unless you want to 😄)
As @ax42 mentioned It's designed to just have a container restarted by the host as the best way, especially if you're doing something that changes the container environment, as a restart is the only way to load updates to the container environment.
The command posted works to restart all services (not just octoprint), but may not have the same effect that restarting octoprint would on a normal operating system (for example after plugin update or intallation), and I'm afraid that could cause problems for users who aren't aware of this.
Almost thinking we need a section in the docs for octoprint-docker about "known differences/issues using octoprint in a container".
That being said, it would be worth investigating ways to trigger a container reload from within the container... although that comes with it's own challenges for container permissions/docker-in-docker types of scenarios.
One possible way would be if the hosts daemon was configured for the api to be acccessible on a port (by default it binds to a fd), and the container could send an http request from within the container to the api to trigger restart of the container.
The other approach is to just create a finish script for the octoprint service that causes the container to shut down, then a command to kill the octoprint service would be the server restart command you would configure... and as long as you're using a restart
option in docker/compose, the container should automatically spin back up.
That last one is the approach I'm going to start with and will go from there.
from octoprint-docker.
I needed to set the restart command to redirfd -w 2 /dev/null s6-svscanctl -t /var/run/s6/services
The default s6-svc -r /var/run/s6/octoprint
did not work for me
from octoprint-docker.
The default is nots6-svc -r /var/run/s6/octoprint
. It is: s6-svc -r /var/run/s6/services/octoprint
from octoprint-docker.
I think this is tricky, as you need to restart the container which is a command on the host. FWIW I've spun up a portainer instance so I can restart containers via a browser https://www.portainer.io/installation/
from octoprint-docker.
That's what I do for now also. I also run Home Assistant and am able to have "switch" which turns docker containers off and on. Works for now.
I used to use a previous docker image (can't remember the name at the the moment) but you could do "supervisorctl docker restart octoprint" and it would restart the docker container from within Octoprint.
from octoprint-docker.
Tried your command and it did not work.
from octoprint-docker.
I did some digging around and came up with this command line that worked:
redirfd -w 2 /dev/null s6-svscanctl -t /var/run/s6/services
There may be a better way to do this, but this is what I found that works.
from octoprint-docker.
Thanks!
from octoprint-docker.
I'm going to reopen if you don't mind, I'd still like to add a restart command suggestion to the documentation.
from octoprint-docker.
If there is a cleaner way of restarting just the Octoprint service, I'm all for it. I searched around last night and I guess I found the brut force method! I'm not all that familiar with the entire docker environment, but love the ease of installation, etc. that it gives you.
from octoprint-docker.
Once #132 is accepted, the command to restart octoprint will be preconfigured and work automatically for the docker image. Just like usual, the user will be able to view or change the restart command from the settings menu.
from octoprint-docker.
@Thermionix have you tried it with the latest updates? I remembered you said this before from the forum, but that was before I added octoprint to the service directory.
from octoprint-docker.
Hi. I started a clean container with the recent release and there was no preconfigured text for the restart setting. I tried both settings that @Thermionix mentionend and can confirm only the first one worked (unreliable though, sometimes server stays offline).
Octoprint output:
2020-12-10 20:21:55,463 - octoprint.server.api.system - INFO - Performing command for core:restart: s6-svc -r /var/run/s6/octoprint
octoprint | 2020-12-10 20:21:55,511 - octoprint.server.api.system - WARNING - Command for core:restart failed with return code 111:
octoprint | ! STDOUT:
octoprint | ! STDERR: s6-svc: fatal: unable to control /var/run/s6/octoprint: No such file or directory
from octoprint-docker.
Uh, that works. Thank you. Fyi, like I said it wasn't preconfigured and I didn't find this command anywhere, maybe add it to readme :)
from octoprint-docker.
yeah, i will be adding it in there. I've noticed there are a few situations when the config doesn't get pre-loaded, and I'm still working through those as well.
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
- Shutdown/Reboot commands 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.