diff --git a/fm-mgr/debian/deb_folder/fm-mgr.install b/fm-mgr/debian/deb_folder/fm-mgr.install index bb823ba8..1d272934 100644 --- a/fm-mgr/debian/deb_folder/fm-mgr.install +++ b/fm-mgr/debian/deb_folder/fm-mgr.install @@ -1,4 +1,3 @@ -usr/bin/fmManager etc/init.d/fminit etc/logrotate.d/fm.logrotate -usr/lib/systemd/system/fminit.service lib/systemd/system +usr/local/bin/fmManager diff --git a/fm-mgr/debian/deb_folder/fminit.service b/fm-mgr/debian/deb_folder/fminit.service new file mode 100644 index 00000000..900fdd09 --- /dev/null +++ b/fm-mgr/debian/deb_folder/fminit.service @@ -0,0 +1,17 @@ +[Unit] +Description=StarlingX Fault Management Initialization +After=network.target syslog.target + +[Service] +Type=forking +Restart=no +KillMode=process +RemainAfterExit=yes +ExecStart=/etc/init.d/fminit start +ExecStop=/etc/init.d/fminit stop +ExecReload=/etc/init.d/fminit reload +PIDFile=/var/run/fmManager.pid + +[Install] +WantedBy=multi-user.target + diff --git a/fm-mgr/debian/deb_folder/rules b/fm-mgr/debian/deb_folder/rules index 6bee34a0..7e629ea6 100755 --- a/fm-mgr/debian/deb_folder/rules +++ b/fm-mgr/debian/deb_folder/rules @@ -8,7 +8,10 @@ export ROOT=debian/tmp override_dh_auto_install: make DESTDIR=${ROOT} \ - BINDIR=/usr/bin \ - LIBDIR=/usr/lib \ - SYSCONFDIR=/etc \ install + +override_dh_installsystemd: + dh_installsystemd --no-enable --name fminit + +override_dh_usrlocal: + # Do nothing diff --git a/fm-rest-api/debian/deb_folder/fm-api.service b/fm-rest-api/debian/deb_folder/fm-api.service new file mode 100644 index 00000000..2026e5f4 --- /dev/null +++ b/fm-rest-api/debian/deb_folder/fm-api.service @@ -0,0 +1,15 @@ +[Unit] +Description=Fault Management REST API Service +After=nfscommon.service sw-patch.service +After=network-online.target systemd-udev-settle.service + +[Service] +Type=simple +RemainAfterExit=yes +User=root +ExecStart=/etc/init.d/fm-api start +ExecStop=/etc/init.d/fm-api stop +PIDFile=/var/run/fm-api.pid + +[Install] +WantedBy=multi-user.target diff --git a/fm-rest-api/debian/deb_folder/fm-rest-api.install b/fm-rest-api/debian/deb_folder/fm-rest-api.install index 09c18af6..69e1eeb5 100644 --- a/fm-rest-api/debian/deb_folder/fm-rest-api.install +++ b/fm-rest-api/debian/deb_folder/fm-rest-api.install @@ -1,4 +1,4 @@ +debian/systemd/00-fm-rest-api.preset etc/systemd/system-preset etc/fm/fm.conf -etc/pmon.d/fm-api.conf etc/init.d -lib/systemd/system +etc/pmon.d/fm-api.conf diff --git a/fm-rest-api/debian/deb_folder/postinst b/fm-rest-api/debian/deb_folder/postinst new file mode 100644 index 00000000..ff26b856 --- /dev/null +++ b/fm-rest-api/debian/deb_folder/postinst @@ -0,0 +1,7 @@ +#!/bin/sh + +set -e + +chown fm:fm /etc/fm/fm.conf + +#DEBHELPER# diff --git a/fm-rest-api/debian/deb_folder/rules b/fm-rest-api/debian/deb_folder/rules index d7952159..1c17e506 100755 --- a/fm-rest-api/debian/deb_folder/rules +++ b/fm-rest-api/debian/deb_folder/rules @@ -6,14 +6,11 @@ export ROOT=debian/tmp export FMCONFDIR=$(ROOT)/etc/fm export PMONDDIR=$(ROOT)/etc/pmon.d export INITDIR=$(ROOT)/etc/init.d -export UNITDIR=$(ROOT)/lib/systemd/system %: dh $@ --with=python3 --buildsystem=pybuild override_dh_auto_install: - install -d -m 755 $(UNITDIR) - install -p -D -m 644 scripts/fm-api.service $(UNITDIR)/fm-api.service install -d -m 755 $(INITDIR) install -p -D -m 755 scripts/fm-api $(INITDIR)/fm-api install -d -m 755 $(PMONDDIR) @@ -27,6 +24,9 @@ override_dh_auto_install: override_dh_fixperms: dh_fixperms -Xfm.conf +override_dh_installsystemd: + dh_installsystemd --no-enable --name fm-api + ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) override_dh_auto_test: # (tbogue) FIXME diff --git a/fm-rest-api/debian/deb_folder/systemd/00-fm-rest-api.preset b/fm-rest-api/debian/deb_folder/systemd/00-fm-rest-api.preset new file mode 100644 index 00000000..ec2c01ee --- /dev/null +++ b/fm-rest-api/debian/deb_folder/systemd/00-fm-rest-api.preset @@ -0,0 +1 @@ +enable fm-api.service