I am running CentOS7 with OSSEC 2.9.2. Is there a way to make OSSEC automatically start the server after a reboot? Currently it appears to require that I run the ossec-control start after every reboot.
1 Answer
To run OSSEC as a service create a new file /usr/lib/system/system/ossec.service
[Unit]
Description=OSSEC service
[Service]
Type=forking
ExecStart=/var/ossec/bin/ossec-control start
ExecStop=/var/ossec/bin/ossec-control stop
[Install]
WantedBy=multi-user.target
Reload systemd
systemctl daemon-reload
To boot on start up
systemctl enable ossec
To start ossec as a service
service ossec start
service ossec stop
-
2
-
3One should not create this file under
/usr/lib...
. User provided service files, as well as service.d's belong to/etc/systemd/system
Commented Aug 29, 2018 at 6:05