fix upstart detect. Add platform test.

This commit is contained in:
Daniel Theophanes
2014-10-29 09:05:24 -07:00
parent 7a0abbd49c
commit e8fe9e16c3
5 changed files with 33 additions and 1 deletions
+5 -1
View File
@@ -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 {