Bug 246822 - security/wazuh-agent: port doesn't have rc script for starting agent
Summary: security/wazuh-agent: port doesn't have rc script for starting agent
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-28 21:33 UTC by Felipe Zipitria
Modified: 2020-07-30 16:16 UTC (History)
1 user (show)

See Also:
m.muenz: maintainer-feedback+


Attachments
wazuh-agent-rc-script.patch (1.83 KB, patch)
2020-05-28 21:33 UTC, Felipe Zipitria
no flags Details | Diff
wazuh-agent-rc-script.patch (2.42 KB, patch)
2020-05-29 14:27 UTC, Felipe Zipitria
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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