Skip to content

Commit 9574d1e

Browse files
committed
feat: updated systemd.service file
Better systemd support for packagers Signed-off-by: Konstantin Shalygin <[email protected]>
1 parent e4adfbc commit 9574d1e

File tree

1 file changed

+25
-10
lines changed

1 file changed

+25
-10
lines changed

systemd/smartctl_exporter.service

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,34 @@
11
[Unit]
2-
Description=smartctl exporter service
3-
After=network-online.target
2+
Description=Prometheus exporter for S.M.A.R.T. metrics
3+
Requires=network-online.target
4+
After=network-online.target basic.target
5+
Wants=network-online.target
6+
StartLimitIntervalSec=30
7+
StartLimitBurst=3
48

59
[Service]
6-
Type=simple
7-
PIDFile=/run/smartctl_exporter.pid
8-
ExecStart=/usr/bin/smartctl_exporter
910
User=root
1011
Group=root
11-
SyslogIdentifier=smartctl_exporter
12+
EnvironmentFile=-/etc/conf.d/smartctl_exporter
13+
ExecStart=/usr/bin/smartctl_exporter $OPTIONS
1214
Restart=on-failure
13-
RemainAfterExit=no
14-
RestartSec=100ms
15-
StandardOutput=journal
16-
StandardError=journal
15+
RestartSec=30
16+
NoNewPrivileges=true
17+
PrivateTmp=true
18+
ProtectHome=true
19+
ProtectSystem=strict
20+
ProtectHostname=true
21+
ProtectControlGroups=true
22+
ProtectKernelModules=true
23+
ProtectKernelTunables=true
24+
ProtectKernelLogs=true
25+
LockPersonality=true
26+
RestrictRealtime=true
27+
RestrictNamespaces=true
28+
RestrictSUIDSGID=true
29+
MemoryDenyWriteExecute=true
30+
CapabilityBoundingSet=CAP_SYS_ADMIN CAP_SYS_RAWIO CAP_MKNOD
31+
AmbientCapabilities=
1732

1833
[Install]
1934
WantedBy=multi-user.target

0 commit comments

Comments
 (0)