0 socket while using go-systemd for socket activation

blov · · 61 次点击    
<p>Hello, I&#39;ve been trying to incorporate this <a href="https://github.com/coreos/go-systemd/blob/master/examples/activation/httpserver/httpserver.go" rel="nofollow">bit</a> of code into my web service to be able upgrade my software without any downtime.</p> <p>However, it seems that there&#39;s 0 socket and the program will just fail. You can find my specific code <a href="https://github.com/GwentAPI/gwentapi/tree/master/serverService" rel="nofollow">here</a>. If you want to try it out feel free to grab the alpha2 release for linux but you will need to have mongodb running.</p> <p>I don&#39;t really understand what&#39;s going on, I successfully took a snapshot of my dev machine and created a new one and it started to work there but as soon as I deleted it and compiled the same version on the other machine it continued complaining that it have 0 socket.</p> <p>I know that this isn&#39;t strictly speaking 100% golang related but this is the sub where I&#39;m most likely to find someone who use go-systemd and know about systemd. Thank you for your help.</p> <hr/>**评论:**<br/><br/>gwentAPI: <pre><p>The go-systemd activation package doesn&#39;t really have good error reporting. This lines is executed: <a href="https://github.com/coreos/go-systemd/blob/master/activation/files.go#L37" rel="nofollow">https://github.com/coreos/go-systemd/blob/master/activation/files.go#L37</a> which down the line will give me an empty array of net.Listener here: <a href="https://github.com/coreos/go-systemd/blob/master/activation/listeners.go#L30" rel="nofollow">https://github.com/coreos/go-systemd/blob/master/activation/listeners.go#L30</a></p> <p>I still have no clue why it&#39;s happening.</p> <p><strong>edit</strong>: strconv.Atoi: parsing &#34;&#34;: invalid syntax. Seems like LISTEN_PID isn&#39;t being set. Not sure why or how to fix.</p></pre>
61 次点击  
加入收藏 微博
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传