[services] Services which start containers now use 'docker wait' instead of 'docker attach' (#2661)

This commit is contained in:
Joe LeVeque 2019-03-08 10:59:41 -08:00 committed by lguohan
parent f9c9fa8ba1
commit 2bb5400948
14 changed files with 23 additions and 23 deletions

View File

@ -7,7 +7,7 @@ Before=ntp-config.service
[Service]
User={{ sonicadmin_user }}
ExecStartPre=/usr/bin/{{docker_container_name}}.sh start
ExecStart=/usr/bin/{{docker_container_name}}.sh attach
ExecStart=/usr/bin/{{docker_container_name}}.sh wait
ExecStop=/usr/bin/{{docker_container_name}}.sh stop
[Install]

View File

@ -6,7 +6,7 @@ After=docker.service
[Service]
User=root
ExecStartPre=/usr/bin/{{docker_container_name}}.sh start
ExecStart=/usr/bin/{{docker_container_name}}.sh attach
ExecStart=/usr/bin/{{docker_container_name}}.sh wait
ExecStop=/usr/bin/{{docker_container_name}}.sh stop
[Install]

View File

@ -7,7 +7,7 @@ Before=ntp-config.service
[Service]
User={{ sonicadmin_user }}
ExecStartPre=/usr/bin/{{ docker_container_name }}.sh start
ExecStart=/usr/bin/{{ docker_container_name }}.sh attach
ExecStart=/usr/bin/{{ docker_container_name }}.sh wait
ExecStop=/usr/bin/{{ docker_container_name }}.sh stop
[Install]

View File

@ -155,8 +155,8 @@ start() {
postStartAction
}
attach() {
docker attach --no-stdin {{docker_container_name}}
wait() {
docker wait {{docker_container_name}}
}
stop() {
@ -164,11 +164,11 @@ stop() {
}
case "$1" in
start|stop|attach)
start|wait|stop)
$1
;;
*)
echo "Usage: $0 {start|stop|attach}"
echo "Usage: $0 {start|wait|stop}"
exit 1
;;
esac

View File

@ -7,7 +7,7 @@ Before=ntp-config.service
[Service]
User={{ sonicadmin_user }}
ExecStartPre=/usr/bin/{{docker_container_name}}.sh start
ExecStart=/usr/bin/{{docker_container_name}}.sh attach
ExecStart=/usr/bin/{{docker_container_name}}.sh wait
ExecStop=/usr/bin/{{docker_container_name}}.sh stop
[Install]

View File

@ -7,7 +7,7 @@ Before=ntp-config.service
[Service]
User={{ sonicadmin_user }}
ExecStartPre=/usr/bin/{{docker_container_name}}.sh start
ExecStart=/usr/bin/{{docker_container_name}}.sh attach
ExecStart=/usr/bin/{{docker_container_name}}.sh wait
ExecStop=/usr/bin/{{docker_container_name}}.sh stop
[Install]

View File

@ -7,7 +7,7 @@ Before=ntp-config.service
[Service]
User={{ sonicadmin_user }}
ExecStartPre=/usr/bin/{{ docker_container_name }}.sh start
ExecStart=/usr/bin/{{ docker_container_name }}.sh attach
ExecStart=/usr/bin/{{ docker_container_name }}.sh wait
ExecStop=/usr/bin/{{ docker_container_name }}.sh stop
[Install]

View File

@ -6,5 +6,5 @@ Before=ntp-config.service
[Service]
ExecStartPre=/usr/bin/{{docker_container_name}}.sh start
ExecStart=/usr/bin/{{docker_container_name}}.sh attach
ExecStart=/usr/bin/{{docker_container_name}}.sh wait
ExecStop=/usr/bin/{{docker_container_name}}.sh stop

View File

@ -14,7 +14,7 @@ Before=ntp-config.service
User=root
Environment=sonic_asic_platform={{ sonic_asic_platform }}
ExecStartPre=/usr/local/bin/swss.sh start
ExecStart=/usr/local/bin/swss.sh attach
ExecStart=/usr/local/bin/swss.sh wait
ExecStop=/usr/local/bin/swss.sh stop
[Install]

View File

@ -20,7 +20,7 @@ Before=ntp-config.service
User=root
Environment=sonic_asic_platform={{ sonic_asic_platform }}
ExecStartPre=/usr/local/bin/syncd.sh start
ExecStart=/usr/local/bin/syncd.sh attach
ExecStart=/usr/local/bin/syncd.sh wait
ExecStop=/usr/local/bin/syncd.sh stop
[Install]

View File

@ -7,7 +7,7 @@ Before=ntp-config.service
[Service]
User={{ sonicadmin_user }}
ExecStartPre=/usr/bin/{{docker_container_name}}.sh start
ExecStart=/usr/bin/{{docker_container_name}}.sh attach
ExecStart=/usr/bin/{{docker_container_name}}.sh wait
ExecStop=/usr/bin/{{docker_container_name}}.sh stop
[Install]

View File

@ -7,7 +7,7 @@ Before=ntp-config.service
[Service]
User={{ sonicadmin_user }}
ExecStartPre=/usr/bin/{{docker_container_name}}.sh start
ExecStart=/usr/bin/{{docker_container_name}}.sh attach
ExecStart=/usr/bin/{{docker_container_name}}.sh wait
ExecStop=/usr/bin/{{docker_container_name}}.sh stop
[Install]

View File

@ -115,9 +115,9 @@ start() {
unlock_service_state_change
}
attach() {
wait() {
startPeerService
/usr/bin/${SERVICE}.sh attach
/usr/bin/${SERVICE}.sh wait
}
stop() {
@ -142,11 +142,11 @@ stop() {
}
case "$1" in
start|attach|stop)
start|wait|stop)
$1
;;
*)
echo "Usage: $0 {start|attach|stop}"
echo "Usage: $0 {start|wait|stop}"
exit 1
;;
esac

View File

@ -135,8 +135,8 @@ start() {
unlock_service_state_change
}
attach() {
/usr/bin/${SERVICE}.sh attach
wait() {
/usr/bin/${SERVICE}.sh wait
}
stop() {
@ -184,11 +184,11 @@ stop() {
}
case "$1" in
start|attach|stop)
start|wait|stop)
$1
;;
*)
echo "Usage: $0 {start|attach|stop}"
echo "Usage: $0 {start|wait|stop}"
exit 1
;;
esac