fix upstart detect. Add platform test.
This commit is contained in:
+5
-1
@@ -45,7 +45,7 @@ func newService(c *Config) (Service, error) {
|
||||
}
|
||||
|
||||
func isUpstart() bool {
|
||||
if _, err := os.Stat("/sbin/initctl"); err == nil {
|
||||
if _, err := os.Stat("/sbin/upstart-udev-bridge"); err == nil {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
@@ -64,6 +64,10 @@ type linuxService struct {
|
||||
logger *syslog.Writer
|
||||
}
|
||||
|
||||
func (ls *linuxService) String() string {
|
||||
return fmt.Sprintf("Linux %s", ls.flavor.String())
|
||||
}
|
||||
|
||||
type initFlavor uint8
|
||||
|
||||
func (f initFlavor) String() string {
|
||||
|
||||
Reference in New Issue
Block a user