Merge remote-tracking branch 'github/develop' into develop

This commit is contained in:
Ramon Novoa 2016-11-02 13:26:35 +01:00
commit 04f9f8e176
12 changed files with 79 additions and 14 deletions

View File

@ -37,6 +37,7 @@ mkdir -p temp_package/usr/sbin/
mkdir -p temp_package/etc/pandora/plugins
mkdir -p temp_package/etc/pandora/collections
mkdir -p temp_package/etc/init.d/
mkdir -p temp_package/lib/systemd/system/
mkdir -p temp_package/var/log/pandora/
mkdir -p temp_package/var/spool/pandora/data_out
mkdir -p temp_package/usr/share/man/man1/
@ -63,6 +64,7 @@ cp -aRf tentacle_client temp_package/usr/bin/
cp -aRf pandora_agent temp_package/usr/bin/
cp -aRf pandora_agent_exec temp_package/usr/bin/pandora_agent_exec
cp -aRf pandora_agent_daemon temp_package/etc/init.d/pandora_agent_daemon
cp -aRf pandora_agent_daemon.service temp_package/lib/systemd/system/pandora_agent_daemon.service
cp -aRf pandora_agent_logrotate temp_package/etc/logrotate.d/pandora_agent
cp Linux/pandora_agent.conf temp_package/etc/pandora/

View File

@ -22,7 +22,12 @@ chgrp root $PANDORA_LOG
chown -R root:root $PANDORA_BIN
chown -R root:root $PANDORA_EXEC_BIN
echo "Linking start-up daemon script to /etc/rc$INITLV.d";
update-rc.d pandora_agent_daemon defaults
echo "Enabling start-up agent daemon";
if [ -x `command -v systemctl` ]; then
systemctl daemon-reload
systemctl enable pandora_agent_daemon
else
update-rc.d pandora_agent_daemon defaults
fi
echo "Please, now setup the $PANDORA_HOME/pandora_agent.conf and before start the /etc/init.d/pandora_agent_daemon"
echo "Please, now setup the $PANDORA_HOME/pandora_agent.conf and before start the pandora_agent_daemon service"

View File

@ -8,4 +8,9 @@ PANDORA_CFG=/etc/pandora
#rm -rf $PANDORA_CFG/plugins
#rm -rf $PANDORA_CFG/pandora_agent.conf
update-rc.d -f pandora_agent_daemon remove
if [ -x `command -v systemctl` ]; then
systemctl disable pandora_agent_daemon
systemctl daemon-reload
else
update-rc.d -f pandora_agent_daemon remove
fi

View File

@ -27,6 +27,10 @@ DAEMON_TENTACLE=/usr/bin/tentacle_server
LOGFILE=/var/log/pandora/pandora_agent.log
PANDORA_USER=root
if [ -x /lib/lsb/init-functions ]; then
. /lib/lsb/init-functions
fi
# This function replace pidof, not working in the same way in different linux distros
pidof_pandora () {

View File

@ -0,0 +1,9 @@
[Unit]
Description=Pandora FMS agent daemon
After=network-online.target
[Service]
ExecStart=/usr/bin/pandora_agent /etc/pandora
[Install]
WantedBy=multi-user.target

View File

@ -67,6 +67,7 @@ then
mkdir -p temp_package/usr/bin/
mkdir -p temp_package/usr/sbin/
mkdir -p temp_package/etc/init.d/
mkdir -p temp_package/lib/systemd/system/
mkdir -p temp_package/etc/pandora/
mkdir -p temp_package/var/spool/pandora/data_in
chmod 770 temp_package/var/spool/pandora/data_in
@ -97,6 +98,9 @@ then
cp -aRf util/pandora_server temp_package/etc/init.d/
cp -aRf util/tentacle_serverd temp_package/etc/init.d/
cp -aRf util/pandora_server.service temp_package/lib/systemd/system/
cp -aRf util/tentacle_serverd.service temp_package/lib/systemd/system/
cp -aRf man/man1/* temp_package/usr/share/man/man1/
cp -aRf util/pandora_server_logrotate temp_package/etc/logrotate.d/pandora_server

View File

@ -81,12 +81,15 @@ else
echo "Skipping creation of pandora_server.conf: there is already one."
fi
echo "Linking startup script to /etc/rc2.d"
update-rc.d pandora_server defaults
# Tentacle server install
echo "Installing tentacle server in /etc/rc2.d/S80tentacle_serverd"
update-rc.d tentacle_serverd defaults
echo "Enabling start-up pandora & tentacle server daemons";
if [ -x `command -v systemctl` ]; then
systemctl daemon-reload
systemctl enable pandora_server
systemctl enable tentacle_serverd
else
update-rc.d pandora_server defaults
update-rc.d tentacle_serverd defaults
fi
if [ -d /etc/cron.hourly ]
then

View File

@ -60,10 +60,14 @@ get_distro () {
GET_DISTRO="`get_distro`"
DISTRO=`echo $GET_DISTRO | cut -f 1 -d ":"`
rm /etc/init.d/pandora_server
rm /etc/init.d/tentacle_serverd
update-rc.d pandora_server remove
update-rc.d tentacle_serverd remove
if [ -x `command -v systemctl` ]; then
systemctl disable pandora_server
systemctl disable tentacle_serverd
systemctl daemon-reload
else
update-rc.d pandora_server remove
update-rc.d tentacle_serverd remove
fi
if [ -d /etc/cron.hourly ]
then

View File

@ -24,6 +24,10 @@
# Description: Pandora FMS Server startup script
### END INIT INFO
if [ -x /lib/lsb/init-functions ]; then
. /lib/lsb/init-functions
fi
# If you want to run several pandora servers in this machine, just copy
# this script to another name, editing PANDORA_HOME to the new .conf

View File

@ -0,0 +1,10 @@
[Unit]
Description=Pandora FMS server daemon
After=network-online.target
[Service]
Type=forking
ExecStart=/usr/bin/pandora_server /etc/pandora/pandora_server.conf -D
[Install]
WantedBy=multi-user.target

View File

@ -24,6 +24,10 @@
# Description: Tentacle Server startup script
### END INIT INFO
if [ -x /lib/lsb/init-functions ]; then
. /lib/lsb/init-functions
fi
# Uses a wait limit before sending a KILL signal, before trying to stop
# Pandora FMS server nicely. Some big systems need some time before close
# all pending tasks / threads.

View File

@ -0,0 +1,11 @@
[Unit]
Description=Tentacle server daemon
After=network-online.target
[Service]
Type=forking
ExecStart=/usr/bin/tentacle_server -a 0.0.0.0 -p 41121 -s /var/spool/pandora/data_in -i.*\.conf:conf;.*\.md5:md5;.*\.zip:collections -d
User=pandora
[Install]
WantedBy=multi-user.target