From ed665884733fd72146c4d1ab35cc221d3c085e26 Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Mon, 21 Aug 2017 13:55:59 -0700 Subject: [PATCH] [docker-fpm-quagga]: Manage Quagga processes (zebra, bgpd) using supervisor instead of watchquagga (#900) --- dockers/docker-fpm-quagga/Dockerfile.j2 | 4 +-- dockers/docker-fpm-quagga/daemons | 31 ---------------------- dockers/docker-fpm-quagga/start.sh | 5 ++-- dockers/docker-fpm-quagga/supervisord.conf | 27 ++++++++++++++----- 4 files changed, 25 insertions(+), 42 deletions(-) delete mode 100644 dockers/docker-fpm-quagga/daemons diff --git a/dockers/docker-fpm-quagga/Dockerfile.j2 b/dockers/docker-fpm-quagga/Dockerfile.j2 index 1f71c7130b8d..c10cf0fd71d9 100644 --- a/dockers/docker-fpm-quagga/Dockerfile.j2 +++ b/dockers/docker-fpm-quagga/Dockerfile.j2 @@ -22,10 +22,8 @@ debs/{{ deb }}{{' '}} RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y RUN rm -rf /debs -COPY ["start.sh", "/usr/bin/"] -COPY ["bgpcfgd", "/usr/bin/"] +COPY ["bgpcfgd", "start.sh", "/usr/bin/"] COPY ["supervisord.conf", "/etc/supervisor/conf.d/"] COPY ["*.j2", "/usr/share/sonic/templates/"] -COPY ["daemons", "/etc/quagga/"] ENTRYPOINT ["/usr/bin/supervisord"] diff --git a/dockers/docker-fpm-quagga/daemons b/dockers/docker-fpm-quagga/daemons deleted file mode 100644 index cb7c2322c9fb..000000000000 --- a/dockers/docker-fpm-quagga/daemons +++ /dev/null @@ -1,31 +0,0 @@ -# This file tells the quagga package which daemons to start. -# -# Entries are in the format: =(yes|no|priority) -# 0, "no" = disabled -# 1, "yes" = highest priority -# 2 .. 10 = lower priorities -# Read /usr/share/doc/quagga/README.Debian for details. -# -# Sample configurations for these daemons can be found in -# /usr/share/doc/quagga/examples/. -# -# ATTENTION: -# -# When activation a daemon at the first time, a config file, even if it is -# empty, has to be present *and* be owned by the user and group "quagga", else -# the daemon will not be started by /etc/init.d/quagga. The permissions should -# be u=rw,g=r,o=. -# When using "vtysh" such a config file is also needed. It should be owned by -# group "quaggavty" and set to ug=rw,o= though. Check /etc/pam.d/quagga, too. -# -# The watchquagga daemon is always started. Per default in monitoring-only but -# that can be changed via /etc/quagga/debian.conf. -# -zebra=yes -bgpd=yes -ospfd=no -ospf6d=no -ripd=no -ripngd=no -isisd=no -babeld=no diff --git a/dockers/docker-fpm-quagga/start.sh b/dockers/docker-fpm-quagga/start.sh index ca876efe184e..1e7a49809d55 100755 --- a/dockers/docker-fpm-quagga/start.sh +++ b/dockers/docker-fpm-quagga/start.sh @@ -22,7 +22,8 @@ supervisorctl start bgpcfgd supervisorctl start rsyslogd -# Quagga has its own monitor process, 'watchquagga' -service quagga start +# Start Quagga processes +supervisorctl start zebra +supervisorctl start bgpd supervisorctl start fpmsyncd diff --git a/dockers/docker-fpm-quagga/supervisord.conf b/dockers/docker-fpm-quagga/supervisord.conf index 7b6de2163642..5a310a790f18 100644 --- a/dockers/docker-fpm-quagga/supervisord.conf +++ b/dockers/docker-fpm-quagga/supervisord.conf @@ -11,27 +11,42 @@ autorestart=false stdout_logfile=syslog stderr_logfile=syslog -[program:rsyslogd] -command=/usr/sbin/rsyslogd -n +[program:bgpcfgd] +command=/usr/bin/bgpcfgd priority=2 autostart=false autorestart=false stdout_logfile=syslog stderr_logfile=syslog -[program:fpmsyncd] -command=fpmsyncd +[program:rsyslogd] +command=/usr/sbin/rsyslogd -n priority=3 autostart=false autorestart=false stdout_logfile=syslog stderr_logfile=syslog -[program:bgpcfgd] -command=/usr/bin/bgpcfgd +[program:zebra] +command=/usr/lib/quagga/zebra -A 127.0.0.1 priority=4 autostart=false autorestart=false stdout_logfile=syslog stderr_logfile=syslog +[program:bgpd] +command=/usr/lib/quagga/bgpd -A 127.0.0.1 +priority=5 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog + +[program:fpmsyncd] +command=fpmsyncd +priority=6 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog