feat: add flm service subcommand for systemd integration - #543
Open
thunderbug1 wants to merge 1 commit into
Open
feat: add flm service subcommand for systemd integration#543thunderbug1 wants to merge 1 commit into
thunderbug1 wants to merge 1 commit into
Conversation
Adds `flm service <install|uninstall|start|stop|status>` to manage FastFlowLM as a systemd service. Install creates a dedicated flm system user, generates a wrapper script and config under /etc/flm/, and installs a hardened systemd unit. Resolves model path from the installing user's home via SUDO_USER so the service can read models without requiring the flm user to own them. New files: - src/include/service.hpp - declarations - src/src/service.cpp - install/uninstall/start/stop/status logic Modified files: - src/include/utils/vm_args.hpp - add service to help text, allow --host/--port for service command - src/src/main.cpp - add service dispatch branch
|
I've been using a user service for that, which seems to work flawlessly. It's a workaround I guess but it isn't a hard one at least. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
flm service <install|uninstall|start|stop|status>to manage FastFlowLM as a systemd serviceflmsystem user, generates a wrapper script and config under/etc/flm/, and installs a hardened systemd unitSUDO_USERso the service can read models without theflmuser needing to own themSolves: #541
New files
src/include/service.hpp— declarationssrc/src/service.cpp— install/uninstall/start/stop/status logicModified files
src/include/utils/vm_args.hpp— add service to help text, allow--host/--portfor service commandsrc/src/main.cpp— add service dispatch branchService details
flm service install(requires sudo):flmsystem user with no login shellflmuser to therendergroup for NPU access (/dev/accel/accel*)SUDO_USER's home directory/etc/flm/service.conf(host, port, model path)/etc/flm/flm-service-wrapper(executable wrapper script)/etc/systemd/system/flm.service(hardened unit withProtectSystem=strict,NoNewPrivileges=true, etc.)flm service statusdoes not require root.Test plan
flm --helpshows the service commandflm servicewithout subcommand shows usage errorflm service installwithout sudo shows root errorflm service statusdelegates to systemctl (confirmed "Unit flm.service could not be found")flm service install --host 0.0.0.0 --port 8000creates all files correctly/etc/flm/service.confhas correct model path from installing user's home/etc/flm/flm-service-wrapperis executable and has correct binary path/etc/systemd/system/flm.servicehas correct hardened settingsflm service startstarts the service and it stays runningflm service statusshows active statusflm service stopstops the serviceflm service uninstallcleans up all filesjournalctl -u flmshows FLM startup logs