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
@@ -24,14 +24,16 @@ func isSystemd() bool {
}
type systemd struct {
i Interface
i Interface
platform string
*Config
}
func newSystemdService(i Interface, c *Config) (Service, error) {
func newSystemdService(i Interface, platform string, c *Config) (Service, error) {
s := &systemd{
i: i,
Config: c,
i: i,
platform: platform,
Config: c,
}
return s, nil
@@ -44,6 +46,10 @@ func (s *systemd) String() string {
return s.Name
}
func (s *systemd) Platform() string {
return s.platform
}
// Systemd services should be supported, but are not currently.
var errNoUserServiceSystemd = errors.New("User services are not supported on systemd.")