add support for program arguments in sysv/upstart

This commit is contained in:
Alan Shreve
2015-03-07 00:08:30 -08:00
parent f42517a455
commit b77e4717bc
+4 -2
View File
@@ -191,10 +191,12 @@ func (s *linuxService) Install() error {
Display string
Description string
Path string
Arguments []string
}{
s.DisplayName,
s.Description,
path,
s.Config.Arguments,
}
err = flavor.Template().Execute(f, to)
@@ -321,7 +323,7 @@ const systemVScript = `#!/bin/sh
# Description: {{.Description}}
### END INIT INFO
cmd="{{.Path}}"
cmd="{{.Path}}{{range .Arguments}} {{.|cmd}}{{end}}"
name=$(basename $0)
pid_file="/var/run/$name.pid"
@@ -422,7 +424,7 @@ pre-start script
end script
# Start
exec {{.Path}}
exec {{.Path}}{{range .Arguments}} {{.|cmd}}{{end}}
`
const systemdScript = `[Unit]