eliminata la gestione del PID non piu' necessaria con Docker
This commit is contained in:
parent
ae82c15f70
commit
6896b447c5
6 changed files with 13 additions and 11 deletions
|
@ -3,6 +3,6 @@ FROM scratch
|
|||
|
||||
MAINTAINER Michele Fadda "<mikif70@gmail.com>"
|
||||
|
||||
COPY lastlogin_mongodb-v4.1.1 /bin/lastlogin_mongodb
|
||||
COPY lastlogin_mongodb-v4.2.0 /bin/lastlogin_mongodb
|
||||
|
||||
ENTRYPOINT [ "/bin/lastlogin_mongodb" ]
|
|
@ -6,7 +6,7 @@ docker run \
|
|||
--name llmongo_tiscali \
|
||||
--log-opt max-size=2m \
|
||||
--log-opt max-file=5 \
|
||||
mikif70/llmongo:4.1.1 \
|
||||
mikif70/llmongo:4.2.0 \
|
||||
-l /data/llmongo.log \
|
||||
-p /data/llmongo.pid \
|
||||
-r redis-ll.mail.tiscali.sys:6379 \
|
||||
|
|
0
build.sh
Normal file → Executable file
0
build.sh
Normal file → Executable file
8
main.go
8
main.go
|
@ -12,7 +12,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
_Version = "v4.1.1"
|
||||
_Version = "v4.2.0"
|
||||
_Producer = 0
|
||||
_Consumer = 1
|
||||
_Remover = 2
|
||||
|
@ -70,9 +70,9 @@ func main() {
|
|||
|
||||
log.SetOutput(fs)
|
||||
|
||||
pid.PIDFile = opts.Pidfile
|
||||
pid.Write(true)
|
||||
defer pid.Remove()
|
||||
// pid.PIDFile = opts.Pidfile
|
||||
// pid.Write(true)
|
||||
// defer pid.Remove()
|
||||
|
||||
start := time.Now()
|
||||
fmt.Printf("Start: %+v\n", opts)
|
||||
|
|
|
@ -25,8 +25,8 @@ type Options struct {
|
|||
MaxError int
|
||||
Influxdb string
|
||||
Month string
|
||||
Pidfile string
|
||||
Queue int
|
||||
// Pidfile string
|
||||
Queue int
|
||||
}
|
||||
|
||||
var (
|
||||
|
@ -61,7 +61,7 @@ func init() {
|
|||
}
|
||||
|
||||
opts.LogFile = path.Join(opts.CurrentPath, opts.LogFile)
|
||||
opts.Pidfile = path.Join(opts.CurrentPath, "run", path.Base(os.Args[0])+".pid")
|
||||
// opts.Pidfile = path.Join(opts.CurrentPath, "run", path.Base(os.Args[0])+".pid")
|
||||
opts.Exe = path.Base(os.Args[0])
|
||||
|
||||
flag.StringVar(&opts.Influxdb, "i", "", "influxdb server")
|
||||
|
@ -76,5 +76,5 @@ func init() {
|
|||
flag.BoolVar(&opts.Test, "DD", false, "Test")
|
||||
flag.IntVar(&opts.MaxError, "E", 100, "Max Mongodb Error")
|
||||
flag.IntVar(&opts.Queue, "q", 2, "parallel consumer")
|
||||
flag.StringVar(&opts.Pidfile, "p", opts.Pidfile, "pid file")
|
||||
// flag.StringVar(&opts.Pidfile, "p", opts.Pidfile, "pid file")
|
||||
}
|
||||
|
|
2
pid.go
2
pid.go
|
@ -1,6 +1,7 @@
|
|||
// pid
|
||||
package main
|
||||
|
||||
/*
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
@ -83,3 +84,4 @@ func (p *PID) Remove() {
|
|||
fmt.Println("RM file error: ", err.Error())
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue