sevlyar / go-daemon

A library for writing system daemons in golang.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using `os.Args` includes the process bin name

timfallmk opened this issue · comments

commented

From the comment:

// If Args is non-nil, it gives the command-line args for the
// daemon-process. If it is nil, the result of os.Args will be used
// (without program name).

This is not strictly true. prepareEnv, in the case no Args passed, sets the Args equal to os.Arg which includes the process name. Changing this to the following would fix it.

d.Args = os.Args[1:]

I suspect this is related to #33

Thank you for the report, @timfallmk
I will fix documentation.