Commit 83195606 authored by Kamil Trzciński's avatar Kamil Trzciński 🔴

Pass --user to run for purpose of executing shell scripts

parent 5d54ad54
......@@ -428,6 +428,11 @@ func init() {
Value: defaultServiceName,
Usage: "Use different names for different services",
},
cli.StringFlag{
Name: "user, u",
Value: "",
Usage: "Use specific user to execute shell scripts",
},
cli.BoolFlag{
Name: "syslog",
Usage: "Log to syslog",
......
......@@ -129,6 +129,10 @@ func RunServiceControl(c *cli.Context) {
svcConfig.Arguments = append(svcConfig.Arguments, "--service", sn)
}
if user := c.String("user"); !isUserService && user != "" {
svcConfig.Arguments = append(svcConfig.Arguments, "--user", user)
}
s, err := service.New(&NullService{}, svcConfig)
if err != nil {
log.Fatal(err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment