Files
buildroot/package/sshguard/sshguard.mk
Vladimir Oltean 750d0e377d package/sshguard: patch /usr/local/sbin/sshguard path in systemd service
The systemd service deployed to the target is derived from an example
hardcoded for the /usr/local/sbin/ path, but we install sshguard at
/usr/sbin/. Thus, by default we get this error message:

$ journalctl -b -u sshguard.service -f
systemd[1]: Started SSHGuard - blocks brute-force login attempts.
(sshguard)[612]: sshguard.service: Unable to locate executable '/usr/local/sbin/sshguard': No such file or directory
(sshguard)[612]: sshguard.service: Failed at step EXEC spawning /usr/local/sbin/sshguard: No such file or directory
systemd[1]: sshguard.service: Main process exited, code=exited, status=203/EXEC
systemd[1]: sshguard.service: Failed with result 'exit-code'.
systemd[1]: sshguard.service: Scheduled restart job, restart counter is at 5.
systemd[1]: sshguard.service: Start request repeated too quickly.
systemd[1]: sshguard.service: Failed with result 'exit-code'.
systemd[1]: Failed to start SSHGuard - blocks brute-force login attempts.

Fix up the path in the service after the $(INSTALL) command has run.

Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-10-30 21:00:05 +01:00

33 lines
1.1 KiB
Makefile

################################################################################
#
# sshguard
#
################################################################################
SSHGUARD_VERSION = 2.4.3
SSHGUARD_SITE = https://sourceforge.net/projects/sshguard/files/sshguard/$(SSHGUARD_VERSION)
SSHGUARD_LICENSE = ISC, Public Domain (fnv hash), BSD-3-Clause (SimCList)
SSHGUARD_LICENSE_FILES = COPYING
define SSHGUARD_INSTALL_CONFIG
$(INSTALL) -D -m 0644 $(@D)/examples/sshguard.conf.sample \
$(TARGET_DIR)/etc/sshguard.conf
$(SED) '/^#BACKEND/c\BACKEND="/usr/libexec/sshg-fw-iptables"' \
-e '/^#FILES/c\FILES="/var/log/messages"' $(TARGET_DIR)/etc/sshguard.conf
endef
SSHGUARD_POST_INSTALL_TARGET_HOOKS += SSHGUARD_INSTALL_CONFIG
define SSHGUARD_INSTALL_INIT_SYSV
$(INSTALL) -D -m 755 package/sshguard/S49sshguard \
$(TARGET_DIR)/etc/init.d/S49sshguard
endef
define SSHGUARD_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 0644 $(@D)/examples/sshguard.service \
$(TARGET_DIR)/usr/lib/systemd/system/sshguard.service
$(SED) 's:/usr/local/sbin/sshguard:/usr/sbin/sshguard:g' \
$(TARGET_DIR)/usr/lib/systemd/system/sshguard.service
endef
$(eval $(autotools-package))