Skip to content

Switch from privileged to unprivileged on DEB/RPM #11460

@michalpristas

Description

@michalpristas

In a current codebase we assume service path to be located at /etc/sytemd/system...

unitFilePath := "/etc/systemd/system/" + paths.ServiceName() + ".service"

serviceFilePath := fmt.Sprintf("/etc/systemd/system/%s.service", paths.ServiceName())

serviceFilePath := fmt.Sprintf("/etc/systemd/system/%s.service", serviceName)

in kardianos as well
https://github.com/kardianos/service/blob/b7ded6fcb7497ba4f88edf9cc3445411175b8897/service_systemd_linux.go#L79

but our package spec for deb says /lib/systemd/system/...

/lib/systemd/system/{{.BeatServiceName}}.service:

this breaks unprivileged/privileged subcommands in a way

Error: failed to read service file /etc/systemd/system/elastic-agent.service: open /etc/systemd/system/elastic-agent.service: no such file or directory

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions