From 6896b447c58b61ff27a01e74ecabb48711bfc3dc Mon Sep 17 00:00:00 2001 From: Michele Date: Fri, 7 Apr 2017 10:04:26 +0200 Subject: [PATCH] eliminata la gestione del PID non piu' necessaria con Docker --- Docker/Dockerfile | 4 ++-- Docker/run.sh | 2 +- build.sh | 0 main.go | 8 ++++---- options.go | 8 ++++---- pid.go | 2 ++ 6 files changed, 13 insertions(+), 11 deletions(-) mode change 100644 => 100755 build.sh diff --git a/Docker/Dockerfile b/Docker/Dockerfile index 52075ef..6750443 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -3,6 +3,6 @@ FROM scratch MAINTAINER Michele Fadda "" -COPY lastlogin_mongodb-v4.1.1 /bin/lastlogin_mongodb +COPY lastlogin_mongodb-v4.2.0 /bin/lastlogin_mongodb -ENTRYPOINT [ "/bin/lastlogin_mongodb" ] \ No newline at end of file +ENTRYPOINT [ "/bin/lastlogin_mongodb" ] diff --git a/Docker/run.sh b/Docker/run.sh index b7d37f1..9f96e6d 100644 --- a/Docker/run.sh +++ b/Docker/run.sh @@ -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 \ diff --git a/build.sh b/build.sh old mode 100644 new mode 100755 diff --git a/main.go b/main.go index e65fb9c..0aca129 100644 --- a/main.go +++ b/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) diff --git a/options.go b/options.go index c7548fb..ecb4b27 100644 --- a/options.go +++ b/options.go @@ -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") } diff --git a/pid.go b/pid.go index 5ccc2e5..da94004 100644 --- a/pid.go +++ b/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()) } } +*/