Bug 246822

Summary: security/wazuh-agent: port doesn't have rc script for starting agent
Product: Ports & Packages Reporter: Felipe Zipitria <fzipitria>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed FIXED    
Severity: Affects Many People CC: m.muenz
Priority: --- Flags: m.muenz: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
wazuh-agent-rc-script.patch
none
wazuh-agent-rc-script.patch none

Description Felipe Zipitria 2020-05-28 21:33:49 UTC
Created attachment 214993 [details]
wazuh-agent-rc-script.patch

Port does not have rc script for starting agent.

The patch attached provides it.
Comment 1 Michael Muenz 2020-05-29 05:12:09 UTC
Hi Felipe,

nice work, thank you! 

Two things:
: ${wazuh_agent_config:="/usr/local/etc/ossec-init.conf"}

The port installs an init config in /var/ossec/etc/ossec.conf, can you point to ths one, please?

Second:
start_cmd="${name}_start"
stop_cmd="${name}_stop"
status_cmd="${name}_status"

If you use the variable one could think when changing name everything is fine, but you function are not renamed if changing "name". I would just go for wazuh_agent_start etc. 

Opinions? 

Best,
Michael
Comment 2 Felipe Zipitria 2020-05-29 10:22:08 UTC
Hey Michael!

Regarding "wazuh_agent_config", after adding the traditional stuff, the configuration file is not used by the agent at all. Initially I saw the warning when starting, but I guess as it is not used it can just be removed.

Shall I remove of change it to the other name?

Fixing the name variable.
Comment 3 Michael Muenz 2020-05-29 12:15:50 UTC
Just remove it (ossec-control takes care of it) and adjust the variables :)
Comment 4 Felipe Zipitria 2020-05-29 14:27:36 UTC
Created attachment 215025 [details]
wazuh-agent-rc-script.patch

Added proposed changes.

Also added a documentation link after the package is installed.
Comment 5 Michael Muenz 2020-05-29 14:33:43 UTC
Looks good, thank you :)
Comment 6 Felipe Zipitria 2020-06-25 15:10:41 UTC
Is there something additional needed? I don't see it upstream (yet) to close this one.
Comment 7 commit-hook freebsd_committer freebsd_triage 2020-07-30 16:16:36 UTC
A commit references this bug:

Author: krion
Date: Thu Jul 30 16:16:03 UTC 2020
New revision: 543803
URL: https://svnweb.freebsd.org/changeset/ports/543803

Log:
  Add RC script

  PR:		246822
  Approved by:	maintainer

Changes:
  head/security/wazuh-agent/Makefile
  head/security/wazuh-agent/files/
  head/security/wazuh-agent/files/wazuh-agent.in
  head/security/wazuh-agent/pkg-message