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.
Asked
Active
Viewed 3,851 times
1 Answers
3
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
Leo Philip Wu
- 31
- 2
-
2Aren't local unit files supposed to go in `/etc` somewhere? – womble Aug 29 '18 at 06:01
-
3One should not create this file under `/usr/lib...`. User provided service files, as well as service.d's belong to `/etc/systemd/system` – Markus W Mahlberg Aug 29 '18 at 06:05