diff --git a/Makefile b/Makefile index 43e76bd..f19d933 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,8 @@ PREFIX = /usr/local NAGIOS_DIR = ${PREFIX}/nagios NAGIOS_EXEC = ${NAGIOS_DIR}/libexec +NAGIOS_USER = _nagios +NAGIOS_GROUP = ${NAGIOS_USER} SYSTEMD_UNIT_DIR = /lib/systemd/system rc: install @@ -29,7 +31,9 @@ install: @chmod 755 ${NAGIOS_EXEC}/check_onion @echo installing ircbot.sh to ${PREFIX}/bin @cp -f ircbot.sh ${PREFIX}/bin - test -f /etc/ircbot.conf || install -m 640 ircbot.conf.default /etc/ircbot.conf + @echo installing ircbot.conf to /etc + test -f /etc/ircbot.conf || install -m 640 -o root -g ${NAGIOS_GROUP} ircbot.conf.default /etc/ircbot.conf + test -f /var/log/ircbot.log || install -m 640 -o ${NAGIOS_USER} -g wheel /dev/null /var/log/ircbot.log @chmod 755 ${PREFIX}/bin/ircbot.sh uninstall: diff --git a/README.md b/README.md index daea892..dc13c87 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,3 @@ systemd or rc. Start it with `systemctl start ircbot` or `rcctl start ircbot`. The nagios IRC bot (ircbot.sh) does not automatically rejoin the IRC server and channel after it loses the connection. - -The Makefile does not install the /etc/ircbot.conf configuration -file with the correct ownership and permissions. It should be -readable by nagios user on Linux and _nagios user on OpenBSD. diff --git a/ircbot.conf.default b/ircbot.conf.default index 42d5516..d82568d 100644 --- a/ircbot.conf.default +++ b/ircbot.conf.default @@ -6,5 +6,5 @@ password='mysecretpass' port='6667' inputf=/tmp/ircinput msgf=/tmp/ircmsg -logf=/tmp/notify_irc.log +logf=/var/log/ircbot.log joinmsg="nagios bot reporting"