Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion daemon_linux_systemd.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ func (linux *systemDRecord) Install(args ...string) (string, error) {
if err != nil {
return installAction + failed, err
}

execDir := path.Dir(execPatch)

templ, err := template.New("systemDConfig").Parse(systemDConfig)
if err != nil {
Expand All @@ -84,12 +86,13 @@ func (linux *systemDRecord) Install(args ...string) (string, error) {
if err := templ.Execute(
file,
&struct {
Name, Description, Dependencies, Path, Args string
Name, Description, Dependencies, Path, Dir, Args string
}{
linux.name,
linux.description,
strings.Join(linux.dependencies, " "),
execPatch,
execDir,
strings.Join(args, " "),
},
); err != nil {
Expand Down Expand Up @@ -205,6 +208,7 @@ Requires={{.Dependencies}}
After={{.Dependencies}}

[Service]
EnvironmentFile={{.Dir}}/.env
PIDFile=/var/run/{{.Name}}.pid
ExecStartPre=/bin/rm -f /var/run/{{.Name}}.pid
ExecStart={{.Path}} {{.Args}}
Expand Down