diff --git a/mtce-guest/centos/mtce-guest.spec b/mtce-guest/centos/mtce-guest.spec index 8fda8ee7..6e431ad6 100644 --- a/mtce-guest/centos/mtce-guest.spec +++ b/mtce-guest/centos/mtce-guest.spec @@ -127,6 +127,9 @@ make install \ LOCALBINDIR=%{buildroot}%{local_bindir} \ UNITDIR=%{buildroot}%{_unitdir} +install -m 644 -p -D scripts/guestServer.service %{buildroot}%{_unitdir}/guestServer.service +install -m 644 -p -D scripts/guestAgent.service %{buildroot}%{_unitdir}/guestAgent.service + # enable all services in systemd %post -n mtce-guestServer /bin/systemctl enable guestServer.service diff --git a/mtce-guest/debian/deb_folder/guestAgent.service b/mtce-guest/debian/deb_folder/guestAgent.service new file mode 100644 index 00000000..f69e2634 --- /dev/null +++ b/mtce-guest/debian/deb_folder/guestAgent.service @@ -0,0 +1,16 @@ +[Unit] +Description=StarlingX Guest Agent +After=network.target syslog.service + +[Service] +Type=forking +ExecStart=/etc/init.d/guestAgent start +ExecStop=/etc/init.d/guestAgent stop +ExecReload=/etc/init.d/guestAgent reload +PIDFile=/var/run/guestAgent.pid + +Restart=no + +[Install] +WantedBy=multi-user.target + diff --git a/mtce-guest/debian/deb_folder/guestServer.service b/mtce-guest/debian/deb_folder/guestServer.service new file mode 100644 index 00000000..c2c9fe28 --- /dev/null +++ b/mtce-guest/debian/deb_folder/guestServer.service @@ -0,0 +1,23 @@ +[Unit] +Description=StarlingX Maintenance Guest Heartbeat Monitor Server +After=network.target syslog.service config.service +Before=pmon.service + +[Service] +Type=forking +ExecStart=/etc/init.d/guestServer start +ExecStop=/etc/init.d/guestServer stop +ExecReload=/etc/init.d/guestServer reload +PIDFile=/var/run/guestServer.pid + +# Failure handling +TimeoutStartSec=10s +TimeoutStopSec=10s + +# process recovery is handled by pmond +Restart=no +RestartSec=5 + +[Install] +WantedBy=multi-user.target + diff --git a/mtce-guest/debian/deb_folder/mtce-guest-agent.install b/mtce-guest/debian/deb_folder/mtce-guest-agent.install index 7990a45f..73df0fb9 100644 --- a/mtce-guest/debian/deb_folder/mtce-guest-agent.install +++ b/mtce-guest/debian/deb_folder/mtce-guest-agent.install @@ -1,6 +1,5 @@ -usr/bin/guestAgent +usr/local/bin/guestAgent usr/lib/ocf/resource.d/platform/guestAgent -lib/systemd/system/guestAgent.service etc/init.d/guestAgent etc/logrotate.d/guestAgent.logrotate etc/mtc/guestAgent.ini diff --git a/mtce-guest/debian/deb_folder/mtce-guest-server.install b/mtce-guest/debian/deb_folder/mtce-guest-server.install index 60ae5195..e067432a 100644 --- a/mtce-guest/debian/deb_folder/mtce-guest-server.install +++ b/mtce-guest/debian/deb_folder/mtce-guest-server.install @@ -1,5 +1,4 @@ -usr/bin/guestServer -lib/systemd/system/guestServer.service +usr/local/bin/guestServer etc/init.d/guestServer etc/logrotate.d/guestServer.logrotate etc/mtc/guestServer.ini diff --git a/mtce-guest/debian/deb_folder/rules b/mtce-guest/debian/deb_folder/rules index d5ffe296..3e377e27 100644 --- a/mtce-guest/debian/deb_folder/rules +++ b/mtce-guest/debian/deb_folder/rules @@ -3,7 +3,7 @@ export ROOT=debian/tmp -export BINDIR=/usr/bin +export BINDIR=/usr/local/bin export INITDIR=$(ROOT)/etc/init.d export LOGDIR=$(ROOT)/etc/logrotate.d export MTCDIR=$(ROOT)/etc/mtc @@ -33,5 +33,12 @@ override_dh_auto_install: install -d -m 755 $(PMONDIR) install -p -D -m 644 scripts/guestServer.pmon $(PMONDIR)/guestServer.conf +override_dh_installsystemd: + dh_installsystemd --name guestServer + dh_installsystemd --no-enable --name guestAgent + override_dh_fixperms: dh_fixperms -XguestAgent -XguestServer + +override_dh_usrlocal: + echo "SKIPPING DH USRLOCAL" diff --git a/mtce-guest/src/Makefile b/mtce-guest/src/Makefile index deaefa8d..082e478b 100644 --- a/mtce-guest/src/Makefile +++ b/mtce-guest/src/Makefile @@ -63,10 +63,6 @@ install: install -m 700 -p -D scripts/guestServer $(SYSCONFDIR)/init.d/guestServer install -m 700 -p -D scripts/guestAgent $(SYSCONFDIR)/init.d/guestAgent -# systemd service files - install -m 644 -p -D scripts/guestServer.service $(UNITDIR)/guestServer.service - install -m 644 -p -D scripts/guestAgent.service $(UNITDIR)/guestAgent.service - # process monitor config files install -m 755 -d $(SYSCONFDIR)/pmon.d install -m 644 -p -D scripts/guestServer.pmon $(SYSCONFDIR)/pmon.d/guestServer.conf