svc is a small Go CLI for creating and updating systemd service units, then wrapping common systemctl lifecycle commands.
- Interactive
createandupdateflows - Prompts default the run user to the current shell user
- Generates service files in
/etc/systemd/systemby default - Wraps
systemctl enable,disable,start,stop,restart, andstatus
go build -o svc .svc create my-app
svc update my-app
svc enable my-app
svc start my-app
svc restart my-appcreate and update support flags for non-interactive use:
svc create my-app \
--description "My application" \
--exec "/usr/local/bin/my-app --serve" \
--run-user "$USER" \
--workdir /opt/my-app \
--after network.target \
--env APP_ENV=prod \
--wanted-by multi-user.targetBecause the default service directory is /etc/systemd/system, writing units and calling systemctl usually requires elevated privileges.