diff --git a/README.md b/README.md index d9f45b7..74fdef6 100644 --- a/README.md +++ b/README.md @@ -187,6 +187,7 @@ func main() { - [Eric Halpern](https://github.com/ehalpern) - [Yota](https://github.com/nus) - [Erkan Durmus](https://github.com/derkan) +- [maxxant](https://github.com/maxxant) All the contributors are welcome. If you would like to be the contributor please accept some rules. - The pull requests will be accepted only in "develop" branch diff --git a/daemon.go b/daemon.go index 51e8994..961133e 100644 --- a/daemon.go +++ b/daemon.go @@ -3,7 +3,7 @@ // license that can be found in the LICENSE file. /* -Package daemon 0.8.0 for use with Go (golang) services. +Package daemon 0.8.1 for use with Go (golang) services. Package daemon provides primitives for daemonization of golang services. This package is not provide implementation of user daemon, diff --git a/daemon_linux.go b/daemon_linux.go index 03a1e5c..633f20c 100644 --- a/daemon_linux.go +++ b/daemon_linux.go @@ -11,12 +11,13 @@ import ( // Get the daemon properly func newDaemon(name, description string, dependencies []string) (Daemon, error) { - if _, err := os.Stat("/sbin/initctl"); err == nil { - return &upstartRecord{name, description, dependencies}, nil - } + // newer subsystem must be checked first if _, err := os.Stat("/run/systemd/system"); err == nil { return &systemDRecord{name, description, dependencies}, nil } + if _, err := os.Stat("/sbin/initctl"); err == nil { + return &upstartRecord{name, description, dependencies}, nil + } return &systemVRecord{name, description, dependencies}, nil }