fix(systemd): include service user in service file generation

* Add ServiceUser field to Config struct for user specification.
* Update Generate and Install functions to accept service user.
* Modify tests to reflect changes in service user handling.
This commit is contained in:
Hein
2026-04-08 13:30:07 +02:00
parent e4d6f3a4a2
commit d8c90e4fff
5 changed files with 31 additions and 15 deletions

View File

@@ -27,8 +27,8 @@ func UnitPath(u config.Unit, prefix, suffix string) (string, error) {
}
// Install writes the .service file for a unit and reloads systemd.
func Install(u config.Unit, prefix, suffix string) error {
content, err := Generate(u, prefix, suffix)
func Install(u config.Unit, prefix, suffix, serviceUser string) error {
content, err := Generate(u, prefix, suffix, serviceUser)
if err != nil {
return err
}