Skip to content

Commit

Permalink
Updating deb packaging files
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielNeto committed Aug 14, 2024
1 parent b2ffe0d commit 24da3c8
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Package: perfsonar-host-metrics
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}, prometheus-node-exporter,
openssl, apache2, apache2-ssl-dev, perfsonar-common, python3-perfsonar-psconfig,
python3-pscheduler
python3-pscheduler, python3, python3-flask, libapache2-mod-wsgi-py3
Description: Prometheus node-exporter integration with perfSONAR
A package that installs and sets-up Prometheus node_exporter for a perfSONAR
to collect and report host metrics.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apache-node_exporter.conf /etc/apache2/conf-available/
apache-perfsonar_host_exporter.conf /etc/apache2/conf-available/
exporter_opts.sh /usr/lib/perfsonar/host_metrics/
perfsonar_host_exporter /usr/lib/perfsonar/host_metrics/
perfsonar-host-exporter.service lib/systemd/system/
perfsonar_host_exporter.py /usr/lib/perfsonar/host_metrics/
host_exporter.wsgi /var/www/html/perfsonar/host_exporter
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ set -e

case "$1" in
configure)
# This link is necessary because the WSGI script imports the application using a path relative to the WSGI config directory.
ln -sT -f /usr/lib/perfsonar/host_metrics/ /var/www/html/perfsonar/host_exporter/host_exporter
# check if installation or update, where version is a parameter
chmod 755 /usr/lib/perfsonar/host_metrics/perfsonar_host_exporter
#set node_exporter opts
Expand All @@ -16,9 +18,8 @@ case "$1" in
systemctl daemon-reload || :
systemctl enable node_exporter.service || :
systemctl restart node_exporter.service || :
systemctl enable perfsonar-host-exporter.service || :
systemctl restart perfsonar-host-exporter.service || :

# Enable and restart apache for wsgi and reverse proxy
# Apache setup
if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then
. /usr/share/apache2/apache2-maintscript-helper
Expand All @@ -27,6 +28,7 @@ case "$1" in
apache2_invoke ensite default-ssl
apache2_invoke enmod proxy
apache2_invoke enmod proxy_http
apache2_invoke enconf mod-wsgi
apache2_invoke enconf apache-node_exporter
apache2_invoke enconf apache-perfsonar_host_exporter
fi
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh
# prerm script for perfsonar host metrics
#
# see: dh_installdeb(1)

set -e


case "$1" in
remove|upgrade|deconfigure)
if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then
. /usr/share/apache2/apache2-maintscript-helper
apache2_invoke disconf apache-node_exporter
apache2_invoke disconf apache-perfsonar_host_exporter
fi

rm -f /var/www/html/perfsonar/host_exporter/host_exporter
;;
esac

exit 0

0 comments on commit 24da3c8

Please sign in to comment.