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

[dockers]: "docker stop" command fails on dockers with shell entrypoints #435

Closed
jleveque opened this issue Mar 24, 2017 · 4 comments
Closed

Comments

@jleveque
Copy link
Contributor

jleveque commented Mar 24, 2017

docker stop sends a signal to the process with PID of 1 inside the docker. However, if the docker has an entrypoint of /bin/bash running one or more commands, /bin/bash becomes PID 1 and the signal will be received by /bin/bash but it will not be forwarded along to processes running in the shell. This causes docker stop to timeout instead of shutting the docker down properly.

@jleveque jleveque self-assigned this Mar 24, 2017
@jleveque
Copy link
Contributor Author

jleveque commented Mar 27, 2017

Fix for docker-database here: #442

For many of the remaining dockers, a problem rears its head: multiple processes need to be started. While we can start multiple processes in a docker using supervisord, some dockers require processes to start in a specific order, however, supervisord, while providing a priority mechanism, does not provide a dependency system, so there is no native way to ensure processes start serially. Many people are clamoring for this functionality to be added here: Supervisor/supervisor#122.

In the comments of the issue I linked, one person describes their workaround:

A workaround that I have used is to set autostart=false on the processes, then create a bootstrap script with autostart=true and autorestart=false (a one-shot). The bootstrap can be a shell script that calls supervisorctl start for each process. supervisorctl start will block until a process has started successfully.

While this will work, I don't believe this is an ideal solution. Also, it appears someone has created an alternative "ordered-startup-supervisord" here: https://pypi.python.org/pypi/ordered-startup-supervisord/. I'm not sure how stable this is, however. All thoughts are welcome!

@lguohan
Copy link
Collaborator

lguohan commented Apr 6, 2017

do you have a list of dockers that is not currently managed by supervisor?

@jleveque
Copy link
Contributor Author

jleveque commented Apr 6, 2017

  • docker-basic_router
  • docker-dhcp-relay
  • docker-fpm
  • docker-fpm-gobgp (Uses supervisord, but it is not started as PID 1)
  • docker-lldp-sv2 (Uses supervisord, but it is not started as PID 1)
  • docker-mlnx-sswsyncd
  • docker-mlnx-sswsyncd-rpc
  • docker-orchagent
  • docker-orchagent-cavm
  • docker-orchagent-centec
  • docker-orchagent-mlnx
  • docker-platform-monitor
  • docker-saiserver-brcm
  • docker-saiserver-cavm
  • docker-saiserver-mlnx
  • docker-snmp-sv2 (Uses supervisord, but it is not started as PID 1)
  • docker-sswsyncd
  • docker-teamd
  • docker-vas

jleveque added a commit that referenced this issue May 8, 2017
 - Consolidate config.sh and start.sh scripts into one script (start.sh)
 - Solve issue #435 - All dockers now run supervisord as their ENTRYPOINT
 - All stdout/stderr output from processes managed by supervisord is now sent to syslog instead of their own files
 - Supervisord log messages are now also sent to syslog
 - Removed unused smartmontools package from docker-platform-monitor
@jleveque
Copy link
Contributor Author

jleveque commented May 8, 2017

Resolved with PR #573

@jleveque jleveque closed this as completed May 8, 2017
lguohan pushed a commit that referenced this issue Apr 12, 2019
…2755)

sonic-sairedis:
e8cb879 Make object list deterministic when iterating (#438)
5486f97 Ignore ACL_COUNTER bytes and packets during comparison logic (#443)
b138ff9 Notify OA about exception and process only restart query events (#437)
0974a43 Set MTU value on created tap device for virtual switch (#436)
e2f50e8 Increase eth buffer size to 16k for virtual switch (#435)
79fb388 [bfn] Ged rid of ld_preload. Link against libsai only (#429)
2e47b78 Remove MAC alignment WA for Mellanox platforms. (#430)
e1354fe Add pre match to comparison logic and unittests (#423)
18a5ebb Drop FDB notifications if they contain invalid OIDs (#428)

sonic-swss-common:
8af58ad sonic-swss-common: Add vxlan macros to schema (#269)
76837bf Make class Select support batch read from selectables (#270)
4cf643e Add multiple fields hdel support (#267)
a710529 Update PFC_WD table name in CONFIG_DB (#266)
3c452c1 Update README.md (#268)

sonic-swss:
e329dbd Survive pfc watchdog storm action across warm-reboot (#794)

sonic-utilities:
6ee0aea (HEAD, origin/master, origin/HEAD) [config]: Change the order of interface commands (#504)
5ae30d2 [show vlan brief] Support 'alias' interface naming mode (#497)
bafebf9 Update neighbor advertiser (#498)
fa90083 [clear/main.py]: clear ndp command. (#450)
65f69e4 [show interface neighbor expected] Support 'alias' interface naming mode (#495)
aae39e7 updated show ipv6 interface for alias mode (#493)
170fed9 [warm-reboot] initialize warm reboot state table before warm rebooting (#492)
06cd99f Allow config shutdown and startup operations on valid PortChannel interface names (#474)
98cdebb [show ip interface] Add support for 'alias' interface naming mode (#486)
5f1de81 [show] Add serial numbers/uptime/hwinfo to 'show version' output (#488)
e78a866 [route_check] Move scripts under scripts/ directory, add to setup.py (#489)
d347527 Change PFC watchdog CONFIG_DB table name from PFC_WD_TABLE to PFC_WD (#475)

Signed-off-by: Wenda Ni <wenni@microsoft.com>
madhanmellanox pushed a commit to madhanmellanox/sonic-buildimage that referenced this issue Mar 23, 2020
* [PfcWd]: Make polling interval configurable

Signed-off-by: Sihui Han <sihan@microsoft.com>

* rebase master

* fix the build error

Signed-off-by: Sihui Han <sihan@microsoft.com>
dmytroxshevchuk pushed a commit to dmytroxshevchuk/sonic-buildimage that referenced this issue Aug 31, 2020
qiluo-msft added a commit to qiluo-msft/sonic-buildimage that referenced this issue Jan 7, 2021
Includes sonic-swss-common commits:
```
71dc350 2021-01-07 | Lower the log level for outdated key for SubscriberStateTable notification (sonic-net#441) [Qi Luo]
7e40582 2021-01-08 | Add boost dependencies (sonic-net#442) [Ze Gan]
30a8ddf 2021-01-05 | Change DBConnector::hgetall return type from map to unordered_map (sonic-net#440) [Qi Luo]
021108d 2021-01-02 | MCLAG Enhancements per HLD sonic-net/SONiC#596 (sonic-net#405) [Praveen-Brcm]
54996fc 2021-01-02 | Implement ConfigDBConnector and ConfigDBPipeConnector in C++ (sonic-net#437) [Qi Luo]
8286525 2020-12-27 | Simply refactor DBConnector hgetall() [Qi Luo]
6d1d33b 2020-12-27 | Fix RedisTransactioner: handle empty deque [Qi Luo]
624e0b8 2020-12-26 | Move complex class constructor as explicit, and fix several mistaken copy constructor usage [Qi Luo]
3b983f9 2020-12-30 | [ci]: add timeout to 180 minutes for arm build (sonic-net#439) [lguohan]
f2e4210 2020-12-29 | Add utility for string and redis (sonic-net#434) [Ze Gan]
7a885fd 2020-12-29 | [build]: add build check for arm64 and armhf (sonic-net#436) [lguohan]
47bccc4 2020-12-24 | Add missed vector header to rediscommand.h (sonic-net#435) [Ze Gan]
```
qiluo-msft added a commit that referenced this issue Jan 8, 2021
Includes sonic-swss-common commits:
```
71dc350 2021-01-07 | Lower the log level for outdated key for SubscriberStateTable notification (#441) [Qi Luo]
7e40582 2021-01-08 | Add boost dependencies (#442) [Ze Gan]
30a8ddf 2021-01-05 | Change DBConnector::hgetall return type from map to unordered_map (#440) [Qi Luo]
021108d 2021-01-02 | MCLAG Enhancements per HLD sonic-net/SONiC#596 (#405) [Praveen-Brcm]
54996fc 2021-01-02 | Implement ConfigDBConnector and ConfigDBPipeConnector in C++ (#437) [Qi Luo]
8286525 2020-12-27 | Simply refactor DBConnector hgetall() [Qi Luo]
6d1d33b 2020-12-27 | Fix RedisTransactioner: handle empty deque [Qi Luo]
624e0b8 2020-12-26 | Move complex class constructor as explicit, and fix several mistaken copy constructor usage [Qi Luo]
3b983f9 2020-12-30 | [ci]: add timeout to 180 minutes for arm build (#439) [lguohan]
f2e4210 2020-12-29 | Add utility for string and redis (#434) [Ze Gan]
7a885fd 2020-12-29 | [build]: add build check for arm64 and armhf (#436) [lguohan]
47bccc4 2020-12-24 | Add missed vector header to rediscommand.h (#435) [Ze Gan]
```
lguohan pushed a commit that referenced this issue Jan 9, 2021
Includes sonic-swss-common commits:
```
71dc350 2021-01-07 | Lower the log level for outdated key for SubscriberStateTable notification (#441) [Qi Luo]
7e40582 2021-01-08 | Add boost dependencies (#442) [Ze Gan]
30a8ddf 2021-01-05 | Change DBConnector::hgetall return type from map to unordered_map (#440) [Qi Luo]
021108d 2021-01-02 | MCLAG Enhancements per HLD sonic-net/SONiC#596 (#405) [Praveen-Brcm]
54996fc 2021-01-02 | Implement ConfigDBConnector and ConfigDBPipeConnector in C++ (#437) [Qi Luo]
8286525 2020-12-27 | Simply refactor DBConnector hgetall() [Qi Luo]
6d1d33b 2020-12-27 | Fix RedisTransactioner: handle empty deque [Qi Luo]
624e0b8 2020-12-26 | Move complex class constructor as explicit, and fix several mistaken copy constructor usage [Qi Luo]
3b983f9 2020-12-30 | [ci]: add timeout to 180 minutes for arm build (#439) [lguohan]
f2e4210 2020-12-29 | Add utility for string and redis (#434) [Ze Gan]
7a885fd 2020-12-29 | [build]: add build check for arm64 and armhf (#436) [lguohan]
47bccc4 2020-12-24 | Add missed vector header to rediscommand.h (#435) [Ze Gan]
```
mssonicbld added a commit that referenced this issue Feb 18, 2024
…D automatically (#18127)

#### Why I did it
src/sonic-platform-daemons
```
* 7792838 - (HEAD -> 202311, origin/202311) Move firmware version fields to TRANSCEIVER_FIRMWARE_INFO table (#435) (22 hours ago) [mihirpat1]
```
#### How I did it
#### How to verify it
#### Description for the changelog
mssonicbld added a commit that referenced this issue Feb 19, 2024
…D automatically (#18125)

#### Why I did it
src/sonic-platform-daemons
```
* f1511c2 - (HEAD -> master, origin/master, origin/HEAD) Move firmware version fields to TRANSCEIVER_FIRMWARE_INFO table (#435) (2 days ago) [mihirpat1]
```
#### How I did it
#### How to verify it
#### Description for the changelog
sonic-otn pushed a commit to Weitang-Zheng/sonic-buildimage that referenced this issue Mar 11, 2024
…D automatically (sonic-net#18125)

#### Why I did it
src/sonic-platform-daemons
```
* f1511c2 - (HEAD -> master, origin/master, origin/HEAD) Move firmware version fields to TRANSCEIVER_FIRMWARE_INFO table (sonic-net#435) (2 days ago) [mihirpat1]
```
#### How I did it
#### How to verify it
#### Description for the changelog
saksarav-nokia pushed a commit to saksarav-nokia/sonic-buildimage that referenced this issue Mar 12, 2024
…D automatically (sonic-net#18125)

#### Why I did it
src/sonic-platform-daemons
```
* f1511c2 - (HEAD -> master, origin/master, origin/HEAD) Move firmware version fields to TRANSCEIVER_FIRMWARE_INFO table (sonic-net#435) (2 days ago) [mihirpat1]
```
#### How I did it
#### How to verify it
#### Description for the changelog
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

2 participants