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:
committed by
Daniel Theophanes
parent
2b860c2dd7
commit
b1866cf769
@@ -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.")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user