Skip to content

Commit

Permalink
Adds ossec.service file for the agent
Browse files Browse the repository at this point in the history
OSSEC server and agent requires two different service files.
Details at https://kushaldas.in/posts/story-of-debugging-exit-0.html
  • Loading branch information
kushaldas committed Dec 7, 2020
1 parent 90946e8 commit 35ab7a6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=OSSEC service for agent

[Service]
Type=forking
ExecStart=/var/ossec/bin/ossec-control start
ExecStop=/var/ossec/bin/ossec-control stop
RemainAfterExit=True
SuccessExitStatus=1

[Install]
WantedBy=multi-user.target
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,20 @@
- ansible_host.find("-sd-generic-ossec") != -1
- ansible_distribution_release == "focal"

- name: Copy our systemd based service file
- name: Copy our systemd based service file for ossec-server
copy:
src: ossec.service
dest: "{{ ossec_build_dir }}/etc/systemd/system/ossec.service"
when:
- ansible_host.find("-sd-generic-ossec") != -1
- ansible_host.endswith("-sd-generic-ossec-server")
- ansible_distribution_release == "focal"

- name: Copy our systemd based service file for ossec-agent
copy:
src: ossec-agent.service
dest: "{{ ossec_build_dir }}/etc/systemd/system/ossec.service"
when:
- ansible_host.endswith("-sd-generic-ossec-agent")
- ansible_distribution_release == "focal"

- name: Build SecureDrop OSSEC deb package.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@
when: not install_local_packages
tags:
- apt

- name: Enable the OSSEC service
systemd:
name: ossec
daemon_reload: yes
enabled: yes
masked: no

0 comments on commit 35ab7a6

Please sign in to comment.