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 Display string
Description string Description string
Path string Path string
Arguments []string
}{ }{
s.DisplayName, s.DisplayName,
s.Description, s.Description,
path, path,
s.Config.Arguments,
} }
err = flavor.Template().Execute(f, to) err = flavor.Template().Execute(f, to)
@@ -321,7 +323,7 @@ const systemVScript = `#!/bin/sh
# Description: {{.Description}} # Description: {{.Description}}
### END INIT INFO ### END INIT INFO
cmd="{{.Path}}" cmd="{{.Path}}{{range .Arguments}} {{.|cmd}}{{end}}"
name=$(basename $0) name=$(basename $0)
pid_file="/var/run/$name.pid" pid_file="/var/run/$name.pid"
@@ -422,7 +424,7 @@ pre-start script
end script end script
# Start # Start
exec {{.Path}} exec {{.Path}}{{range .Arguments}} {{.|cmd}}{{end}}
` `
const systemdScript = `[Unit] const systemdScript = `[Unit]