Skip to content

Add sysv as a machine provider in moonraker - #379

Closed
jamesturton wants to merge 2 commits into
mainfrom
moonraker-sysv-provider
Closed

jamesturton wants to merge 2 commits into
mainfrom
moonraker-sysv-provider

Conversation

@jamesturton

Copy link
Copy Markdown
Collaborator

This allows users to start, stop and restart sysvinit services from mainsail and fluidd, as well as shutdown and restart the machine. This is particularly useful when changing cosmos.conf variables the machine no longer needs to be restarted, rather just the effected services.

image

This PR is much bigger than I was initially planning as I also had to fix up two other issues for getting this working while keeping the actual patch to moonraker itself small:

  • A lot of the system files did not return the correct return code when querying their status. I could have made the implementation in moonraker more relaxed to fit our existing init scripts, but in the attempt of doing something that might one day be upstreamable I took the opportunity to fix them.
  • The bigger and more strange issue was that moonraker tries to check if it is being run within a container by looking at the process name of PID 1. Now, yocto comes with two ways that that zram can be initialised but both have the similar idea: call a small shim from u-boot to init the zram and then call the proper init script. The two ways it's implemented in yocto are either: call the zram shim preinit and then call init from that, or rename the proper init script to be init.orig and then call the zram shim init. I took the second approach as it is default for u-boot to call /sbin/init, but this triggers moonrakers virtualisation check as the process name of PID 1 becomes init.orig. So setting OVERLAYFS_ETC_USE_ORIG_INIT_NAME = "0" and setting init=/sbin/preinit in u-boots bootargs solves this without further hacks to moonraker. Ughh

This fixes sending reboot and shutdown commands
Also allows users to restart sysvinit services
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

✅ Build Artifacts

Branch: moonraker-sysv-provider
Build: 0721c6b (merge into main)

Artifact Size
centauri-carbon-2 Elegoo OTA 112.52 MB
centauri-carbon-1 Firmware 89.89 MB
centauri-carbon-2 Firmware 89.58 MB

View workflow run

This branch was successfully deployed

1 active deployment
approval-given — 0721c6be Deployed Oct 4, 2026 by jamesturton via approve #757
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant