From 485d132baa16e86896c72321826147326be48919 Mon Sep 17 00:00:00 2001
From: fermin831 <fermin.hernandez@artica.es>
Date: Tue, 3 Oct 2017 17:56:13 +0200
Subject: [PATCH] Enable SystemD services and other fixes an Suse rpm

---
 pandora_agents/unix/pandora_agent.spec | 4 ++++
 pandora_server/pandora_server.spec     | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec
index 805edcf481..fde5bde7b0 100644
--- a/pandora_agents/unix/pandora_agent.spec
+++ b/pandora_agents/unix/pandora_agent.spec
@@ -67,6 +67,7 @@ then
 fi
 
 %post
+mkdir -p /var/log/pandora
 chown pandora:root /var/log/pandora
 if [ ! -d /etc/pandora ] ; then
 	mkdir -p /etc/pandora
@@ -91,6 +92,9 @@ if [ ! -e /etc/pandora/collections ]; then
 fi
 cp -aRf /usr/share/pandora_agent/pandora_agent_logrotate /etc/logrotate.d/pandora_agent
 
+# Enable the service on SystemD
+systemctl enable pandora_agent_daemon.service
+
 mkdir -p /var/spool/pandora/data_out
 chkconfig pandora_agent_daemon on
 
diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec
index a95f9e4d8b..f5d0f0097f 100644
--- a/pandora_server/pandora_server.spec
+++ b/pandora_server/pandora_server.spec
@@ -99,6 +99,11 @@ exit 0
 chkconfig pandora_server on 
 chkconfig tentacle_serverd on 
 
+# Enable the services on SystemD
+systemctl enable tentacle_serverd.service
+systemctl enable pandora_server.service
+
+
 echo "/usr/share/pandora_server/util/pandora_db.pl /etc/pandora/pandora_server.conf" > /etc/cron.hourly/pandora_db
 chmod 750 /etc/cron.hourly/pandora_db
 cp -aRf /usr/share/pandora_server/util/pandora_server_logrotate /etc/logrotate.d/pandora_server