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
+10 -4
View File
@@ -16,14 +16,16 @@ import (
)
type sysv struct {
i Interface
i Interface
platform string
*Config
}
func newSystemVService(i Interface, c *Config) (Service, error) {
func newSystemVService(i Interface, platform string, c *Config) (Service, error) {
s := &sysv{
i: i,
Config: c,
i: i,
platform: platform,
Config: c,
}
return s, nil
@@ -36,6 +38,10 @@ func (s *sysv) String() string {
return s.Name
}
func (s *sysv) Platform() string {
return s.platform
}
var errNoUserServiceSystemV = errors.New("User services are not supported on SystemV.")
func (s *sysv) configPath() (cp string, err error) {