Skip to content

Commit

Permalink
Merge branch 'hotfix/0.2.12'
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Dolzhikov committed Jul 18, 2015
2 parents 7b10a82 + 3ee8825 commit 86fe5d2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import (

const (

// name of the service, match with executable file name
// name of the service
name = "myservice"
description = "My Echo Service"

Expand Down
10 changes: 6 additions & 4 deletions daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// license that can be found in the LICENSE file.

/*
Package daemon 0.2.11 for use with Go (golang) services.
Package daemon 0.2.12 for use with Go (golang) services.
Package daemon provides primitives for daemonization of golang services.
This package is not provide implementation of user daemon,
Expand All @@ -28,7 +28,7 @@ Example:
const (
// name of the service, match with executable file name
// name of the service
name = "myservice"
description = "My Echo Service"
Expand Down Expand Up @@ -152,6 +152,8 @@ Go daemon
*/
package daemon

import "strings"

// Daemon interface has standard set of a methods/commands
type Daemon interface {

Expand All @@ -173,8 +175,8 @@ type Daemon interface {

// New - Create a new daemon
//
// name: name of the service, match with executable file name;
// name: name of the service
// description: any explanation, what is the service, its purpose
func New(name, description string) (Daemon, error) {
return newDaemon(name, description)
return newDaemon(strings.Join(strings.Fields(name), "_"), description)
}
2 changes: 1 addition & 1 deletion daemon_linux_systemv.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ fi
exec="{{.Path}}"
servname="{{.Description}}"
proc=$(basename $exec)
proc="{{.Name}}"
pidfile="/var/run/$proc.pid"
lockfile="/var/lock/subsys/$proc"
stdoutlog="/var/log/$proc.log"
Expand Down
2 changes: 1 addition & 1 deletion example/myservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

const (

// name of the service, match with executable file name
// name of the service
name = "myservice"
description = "My Echo Service"

Expand Down

0 comments on commit 86fe5d2

Please sign in to comment.