Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed run sample on Mac Darwin (Kernel Version 16.X) #22

Open
vus520 opened this issue May 22, 2017 · 9 comments
Open

Failed run sample on Mac Darwin (Kernel Version 16.X) #22

vus520 opened this issue May 22, 2017 · 9 comments

Comments

@vus520
Copy link

vus520 commented May 22, 2017

ALL PRETTY GOOD on linux.

$ uname -a
Darwin shuhaideMacBook-Pro.local 16.5.0 Darwin Kernel Version 16.5.0: Fri Mar  3 16:52:33 PST 2017; root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64

$ git log -n 1
commit 1ae26ef5036ad04968706917222a23c535673d8c
Author: Sergey Yarmonov <[email protected]>
Date:   Thu May 18 18:12:20 2017 +0700

    Update README

$ go build

$ ./sample -s
[1]    57268 killed     ./sample -s

$ ./sample
[1]    57278 killed     ./sample

$ ./sample -s stop
[1]    57288 killed     ./sample -s stop

$ ./sample -s reload
[1]    57299 killed     ./sample -s reload
@sevlyar
Copy link
Owner

sevlyar commented May 23, 2017

I don't understand you, please explain how you tested the sample?

I tested the same commit and i think all works proper:

➜  go-daemon git:(master) ✗ uname -a
Darwin Morpheus 15.6.0 Darwin Kernel Version 15.6.0: Fri Feb 17 10:21:18 PST 2017; root:xnu-3248.60.11.4.1~1/RELEASE_X86_64 x86_64
➜  go-daemon git:(master) ✗ cd sample 
➜  sample git:(master) ✗ go build
➜  sample git:(master) ✗ ./sample -s stop
2017/05/23 10:03:34 Unable send signal to the daemon: open pid: no such file or directory
➜  sample git:(master) ✗ ./sample        
➜  sample git:(master) ✗ ls
log       pid       sample    sample.go
➜  sample git:(master) ✗ tail -f log &
[1] 30424
2017/05/23 10:03:38 - - - - - - - - - - - - - - -                                                                                                                                                                                   
2017/05/23 10:03:38 daemon started
➜  sample git:(master) ✗ ./sample -s reload
2017/05/23 10:04:08 configuration reloaded
➜  sample git:(master) ✗ ./sample -s stop
2017/05/23 10:04:33 terminating...
2017/05/23 10:04:33 daemon terminated
➜  sample git:(master) ✗ ls
log       sample    sample.go
➜  sample git:(master) ✗ fg
[1]  + 30424 running    tail -f log

Remarks:

  • ./sample -s ... command prints a message only if an error happens, it produces no output in a different case;
  • tail -f log command pipes the daemon's log to the console in my tests.

@vus520
Copy link
Author

vus520 commented May 23, 2017

My os version "Darwin Kernel Version 16.5.0"

run ./sample on Darwin after go build, Nothing generated, No PID file NO log file. output is '[1] 57268 killed'

@sevlyar
Copy link
Owner

sevlyar commented Jun 4, 2017

It looks really strange. @vus520 could you give me output of go version && go env command? Thank you.

@vus520
Copy link
Author

vus520 commented Jun 5, 2017

@sevlyar

$ go version && go env
go version go1.7.4 darwin/amd64
GOARCH="amd64"
GOBIN="/wwwroot/gopath//pkg"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/wwwroot/gopath/"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.7.4/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.7.4/libexec/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/fm/29zg12712ql3y0l0j3t9_mkw0000gn/T/go-build853998416=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"

@sevlyar sevlyar changed the title Failed run sample on Mac Darwin Failed run sample on Mac Darwin (Kernel Version 16.X) Jun 26, 2017
@sevlyar
Copy link
Owner

sevlyar commented Jun 27, 2017

I updated my OSX Kernel Version up to 16.6.0 and can not reproduce this behavior.

@timfallmk
Copy link

timfallmk commented Jan 25, 2018

@sevlyar I get this as well.

Darwin Tims-MacBook-Pro-15.local 17.4.0 Darwin Kernel Version 17.4.0: Sun Dec 17 09:19:54 PST 2017; root:xnu-4570.41.2~1/RELEASE_X86_64 x86_64
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/timfall/Code/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/rs/97ytdh4946n_7g59d2x8jh2h0000gn/T/go-build272996179=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
go version go1.9.2 darwin/amd64

A pid and log file are written, but the pid file is blank.

@timfallmk
Copy link

timfallmk commented Jan 25, 2018

Nevermind, I figured it out.

@ademenev
Copy link

Nevermind, I figured it out.

How did you solve the issue?

@timfallmk
Copy link

@ademenev its been a long time since I commented so I don’t remember the problem or context, but I switched to using a fork that fixes macOS issues https://github.com/timfallmk/go-daemon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants