mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
Added pandora_agente_daemon service to systemd
This commit is contained in:
parent
61c75118f2
commit
e472e5dd9f
@ -162,7 +162,15 @@ uninstall () {
|
|||||||
rm -Rf $PANDORA_BASE$PANDORA_EXEC_BIN 2> /dev/null
|
rm -Rf $PANDORA_BASE$PANDORA_EXEC_BIN 2> /dev/null
|
||||||
rm -Rf $PANDORA_BASE$PANDORA_REVENT_BIN 2> /dev/null
|
rm -Rf $PANDORA_BASE$PANDORA_REVENT_BIN 2> /dev/null
|
||||||
rm -f $DESTDIR/etc/logrotate.d/pandora_agent
|
rm -f $DESTDIR/etc/logrotate.d/pandora_agent
|
||||||
|
|
||||||
|
# Remove systemd service if exists
|
||||||
|
if [ $(systemctl --v | grep systemd | wc -l) != 0 ]
|
||||||
|
then
|
||||||
|
PANDORA_AGENT_SERVICE="/etc/systemd/system/pandora_agent_daemon.service"
|
||||||
|
rm -f $PANDORA_AGENT_SERVICE
|
||||||
|
systemctl reset-failed
|
||||||
|
fi
|
||||||
|
|
||||||
#Test if exist Pandora Server in this machine
|
#Test if exist Pandora Server in this machine
|
||||||
if [ -d $PANDORA_BASE$PANDORA_TEMP/data_in ]
|
if [ -d $PANDORA_BASE$PANDORA_TEMP/data_in ]
|
||||||
then
|
then
|
||||||
@ -465,6 +473,22 @@ install () {
|
|||||||
else
|
else
|
||||||
RCDIRS="/etc/rc2.d /etc/rc3.d"
|
RCDIRS="/etc/rc2.d /etc/rc3.d"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Create systemd service
|
||||||
|
if [ $(systemctl --v | grep systemd | wc -l) != 0 ]
|
||||||
|
then
|
||||||
|
echo "Creating systemd service for pandora_agent_daemon"
|
||||||
|
|
||||||
|
PANDORA_AGENT_SERVICE="/etc/systemd/system/pandora_agent_daemon.service"
|
||||||
|
EXEC_START='ExecStart='$PANDORA_BASE$PANDORA_BIN' '$PANDORA_BASE$PANDORA_CFG
|
||||||
|
|
||||||
|
rm -f $PANDORA_AGENT_SERVICE
|
||||||
|
cp pandora_agent_daemon.service $PANDORA_AGENT_SERVICE
|
||||||
|
|
||||||
|
sed -i "s|^ExecStart=.*$|$EXEC_START|g" $PANDORA_AGENT_SERVICE
|
||||||
|
|
||||||
|
systemctl daemon-reload
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
[ "$RCDIRS" ] && for RCDIR in $RCDIRS
|
[ "$RCDIRS" ] && for RCDIR in $RCDIRS
|
||||||
do
|
do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user