Add dependencies for Windows Services
This commit is contained in:
+6
-5
@@ -18,7 +18,7 @@
|
|||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/kardianos/service"
|
"github.com/nollan/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
var logger service.Logger
|
var logger service.Logger
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
package service // import "github.com/kardianos/service"
|
package service // import "github.com/nollan/service"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
@@ -69,9 +69,10 @@ import (
|
|||||||
|
|
||||||
// Config provides the setup for a Service. The Name field is required.
|
// Config provides the setup for a Service. The Name field is required.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
Name string // Required name of the service. No spaces suggested.
|
Name string // Required name of the service. No spaces suggested.
|
||||||
DisplayName string // Display name, spaces allowed.
|
DisplayName string // Display name, spaces allowed.
|
||||||
Description string // Long description of service.
|
Description string // Long description of service.
|
||||||
|
Dependencies []string // Array of service dependencies.
|
||||||
|
|
||||||
UserName string // Run as username.
|
UserName string // Run as username.
|
||||||
Arguments []string // Run with arguments.
|
Arguments []string // Run with arguments.
|
||||||
|
|||||||
@@ -195,6 +195,7 @@ func (ws *windowsService) Install() error {
|
|||||||
StartType: mgr.StartAutomatic,
|
StartType: mgr.StartAutomatic,
|
||||||
ServiceStartName: ws.UserName,
|
ServiceStartName: ws.UserName,
|
||||||
Password: ws.Option.string("Password", ""),
|
Password: ws.Option.string("Password", ""),
|
||||||
|
Dependencies: ws.Dependencies,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user