mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2025-01-01 00:57:32 +01:00
Do not blindly execute /sbin/init to detect upstart
This commit is contained in:
parent
e16155e22a
commit
eca7a078dd
9
vendor/github.com/kardianos/service/service_upstart_linux.go
generated
vendored
9
vendor/github.com/kardianos/service/service_upstart_linux.go
generated
vendored
@ -8,9 +8,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"strings"
|
|
||||||
"text/template"
|
"text/template"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@ -19,13 +17,6 @@ func isUpstart() bool {
|
|||||||
if _, err := os.Stat("/sbin/upstart-udev-bridge"); err == nil {
|
if _, err := os.Stat("/sbin/upstart-udev-bridge"); err == nil {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if _, err := os.Stat("/sbin/init"); err == nil {
|
|
||||||
if out, err := exec.Command("/sbin/init", "--version").Output(); err == nil {
|
|
||||||
if strings.Contains(string(out), "init (upstart") {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user