2

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.

JadedCore
  • 121
  • 1
  • 6

1 Answers1

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