Skip to content

Commit 2996d04

Browse files
committed
Add systemd service config files
1 parent de4a186 commit 2996d04

File tree

4 files changed

+23
-14
lines changed

4 files changed

+23
-14
lines changed

config/auth-monitor

Lines changed: 0 additions & 14 deletions
This file was deleted.

etc/default/auth-monitor

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# The maximum number of failed authentication attempts before the system shutdown.
2+
# Default: 5
3+
MAX_FAILED_ATTEMPTS=5
4+
5+
# The authentication failure counter will reset after the specified seconds.
6+
# Default: 1800
7+
RESET_AFTER_SECONDS=1800
8+
9+
# The path to the file were authentication logs are stored.
10+
# Default: /var/log/auth.log
11+
LOG_FILE=/var/log/auth.log

etc/sudoers.d/auth-monitor

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
auth-monitor ALL=NOPASSWD: /usr/bin/systemctl poweroff
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[Unit]
2+
Description=AuthMonitor
3+
4+
[Service]
5+
EnvironmentFile=/etc/default/auth-monitor
6+
ExecStart=/usr/local/bin/auth-monitor ${LOG_FILE} --max-failed-attempts=${MAX_FAILED_ATTEMPTS} --reset-after-seconds=${RESET_AFTER_SECONDS}
7+
Restart=always
8+
User=auth-monitor
9+
10+
[Install]
11+
WantedBy=multi-user.target

0 commit comments

Comments
 (0)