Obecnie chcę, aby usługa auditd uruchomiona była na zawsze, a użytkownik nie może tego zatrzymać za pomocą żadnych poleceń.Zapobieganie zatrzymaniu usługi auditd w Redhat 7
Bieżąca obsługa moja auditd:
~]# systemctl cat auditd
# /usr/lib/systemd/system/auditd.service
[Unit]
Description=Security Auditing Service
DefaultDependencies=no
After=local-fs.target systemd-tmpfiles-setup.service
Conflicts=shutdown.target
Before=sysinit.target shutdown.target
RefuseManualStop=yes
ConditionKernelCommandLine=!audit=0
[Service]
ExecStart=/sbin/auditd -n
## To not use augenrules, copy this file to /etc/systemd/system/auditd.service
## and comment/delete the next line and uncomment the auditctl line.
## NOTE: augenrules expect any rules to be added to /etc/audit/rules.d/
ExecStartPost=-/sbin/augenrules --load
#ExecStartPost=-/sbin/auditctl -R /etc/audit/audit.rules
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target
# /etc/systemd/system/auditd.service.d/override.conf
[Service]
ExecReload=
ExecReload=/bin/kill -HUP $MAINPID ; /sbin/augenrules --load
Nie mogę zatrzymać tę usługę z poleceniem:
# systemctl stop auditd.service
Failed to stop auditd.service: Operation refused, unit auditd.service may be requested by dependency only.
Ale kiedy przy użyciu polecenia service auditd stop
. Mogę normalnie zatrzymać tę usługę.
# service auditd stop
Stopping logging: [ OK ]
Jak mogę temu zapobiec? Dzięki
Powinieneś dołączyć wyjście "systemctl cat auditd" – Siosm
Dodałem wynik tego polecenia. –