Commit 1ac84c6c authored by Noah Hilverling's avatar Noah Hilverling

Add package icingadb-redis

parent 87b4abf2
Pipeline #7863 passed with stages
in 4 minutes and 55 seconds
......@@ -22,3 +22,9 @@ Depends:
Built-Using: ${misc:Built-Using}
Suggests: icinga2
Description: database connector for Icinga 2
Package: icingadb-redis
Architecture: any
Depends:
icinga-redis,
Description: Redis service for Icinga DB
This diff is collapsed.
debian/icingadb-redis.conf etc/icinga-redis
#!/bin/sh
set -eu
USER="icinga-redis"
GROUP="$USER"
CONFFILE="/etc/icinga-redis/icingadb-redis.conf"
Setup_dir () {
DIR="${1}"
MODE="${2}"
GROUP="${3}"
mkdir -p ${DIR}
case "${DIR}" in
/var/log/icinga-redis)
MODE="02750"
GROUP="adm"
;;
*)
MODE="750"
GROUP="${USER}"
;;
esac
if ! dpkg-statoverride --list ${DIR} >/dev/null 2>&1
then
chown ${USER}:${GROUP} ${DIR}
chmod ${MODE} ${DIR}
fi
}
if [ "$1" = "configure" ]
then
Setup_dir /var/lib/icinga-redis/icingadb-redis ${USER}:${USER} 750
if ! dpkg-statoverride --list ${CONFFILE} >/dev/null 2>&1
then
dpkg-statoverride --update --add ${USER} ${GROUP} 640 ${CONFFILE}
fi
fi
#DEBHELPER#
exit 0
#!/bin/sh
set -eu
CONFFILE="/etc/icinga-redis/icingadb-redis.conf"
if [ "${1}" = "purge" ]
then
dpkg-statoverride --remove ${CONFFILE} || test $? -eq 2
rm -rf /var/lib/icinga-redis /var/log/icinga-redis
fi
#DEBHELPER#
exit 0
[Unit]
Description=Advanced key-value store for Icinga
After=network.target
Documentation=http://redis.io/documentation, man:icinga-redis(1)
[Service]
Type=notify
ExecStart=/usr/bin/icinga-redis-server /etc/icinga-redis/icingadb-redis.conf
TimeoutStopSec=0
Restart=always
User=icinga-redis
Group=icinga-redis
RuntimeDirectory=icinga-redis
RuntimeDirectoryMode=2755
UMask=007
PrivateTmp=yes
LimitNOFILE=65535
PrivateDevices=yes
ProtectHome=yes
ReadOnlyDirectories=/
ReadWriteDirectories=-/var/lib/icinga-redis
ReadWriteDirectories=-/var/log/icinga-redis
ReadWriteDirectories=-/var/run/icinga-redis
NoNewPrivileges=true
CapabilityBoundingSet=CAP_SETGID CAP_SETUID CAP_SYS_RESOURCE
MemoryDenyWriteExecute=true
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectControlGroups=true
RestrictRealtime=true
RestrictNamespaces=true
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
# icinga-redis can write to its own config file when in cluster mode so we
# permit writing there by default. If you are not using this feature, it is
# recommended that you replace the following lines with "ProtectSystem=full".
ProtectSystem=true
ReadWriteDirectories=-/etc/icinga-redis
[Install]
WantedBy=multi-user.target
\ No newline at end of file
etc/schema usr/share/icingadb
etc/icingadb.service lib/systemd/system
icingadb.ini etc/icingadb
usr/bin/icingadb usr/sbin
\ No newline at end of file
......@@ -13,17 +13,12 @@ endif
INSTALL_DIR := install -d -m 0755
INSTALL_FILE := install -m 0644
PACKAGE_PATH := debian/icingadb
%:
dh $@ --buildsystem golang --with golang --with systemd
override_dh_auto_install:
dh_auto_install -- --no-source
# move binary to sbin
$(INSTALL_DIR) $(PACKAGE_PATH)/usr/sbin
mv $(PACKAGE_PATH)/usr/bin/icingadb $(PACKAGE_PATH)/usr/sbin/icingadb
rmdir $(PACKAGE_PATH)/usr/bin
override_dh_auto_test:
# Disable tests until they can work in build environment
......
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