Add ability for service to report the system managing the service (#147)

* Add ability for service to report the system managing the service

* Clarify that the output of SystemName should return the same value as Platform in most cases

* Rename SystemName to Platform to match the rest of the package

* be a little more clear in the Platform comment
This commit is contained in:
SteelPhase
2018-09-10 18:42:44 -04:00
committed by Daniel Theophanes
parent 2b860c2dd7
commit b1866cf769
7 changed files with 44 additions and 14 deletions
+2 -2
View File
@@ -13,7 +13,7 @@ type linuxSystemService struct {
name string
detect func() bool
interactive func() bool
new func(i Interface, c *Config) (Service, error)
new func(i Interface, platform string, c *Config) (Service, error)
}
func (sc linuxSystemService) String() string {
@@ -26,7 +26,7 @@ func (sc linuxSystemService) Interactive() bool {
return sc.interactive()
}
func (sc linuxSystemService) New(i Interface, c *Config) (Service, error) {
return sc.new(i, c)
return sc.new(i, sc.String(), c)
}
func init() {