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.

1 Answer 1

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
2
  • 2
    Aren't local unit files supposed to go in /etc somewhere?
    – womble
    Commented Aug 29, 2018 at 6:01
  • 3
    One 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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .