diff --git a/sysinv/sysinv-agent/debian/deb_folder/rules b/sysinv/sysinv-agent/debian/deb_folder/rules index c7216f7094..c8bd3b8ed3 100755 --- a/sysinv/sysinv-agent/debian/deb_folder/rules +++ b/sysinv/sysinv-agent/debian/deb_folder/rules @@ -9,8 +9,10 @@ ROOT := $(CURDIR)/debian/tmp override_dh_install: install -p -D -m 755 sysinv-agent ${ROOT}/etc/init.d/sysinv-agent install -p -D -m 644 sysinv-agent.conf ${ROOT}/etc/pmon.d/sysinv-agent.conf - install -p -D -m 644 sysinv-agent.service ${ROOT}/lib/systemd/system/sysinv-agent.service dh_install override_dh_installinit: dh_installinit --only-scripts + +override_dh_installsystemd: + dh_installsystemd --name sysinv-agent diff --git a/sysinv/sysinv-agent/debian/deb_folder/sysinv-agent.install b/sysinv/sysinv-agent/debian/deb_folder/sysinv-agent.install index bc74e34956..3b74ee57a7 100644 --- a/sysinv/sysinv-agent/debian/deb_folder/sysinv-agent.install +++ b/sysinv/sysinv-agent/debian/deb_folder/sysinv-agent.install @@ -1,3 +1,2 @@ etc/init.d/sysinv-agent etc/pmon.d/sysinv-agent.conf -lib/systemd/system/sysinv-agent.service diff --git a/sysinv/sysinv-agent/debian/deb_folder/sysinv-agent.service b/sysinv/sysinv-agent/debian/deb_folder/sysinv-agent.service new file mode 100644 index 0000000000..1badb16bc4 --- /dev/null +++ b/sysinv/sysinv-agent/debian/deb_folder/sysinv-agent.service @@ -0,0 +1,15 @@ +[Unit] +Description=StarlingX System Inventory Agent +After=nfscommon.service sw-patch.service +After=network-online.target systemd-udev-settle.service +Before=pmon.service + +[Service] +Type=forking +RemainAfterExit=yes +ExecStart=/etc/init.d/sysinv-agent start +ExecStop=/etc/init.d/sysinv-agent stop +PIDFile=/var/run/sysinv-agent.pid + +[Install] +WantedBy=multi-user.target diff --git a/sysinv/sysinv-agent/sysinv-agent b/sysinv/sysinv-agent/sysinv-agent index e0aa472376..2bc8fb1ff8 100755 --- a/sysinv/sysinv-agent/sysinv-agent +++ b/sysinv/sysinv-agent/sysinv-agent @@ -14,7 +14,7 @@ # Required-Start: $local_fs # Required-Stop: $local_fs # Default-Stop: 0 1 6 -# Short-Description: Maintenance daemon +# Short-Description: Maintenance daemon ### END INIT INFO . /etc/init.d/functions diff --git a/sysinv/sysinv-fpga-agent/debian/deb_folder/rules b/sysinv/sysinv-fpga-agent/debian/deb_folder/rules index 8f4b8dad61..9eab6d526b 100755 --- a/sysinv/sysinv-fpga-agent/debian/deb_folder/rules +++ b/sysinv/sysinv-fpga-agent/debian/deb_folder/rules @@ -9,14 +9,12 @@ ROOT := $(CURDIR)/debian/tmp override_dh_install: install -p -D -m 755 sysinv-fpga-agent ${ROOT}/etc/init.d/sysinv-fpga-agent install -p -D -m 644 sysinv-fpga-agent.conf ${ROOT}/etc/pmon.d/sysinv-fpga-agent.conf - install -p -D -m 644 sysinv-fpga-agent.service ${ROOT}/lib/systemd/system/sysinv-fpga-agent.service - install -p -D -m 644 sysinv-conf-watcher.service ${ROOT}/lib/systemd/system/sysinv-conf-watcher.service - install -p -D -m 644 sysinv-conf-watcher.path ${ROOT}/lib/systemd/system/sysinv-conf-watcher.path dh_install override_dh_usrlocal: # do nothing override_dh_installsystemd: - dh_installsystemd --name=sysinv-fpga-agent.service - dh_installsystemd --name=sysinv-fpga-watcher.service + dh_installsystemd --name sysinv-fpga-agent.service + dh_installsystemd --name sysinv-conf-watcher.service + dh_installsystemd --name sysinv-conf-watcher.path diff --git a/sysinv/sysinv-fpga-agent/debian/deb_folder/sysinv-conf-watcher.path b/sysinv/sysinv-fpga-agent/debian/deb_folder/sysinv-conf-watcher.path new file mode 100644 index 0000000000..ca3fece52a --- /dev/null +++ b/sysinv/sysinv-fpga-agent/debian/deb_folder/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/debian/deb_folder/sysinv-conf-watcher.service b/sysinv/sysinv-fpga-agent/debian/deb_folder/sysinv-conf-watcher.service new file mode 100644 index 0000000000..30d3928a4a --- /dev/null +++ b/sysinv/sysinv-fpga-agent/debian/deb_folder/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 diff --git a/sysinv/sysinv-fpga-agent/debian/deb_folder/sysinv-fpga-agent.install b/sysinv/sysinv-fpga-agent/debian/deb_folder/sysinv-fpga-agent.install index d9849758f8..89a7f8760b 100644 --- a/sysinv/sysinv-fpga-agent/debian/deb_folder/sysinv-fpga-agent.install +++ b/sysinv/sysinv-fpga-agent/debian/deb_folder/sysinv-fpga-agent.install @@ -1,5 +1,2 @@ etc/init.d/sysinv-fpga-agent etc/pmon.d/sysinv-fpga-agent.conf -lib/systemd/system/sysinv-fpga-agent.service -lib/systemd/system/sysinv-conf-watcher.service -lib/systemd/system/sysinv-conf-watcher.path diff --git a/sysinv/sysinv-fpga-agent/debian/deb_folder/sysinv-fpga-agent.service b/sysinv/sysinv-fpga-agent/debian/deb_folder/sysinv-fpga-agent.service new file mode 100644 index 0000000000..1bf01cc6f1 --- /dev/null +++ b/sysinv/sysinv-fpga-agent/debian/deb_folder/sysinv-fpga-agent.service @@ -0,0 +1,15 @@ +[Unit] +Description=StarlingX FPGA Agent +After=nfscommon.service sw-patch.service +After=network-online.target systemd-udev-settle.service sysinv-agent.service +Before=pmon.service + +[Service] +Type=forking +RemainAfterExit=yes +ExecStart=/etc/init.d/sysinv-fpga-agent start +ExecStop=/etc/init.d/sysinv-fpga-agent stop +PIDFile=/var/run/sysinv-fpga-agent.pid + +[Install] +WantedBy=multi-user.target diff --git a/sysinv/sysinv/debian/deb_folder/rules b/sysinv/sysinv/debian/deb_folder/rules index abc097fe27..2369c9b77b 100755 --- a/sysinv/sysinv/debian/deb_folder/rules +++ b/sysinv/sysinv/debian/deb_folder/rules @@ -27,8 +27,8 @@ override_dh_python3: dh_python3 --shebang=/usr/bin/python3 override_dh_installsystemd: - dh_installsystemd --name=sysinv-api - dh_installsystemd --name=sysinv-conductor + dh_installsystemd --no-enable --name sysinv-api + dh_installsystemd --no-enable --name sysinv-conductor override_dh_fixperms: dh_fixperms -Xkube-cert-rotation.sh diff --git a/sysinv/sysinv/debian/deb_folder/sysinv-api.service b/sysinv/sysinv/debian/deb_folder/sysinv-api.service new file mode 100644 index 0000000000..d05c07cfea --- /dev/null +++ b/sysinv/sysinv/debian/deb_folder/sysinv-api.service @@ -0,0 +1,15 @@ +[Unit] +Description=System Inventory API +After=network-online.target syslog-ng.service config.service sysinv-conductor.service + +[Service] +Type=simple +RemainAfterExit=yes +User=root +Environment=OCF_ROOT=/usr/lib/ocf +ExecStart=/usr/lib/ocf/resource.d/platform/sysinv-api start +ExecStop=/usr/lib/ocf/resource.d/platform/sysinv-api stop +PIDFile=/var/run/sysinv-api.pid + +[Install] +WantedBy=multi-user.target diff --git a/sysinv/sysinv/debian/deb_folder/sysinv-conductor.service b/sysinv/sysinv/debian/deb_folder/sysinv-conductor.service new file mode 100644 index 0000000000..7c0dae1eee --- /dev/null +++ b/sysinv/sysinv/debian/deb_folder/sysinv-conductor.service @@ -0,0 +1,15 @@ +[Unit] +Description=System Inventory Conductor +After=network-online.target syslog-ng.service config.service rabbitmq-server.service + +[Service] +Type=simple +RemainAfterExit=yes +User=root +Environment=OCF_ROOT=/usr/lib/ocf +ExecStart=/usr/lib/ocf/resource.d/platform/sysinv-conductor start +ExecStop=/usr/lib/ocf/resource.d/platform/sysinv-conductor stop +PIDFile=/var/run/sysinv-conductor.pid + +[Install] +WantedBy=multi-user.target diff --git a/sysinv/sysinv/debian/deb_folder/sysinv.install b/sysinv/sysinv/debian/deb_folder/sysinv.install index 18442de6d1..8f08036c58 100644 --- a/sysinv/sysinv/debian/deb_folder/sysinv.install +++ b/sysinv/sysinv/debian/deb_folder/sysinv.install @@ -6,8 +6,6 @@ etc/sysinv/crushmap-aio-sx.txt etc/sysinv etc/sysinv/delete_load.sh etc/sysinv/upgrades scripts/sysinv-api usr/lib/ocf/resource.d/platform scripts/sysinv-conductor usr/lib/ocf/resource.d/platform -scripts/sysinv-api.service lib/systemd/system -scripts/sysinv-conductor.service lib/systemd/system scripts/partition_info.sh usr/bin scripts/validate-platform-backup.sh usr/bin scripts/manage-partitions usr/bin