Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

snapd shouldn't start if API port is already in use #659

Closed
andrzej-k opened this issue Jan 8, 2016 · 1 comment
Closed

snapd shouldn't start if API port is already in use #659

andrzej-k opened this issue Jan 8, 2016 · 1 comment
Assignees

Comments

@andrzej-k
Copy link
Contributor

How to reproduce:

  1. Start snapd few times:
root@gklab-126-077:~/go/src/github.com/intelsdi-x/snap/build/bin# ./snapd -t 0 &
[1] 10097
root@gklab-126-077:~/go/src/github.com/intelsdi-x/snap/build/bin# INFO[0000] Starting snapd (version: v0.9.0-beta-128-g05a376c)
INFO[0000] setting GOMAXPROCS to: 1 core(s)
INFO[0000] control started                               _block=start _module=control
INFO[0000] module started                                _module=snapd block=main snap-module=control
INFO[0000] scheduler started                             _block=start-scheduler _module=scheduler
INFO[0000] module started                                _module=snapd block=main snap-module=scheduler
INFO[0000] setting plugin trust level to: disabled
INFO[0000] auto discover path is disabled
INFO[0000] Configuring REST API with HTTPS set to: false  _module=_mgmt-rest
INFO[0000] Starting REST API on :8181                    _module=_mgmt-rest
INFO[0000] Rest API is enabled
INFO[0000] snapd started                                 _module=snapd block=main
INFO[0000] setting log level to: warning

root@gklab-126-077:~/go/src/github.com/intelsdi-x/snap/build/bin# ./snapd -t 0 &
[2] 10104
root@gklab-126-077:~/go/src/github.com/intelsdi-x/snap/build/bin# INFO[0000] Starting snapd (version: v0.9.0-beta-128-g05a376c)
INFO[0000] setting GOMAXPROCS to: 1 core(s)
INFO[0000] control started                               _block=start _module=control
INFO[0000] module started                                _module=snapd block=main snap-module=control
INFO[0000] scheduler started                             _block=start-scheduler _module=scheduler
INFO[0000] module started                                _module=snapd block=main snap-module=scheduler
INFO[0000] setting plugin trust level to: disabled
INFO[0000] auto discover path is disabled
INFO[0000] Configuring REST API with HTTPS set to: false  _module=_mgmt-rest
INFO[0000] Starting REST API on :8181                    _module=_mgmt-rest
INFO[0000] Rest API is enabled
INFO[0000] snapd started                                 _module=snapd block=main
INFO[0000] setting log level to: warning

root@gklab-126-077:~/go/src/github.com/intelsdi-x/snap/build/bin# ./snapd -t 0 &
[3] 10110
root@gklab-126-077:~/go/src/github.com/intelsdi-x/snap/build/bin# INFO[0000] Starting snapd (version: v0.9.0-beta-128-g05a376c)
INFO[0000] setting GOMAXPROCS to: 1 core(s)
INFO[0000] control started                               _block=start _module=control
INFO[0000] module started                                _module=snapd block=main snap-module=control
INFO[0000] scheduler started                             _block=start-scheduler _module=scheduler
INFO[0000] module started                                _module=snapd block=main snap-module=scheduler
INFO[0000] setting plugin trust level to: disabled
INFO[0000] auto discover path is disabled
INFO[0000] Configuring REST API with HTTPS set to: false  _module=_mgmt-rest
INFO[0000] Starting REST API on :8181                    _module=_mgmt-rest
INFO[0000] Rest API is enabled
INFO[0000] snapd started                                 _module=snapd block=main
INFO[0000] setting log level to: warning

root@gklab-126-077:~/go/src/github.com/intelsdi-x/snap/build/bin# ./snapd -t 0 &
[4] 10116
root@gklab-126-077:~/go/src/github.com/intelsdi-x/snap/build/bin# INFO[0000] Starting snapd (version: v0.9.0-beta-128-g05a376c)
INFO[0000] setting GOMAXPROCS to: 1 core(s)
INFO[0000] control started                               _block=start _module=control
INFO[0000] module started                                _module=snapd block=main snap-module=control
INFO[0000] scheduler started                             _block=start-scheduler _module=scheduler
INFO[0000] module started                                _module=snapd block=main snap-module=scheduler
INFO[0000] setting plugin trust level to: disabled
INFO[0000] auto discover path is disabled
INFO[0000] Configuring REST API with HTTPS set to: false  _module=_mgmt-rest
INFO[0000] Starting REST API on :8181                    _module=_mgmt-rest
INFO[0000] Rest API is enabled
INFO[0000] snapd started                                 _module=snapd block=main
INFO[0000] setting log level to: warning
  1. Verify that all snap daemons are running:
root@gklab-126-077:~/go/src/github.com/intelsdi-x/snap/build/bin# ps -fae | grep snapd
root     10097  4039  0 07:15 pts/8    00:00:00 ./snapd -t 0
root     10104  4039  0 07:15 pts/8    00:00:00 ./snapd -t 0
root     10110  4039  0 07:15 pts/8    00:00:00 ./snapd -t 0
root     10116  4039  0 07:15 pts/8    00:00:00 ./snapd -t 0
  1. But only the first one is listening on 8181 - pid 10097 in this case:
root@gklab-126-077:~/go/src/github.com/intelsdi-x/snap/build/bin# netstat -tulnp | grep snapd
tcp6       0      0 :::8181                 :::*                    LISTEN      10097/snapd
root@gklab-126-077:~/go/src/github.com/intelsdi-x/snap/build/bin#
@geauxvirtual
Copy link
Contributor

This was first reported in #416 and fixed with PR #430.

PR #532 went in that changed the behavior of the REST API startup. Will investigate why the new changes are not throwing an error if the port is already in use.

@geauxvirtual geauxvirtual self-assigned this Jan 8, 2016
tiffanyfay added a commit to tiffanyfay/snap that referenced this issue Jan 30, 2016
tiffanyfay added a commit to tiffanyfay/snap that referenced this issue Jan 30, 2016
tiffanyfay added a commit to tiffanyfay/snap that referenced this issue Jan 30, 2016
tiffanyfay added a commit to tiffanyfay/snap that referenced this issue Jan 30, 2016
tiffanyfay added a commit to tiffanyfay/snap that referenced this issue Jan 30, 2016
tiffanyfay added a commit to tiffanyfay/snap that referenced this issue Feb 1, 2016
tiffanyfay added a commit that referenced this issue Feb 2, 2016
Fixes #659: snapd shouldn't start if API port is already in use
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants