unsloth/studio/systemd
Sourav Rajvi fcd16f7e11
Studio: opt-in systemd user service for Linux auto-start (#9308)
* Studio: optional systemd user service for Linux auto-start (#9258)

Add a managed user-level systemd unit (Restart=on-failure) and an opt-in
install.sh prompt on Linux. Includes uninstall cleanup, packaging for the
wheel, and regression tests.

Fixes unslothai/unsloth#9258

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix(studio): default systemd unit to 127.0.0.1 bind

Match `unsloth studio` so opting into the user service does not quietly
expose the server on every interface. Keep all-interfaces bind as an
explicit opt-in via UNSLOTH_SYSTEMD_HOST=0.0.0.0 or --host.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix(studio): register systemd installer in parity prompt guard

Approve the opt-in systemd prompt and scan install_user_service.sh so
cross-platform parity CI covers the helper install.sh invokes. Also
document the loopback default in the post-install systemd hints.

* fix(studio): skip systemd prompt without user session (#9308)

Probe systemd user availability before the opt-in question so non-systemd
Linux installs still reach the usual autostart prompt unchanged. Explicit
UNSLOTH_INSTALL_SYSTEMD still attempts setup and reports unavailability.

Add regression tests for the guard and autostart ordering.

* Add the AGPL header to the systemd installer test

* systemd service: opt-in via UNSLOTH_INSTALL_SYSTEMD only, no installer prompt

* Drop a spacer comment line

* Forward UNSLOTH_SYSTEMD_HOST/PORT through the Strix Halo WSL reroute

* Allow the systemd opt-in on WSL, where OS reads wsl

* systemd opt-in: isolate the helper lookup from cwd, reject unit-breaking values, keep user-written units, sturdier uninstall

* systemd opt-in: follow the user manager's HOME for the unit and the uninstaller

* Run the systemd installer tests in parity CI; find a redirected-HOME unit without a bus

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Daniel Han <23090290+danielhanchen@users.noreply.github.com>
2026-10-02 02:19:53 -07:00
..
install_user_service.sh Studio: opt-in systemd user service for Linux auto-start (#9308) 2026-10-02 02:19:53 -07:00
unsloth-studio.service.in Studio: opt-in systemd user service for Linux auto-start (#9308) 2026-10-02 02:19:53 -07:00