Commit f5684224 authored by Frank Winkler's avatar Frank Winkler

Minor changes.

General prerotate script for logrotate.
Prolog checks if an old collectd daemon is still running and kills it.
parent dcbbb4c0
......@@ -4,7 +4,7 @@
sed "/COLLECTD_LOGFILE/c ${COLLECTD_LOGFILE} {" \
${PIKA_ROOT}/daemon/logrotate/pika_logrotate_template.conf > ${PIKA_LOGPATH}/pika_logrotate.conf
sed -i "/PREROTATE_SCRIPT/c ${PIKA_ROOT}/daemon/logrotate/pika_mail_errors.sh" \
sed -i "/PREROTATE_SCRIPT/c ${PIKA_ROOT}/daemon/logrotate/pika_prerotate.sh" \
${PIKA_LOGPATH}/pika_logrotate.conf
# check if pika_lograte.sh is in /etc/cron.daily
......
......@@ -52,6 +52,25 @@ if [ ! -d "${PIKA_INSTALL_PATH}" ]; then
if [ -d "/opt/pika" ]; then
rm -rf /opt/pika
fi
# check if an old collectd daemon is still running, if so kill it
echo -e "\nCheck if an old pika collectd is still running" >> $DEBUG_PATH 2>&1
DAEMON="pika_collectd"
COLLECTD_PID=`ps -eo pid,cmd | grep -v grep | grep "$DAEMON" | awk '{print $1}'`
echo -e "\nCOLLECTD_PID=$COLLECTD_PID" >> $DEBUG_PATH 2>&1
if [ -z "$COLLECTD_PID" ]; then
echo -e "\ncollectd is not running." >> $DEBUG_PATH 2>&1
else
echo -e "\nkill -TERM $COLLECTD_PID" >> $DEBUG_PATH 2>&1
kill -TERM $COLLECTD_PID
fi
# temporary: delete old prope installations
if [ -d "/opt/prope" ]; then
rm -rf /opt/prope
fi
mkdir -p ${PIKA_INSTALL_PATH}
echo -e "tar xzf ${PIKA_PACKAGE_PATH} -C ${PIKA_INSTALL_PATH}/.." >> $DEBUG_PATH 2>&1
tar xzf ${PIKA_PACKAGE_PATH} -C ${PIKA_INSTALL_PATH}/.. >> $DEBUG_PATH 2>&1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment