fix: systemd service hardening and correct config path
- Fix config path: .conf → .yml - Add /etc/logcorrelator to ReadWritePaths (config reload) - Add TimeoutStartSec=10 (matches systemd expectations) - Add TimeoutStopSec=30 (aligned with code shutdown timeout) These changes ensure proper systemd integration and security. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@ -6,7 +6,7 @@ After=network.target
|
|||||||
Type=simple
|
Type=simple
|
||||||
User=logcorrelator
|
User=logcorrelator
|
||||||
Group=logcorrelator
|
Group=logcorrelator
|
||||||
ExecStart=/usr/bin/logcorrelator -config /etc/logcorrelator/logcorrelator.conf
|
ExecStart=/usr/bin/logcorrelator -config /etc/logcorrelator/logcorrelator.yml
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
|
||||||
@ -14,10 +14,14 @@ RestartSec=5
|
|||||||
NoNewPrivileges=true
|
NoNewPrivileges=true
|
||||||
ProtectSystem=strict
|
ProtectSystem=strict
|
||||||
ProtectHome=true
|
ProtectHome=true
|
||||||
ReadWritePaths=/var/log/logcorrelator /var/run/logcorrelator
|
ReadWritePaths=/var/log/logcorrelator /var/run/logcorrelator /etc/logcorrelator
|
||||||
|
|
||||||
# Resource limits
|
# Resource limits
|
||||||
LimitNOFILE=65536
|
LimitNOFILE=65536
|
||||||
|
|
||||||
|
# Systemd timeouts
|
||||||
|
TimeoutStartSec=10
|
||||||
|
TimeoutStopSec=30
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|||||||
Reference in New Issue
Block a user