+1
-1
@@ -16,7 +16,7 @@ import (
|
|||||||
|
|
||||||
const maxPathSize = 32 * 1024
|
const maxPathSize = 32 * 1024
|
||||||
|
|
||||||
const version = "Darwin Launchd"
|
const version = "darwin-launchd"
|
||||||
|
|
||||||
type darwinSystem struct{}
|
type darwinSystem struct{}
|
||||||
|
|
||||||
|
|||||||
+3
-18
@@ -5,25 +5,10 @@
|
|||||||
package service
|
package service
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
type linuxSystem struct {
|
|
||||||
interactive bool
|
|
||||||
selectedName string
|
|
||||||
selectedNew func(i Interface, c *Config) (Service, error)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (ls linuxSystem) String() string {
|
|
||||||
return fmt.Sprintf("Linux %s", ls.selectedName)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (ls linuxSystem) Interactive() bool {
|
|
||||||
return ls.interactive
|
|
||||||
}
|
|
||||||
|
|
||||||
type linuxSystemService struct {
|
type linuxSystemService struct {
|
||||||
name string
|
name string
|
||||||
detect func() bool
|
detect func() bool
|
||||||
@@ -46,7 +31,7 @@ func (sc linuxSystemService) New(i Interface, c *Config) (Service, error) {
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
ChooseSystem(linuxSystemService{
|
ChooseSystem(linuxSystemService{
|
||||||
name: "systemd",
|
name: "linux-systemd",
|
||||||
detect: isSystemd,
|
detect: isSystemd,
|
||||||
interactive: func() bool {
|
interactive: func() bool {
|
||||||
is, _ := isInteractive()
|
is, _ := isInteractive()
|
||||||
@@ -55,7 +40,7 @@ func init() {
|
|||||||
new: newSystemdService,
|
new: newSystemdService,
|
||||||
},
|
},
|
||||||
linuxSystemService{
|
linuxSystemService{
|
||||||
name: "Upstart",
|
name: "linux-upstart",
|
||||||
detect: isUpstart,
|
detect: isUpstart,
|
||||||
interactive: func() bool {
|
interactive: func() bool {
|
||||||
is, _ := isInteractive()
|
is, _ := isInteractive()
|
||||||
@@ -64,7 +49,7 @@ func init() {
|
|||||||
new: newUpstartService,
|
new: newUpstartService,
|
||||||
},
|
},
|
||||||
linuxSystemService{
|
linuxSystemService{
|
||||||
name: "System-V",
|
name: "unix-systemv",
|
||||||
detect: func() bool { return true },
|
detect: func() bool { return true },
|
||||||
interactive: func() bool {
|
interactive: func() bool {
|
||||||
is, _ := isInteractive()
|
is, _ := isInteractive()
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ import (
|
|||||||
"golang.org/x/sys/windows/svc/mgr"
|
"golang.org/x/sys/windows/svc/mgr"
|
||||||
)
|
)
|
||||||
|
|
||||||
const version = "Windows Service"
|
const version = "windows-service"
|
||||||
|
|
||||||
type windowsService struct {
|
type windowsService struct {
|
||||||
i Interface
|
i Interface
|
||||||
|
|||||||
Reference in New Issue
Block a user