From 814fd87e63c60dd306696a5cb4ec7610b7dcab2d Mon Sep 17 00:00:00 2001 From: pavel-shirshov Date: Wed, 29 Mar 2017 18:07:25 -0700 Subject: [PATCH] Remove /var/run/rsyslogd.pid bofore starting rsyslog (#453) --- dockers/docker-basic_router/Dockerfile | 3 ++- dockers/docker-dhcp-relay/Dockerfile | 1 - dockers/docker-dhcp-relay/start.sh | 3 +++ dockers/docker-fpm-gobgp/start.sh | 1 + dockers/docker-fpm/start.sh | 1 + dockers/docker-lldp-sv2/config.sh | 1 + dockers/docker-orchagent/start.sh | 1 + dockers/docker-platform-monitor/config.sh | 1 + dockers/docker-saiserver-brcm/start.sh | 1 + dockers/docker-saiserver-cavm/start.sh | 1 + dockers/docker-saiserver-mlnx/start.sh | 1 + dockers/docker-snmp-sv2/config.sh | 1 + dockers/docker-teamd/start.sh | 1 + dockers/docker-vas/Dockerfile | 3 ++- platform/broadcom/docker-syncd-brcm/start.sh | 1 + platform/cavium/docker-syncd-cavm/start.sh | 1 + platform/centec/docker-syncd-centec/start.sh | 1 + platform/p4/docker-sonic-p4/startup.sh | 1 + 18 files changed, 21 insertions(+), 3 deletions(-) diff --git a/dockers/docker-basic_router/Dockerfile b/dockers/docker-basic_router/Dockerfile index 8bf1875ab9..7176fac14b 100644 --- a/dockers/docker-basic_router/Dockerfile +++ b/dockers/docker-basic_router/Dockerfile @@ -17,5 +17,6 @@ RUN dpkg -i /deps/libopennsl_*.deb; \ RUN mv /deps/basic_router /usr/sbin/basic_router -ENTRYPOINT service rsyslog start \ +ENTRYPOINT rm -f /var/run/rsyslogd.pid \ + && service rsyslog start \ && /bin/bash diff --git a/dockers/docker-dhcp-relay/Dockerfile b/dockers/docker-dhcp-relay/Dockerfile index 5c9ee3fb64..315ea605f3 100644 --- a/dockers/docker-dhcp-relay/Dockerfile +++ b/dockers/docker-dhcp-relay/Dockerfile @@ -18,6 +18,5 @@ COPY ["config.sh", "/usr/bin/"] COPY ["start.sh", "/usr/bin/"] ENTRYPOINT /usr/bin/config.sh \ - && service rsyslog start \ && /usr/bin/start.sh \ && /bin/bash diff --git a/dockers/docker-dhcp-relay/start.sh b/dockers/docker-dhcp-relay/start.sh index 05a7693268..ff8a629d98 100755 --- a/dockers/docker-dhcp-relay/start.sh +++ b/dockers/docker-dhcp-relay/start.sh @@ -1,5 +1,8 @@ #!/bin/bash +rm -f /var/run/rsyslogd.pid +service rsyslog start + VLAN_IFACE_NAME=`sonic-cfggen -m /etc/sonic/minigraph.xml -v "minigraph_vlan_interfaces[0]['name']"` # Wait for the VLAN to come up (i.e., 'ip link show' returns 0) diff --git a/dockers/docker-fpm-gobgp/start.sh b/dockers/docker-fpm-gobgp/start.sh index 90a1d515fa..0aa3f68091 100755 --- a/dockers/docker-fpm-gobgp/start.sh +++ b/dockers/docker-fpm-gobgp/start.sh @@ -1,5 +1,6 @@ #!/bin/bash +rm -f /var/run/rsyslogd.pid service rsyslog start service quagga start fpmsyncd & diff --git a/dockers/docker-fpm/start.sh b/dockers/docker-fpm/start.sh index 90a1d515fa..0aa3f68091 100755 --- a/dockers/docker-fpm/start.sh +++ b/dockers/docker-fpm/start.sh @@ -1,5 +1,6 @@ #!/bin/bash +rm -f /var/run/rsyslogd.pid service rsyslog start service quagga start fpmsyncd & diff --git a/dockers/docker-lldp-sv2/config.sh b/dockers/docker-lldp-sv2/config.sh index 842a10306c..1263cb7a51 100755 --- a/dockers/docker-lldp-sv2/config.sh +++ b/dockers/docker-lldp-sv2/config.sh @@ -5,3 +5,4 @@ sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/lldpd.con mkdir -p /var/sonic echo "# Config files managed by sonic-config-engine" >/var/sonic/config_status +rm -f /var/run/rsyslogd.pid diff --git a/dockers/docker-orchagent/start.sh b/dockers/docker-orchagent/start.sh index d73416ac9b..088d0fe1bc 100755 --- a/dockers/docker-orchagent/start.sh +++ b/dockers/docker-orchagent/start.sh @@ -65,6 +65,7 @@ elif [ "$HWSKU" == "ACS-MSN2700" ]; then SWSSCONFIG_ARGS+="msn2700.32ports.buffers.json msn2700.32ports.qos.json " fi +rm -f /var/run/rsyslogd.pid service rsyslog start while true; do diff --git a/dockers/docker-platform-monitor/config.sh b/dockers/docker-platform-monitor/config.sh index 7021f18aac..a88bdf594f 100755 --- a/dockers/docker-platform-monitor/config.sh +++ b/dockers/docker-platform-monitor/config.sh @@ -9,3 +9,4 @@ fi mkdir -p /var/sonic echo "# Config files managed by sonic-config-engine" >/var/sonic/config_status +rm -f /var/run/rsyslogd.pid diff --git a/dockers/docker-saiserver-brcm/start.sh b/dockers/docker-saiserver-brcm/start.sh index 07d03b41a9..1d65e4a069 100755 --- a/dockers/docker-saiserver-brcm/start.sh +++ b/dockers/docker-saiserver-brcm/start.sh @@ -13,6 +13,7 @@ start_bcm() trap clean_up SIGTERM SIGKILL +rm -f /var/run/rsyslogd.pid service rsyslog start start_bcm diff --git a/dockers/docker-saiserver-cavm/start.sh b/dockers/docker-saiserver-cavm/start.sh index 8d683c0a01..5c31856131 100755 --- a/dockers/docker-saiserver-cavm/start.sh +++ b/dockers/docker-saiserver-cavm/start.sh @@ -6,6 +6,7 @@ function clean_up { trap clean_up SIGTERM SIGKILL +rm -f /var/run/rsyslogd.pid service rsyslog start /usr/bin/saiserver -p /etc/sai/profile.ini -f /etc/sai/portmap.ini diff --git a/dockers/docker-saiserver-mlnx/start.sh b/dockers/docker-saiserver-mlnx/start.sh index 4e1aa752d3..e3356be120 100755 --- a/dockers/docker-saiserver-mlnx/start.sh +++ b/dockers/docker-saiserver-mlnx/start.sh @@ -11,6 +11,7 @@ start_mlnx() trap clean_up SIGTERM SIGKILL +rm -f /var/run/rsyslogd.pid service rsyslog start start_mlnx diff --git a/dockers/docker-snmp-sv2/config.sh b/dockers/docker-snmp-sv2/config.sh index b6216e8353..16b4507b09 100755 --- a/dockers/docker-snmp-sv2/config.sh +++ b/dockers/docker-snmp-sv2/config.sh @@ -13,3 +13,4 @@ sonic-cfggen -m /etc/sonic/minigraph.xml -s >/etc/snmp/alias_map.json mkdir -p /var/sonic echo "# Config files managed by sonic-config-engine" >/var/sonic/config_status +rm -f /var/run/rsyslogd.pid diff --git a/dockers/docker-teamd/start.sh b/dockers/docker-teamd/start.sh index 6ea5eb01b3..5397475def 100755 --- a/dockers/docker-teamd/start.sh +++ b/dockers/docker-teamd/start.sh @@ -28,6 +28,7 @@ function clean_up { trap clean_up SIGTERM SIGKILL +rm -f /var/run/rsyslogd.pid service rsyslog start # Before teamd could automatically add newly created host interfaces into the diff --git a/dockers/docker-vas/Dockerfile b/dockers/docker-vas/Dockerfile index fb207d0719..245bbd6bae 100755 --- a/dockers/docker-vas/Dockerfile +++ b/dockers/docker-vas/Dockerfile @@ -30,7 +30,8 @@ VOLUME /var/opt/quest/vas/vasd/ VOLUME /home/ ## Delete the symlinks and create full copies to host folder -ENTRYPOINT service rsyslog start \ +ENTRYPOINT rm -f /var/run/rsyslogd.pid \ + && service rsyslog start \ && cp --remove-destination /opt/quest/lib64/nss/libnss_vas4.so.2 \ /host/lib/x86_64-linux-gnu/ \ && cp --remove-destination /opt/quest/lib64/security/pam_vas3.so \ diff --git a/platform/broadcom/docker-syncd-brcm/start.sh b/platform/broadcom/docker-syncd-brcm/start.sh index 3e5b941a76..6a08b71514 100755 --- a/platform/broadcom/docker-syncd-brcm/start.sh +++ b/platform/broadcom/docker-syncd-brcm/start.sh @@ -8,6 +8,7 @@ function clean_up { trap clean_up SIGTERM SIGKILL +rm -f /var/run/rsyslogd.pid service rsyslog start service syncd start diff --git a/platform/cavium/docker-syncd-cavm/start.sh b/platform/cavium/docker-syncd-cavm/start.sh index 21d61e7073..b6c77ff235 100755 --- a/platform/cavium/docker-syncd-cavm/start.sh +++ b/platform/cavium/docker-syncd-cavm/start.sh @@ -2,6 +2,7 @@ export XP_ROOT=/usr/bin/ +rm -f /var/run/rsyslogd.pid service rsyslog start while true; do diff --git a/platform/centec/docker-syncd-centec/start.sh b/platform/centec/docker-syncd-centec/start.sh index 3e5b941a76..6a08b71514 100755 --- a/platform/centec/docker-syncd-centec/start.sh +++ b/platform/centec/docker-syncd-centec/start.sh @@ -8,6 +8,7 @@ function clean_up { trap clean_up SIGTERM SIGKILL +rm -f /var/run/rsyslogd.pid service rsyslog start service syncd start diff --git a/platform/p4/docker-sonic-p4/startup.sh b/platform/p4/docker-sonic-p4/startup.sh index e5221f8342..18cd471658 100755 --- a/platform/p4/docker-sonic-p4/startup.sh +++ b/platform/p4/docker-sonic-p4/startup.sh @@ -4,6 +4,7 @@ echo "Set onie_platform to x86_64-barefoot_p4-r0" export onie_platform=x86_64-barefoot_p4-r0 echo "Start rsyslog" +rm -f /var/run/rsyslogd.pid service rsyslog start echo "Start redis server"