diff --git a/sysinv/sysinv-fpga-agent/centos/sysinv-fpga-agent.spec b/sysinv/sysinv-fpga-agent/centos/sysinv-fpga-agent.spec index 43cd488e76..048a816061 100644 --- a/sysinv/sysinv-fpga-agent/centos/sysinv-fpga-agent.spec +++ b/sysinv/sysinv-fpga-agent/centos/sysinv-fpga-agent.spec @@ -31,6 +31,8 @@ install -p -D -m 755 sysinv-fpga-agent %{buildroot}%{local_etc_initd}/sysinv-fpg install -d -m 755 %{buildroot}%{local_etc_pmond} install -p -D -m 644 sysinv-fpga-agent.conf %{buildroot}%{local_etc_pmond}/sysinv-fpga-agent.conf install -p -D -m 644 sysinv-fpga-agent.service %{buildroot}%{_unitdir}/sysinv-fpga-agent.service +install -p -D -m 644 sysinv-conf-watcher.service %{buildroot}%{_unitdir}/sysinv-conf-watcher.service +install -p -D -m 644 sysinv-conf-watcher.path %{buildroot}%{_unitdir}/sysinv-conf-watcher.path # Workaround to call "docker login" during startup. Called by puppet. install -d -m 755 %{buildroot}%{_exec_prefix}/local/sbin @@ -38,6 +40,8 @@ install -p -D -m 755 run_docker_login %{buildroot}%{_exec_prefix}/local/sbin/run %post /usr/bin/systemctl enable sysinv-fpga-agent.service >/dev/null 2>&1 +/usr/bin/systemctl enable sysinv-conf-watcher.service >/dev/null 2>&1 +/usr/bin/systemctl enable sysinv-conf-watcher.path >/dev/null 2>&1 %clean rm -rf $RPM_BUILD_ROOT @@ -48,4 +52,6 @@ rm -rf $RPM_BUILD_ROOT %{local_etc_initd}/sysinv-fpga-agent %{local_etc_pmond}/sysinv-fpga-agent.conf %{_unitdir}/sysinv-fpga-agent.service +%{_unitdir}/sysinv-conf-watcher.service +%{_unitdir}/sysinv-conf-watcher.path %{_exec_prefix}/local/sbin/run_docker_login diff --git a/sysinv/sysinv-fpga-agent/sysinv-conf-watcher.path b/sysinv/sysinv-fpga-agent/sysinv-conf-watcher.path new file mode 100644 index 0000000000..ca3fece52a --- /dev/null +++ b/sysinv/sysinv-fpga-agent/sysinv-conf-watcher.path @@ -0,0 +1,5 @@ +[Path] +PathChanged=/etc/sysinv/sysinv.conf + +[Install] +WantedBy=multi-user.target diff --git a/sysinv/sysinv-fpga-agent/sysinv-conf-watcher.service b/sysinv/sysinv-fpga-agent/sysinv-conf-watcher.service new file mode 100644 index 0000000000..30d3928a4a --- /dev/null +++ b/sysinv/sysinv-fpga-agent/sysinv-conf-watcher.service @@ -0,0 +1,11 @@ +[Unit] +Description=StarlingX conf watcher +After=sysinv-fpga-agent.service +Before=pmon.service + +[Service] +Type=oneshot +ExecStart=/usr/bin/systemctl restart sysinv-fpga-agent.service + +[Install] +WantedBy=multi-user.target