*brew:*

To have launchd start +elastic/tap/{beatname_lc}+ and then restart it at login,
run:

["source","sh",subs="attributes"]
-----
brew services start elastic/tap/{beatname_lc}-full
-----

ifndef::requires-sudo[]
To run {beatname_uc} in the foreground instead of running it as a background
service, run:

["source","sh",subs="attributes"]
-----
{beatname_lc} -e
-----
endif::[]

ifdef::requires-sudo[]
To run {beatname_uc} in the foreground instead of running it as a background
service, run:

ifndef::has_modules_command[]
["source","sh",subs="attributes"]
-----
sudo chown root /usr/local/etc/{beatname_lc}/{beatname_lc}.yml <1>
sudo {beatname_lc} -e
-----
<1> You'll be running {beatname_uc} as root, so you need to change ownership
of the configuration file, or run {beatname_uc} with `--strict.perms=false`
specified. See
{beats-ref}/config-file-permissions.html[Config File Ownership and Permissions].
endif::has_modules_command[]

ifdef::has_modules_command[]
["source","sh",subs="attributes,callouts"]
----------------------------------------------------------------------
sudo chown root /usr/local/etc/{beatname_lc}/{beatname_lc}.yml <1>
sudo chown root /usr/local/etc/{beatname_lc}/modules.d/system.yml <1>
sudo {beatname_lc} -e
----------------------------------------------------------------------
<1> You'll be running {beatname_uc} as root, so you need to change ownership of the
configuration file and any configurations enabled in the `modules.d` directory,
or run {beatname_uc} with `--strict.perms=false` specified. See
{beats-ref}/config-file-permissions.html[Config File Ownership and Permissions].

endif::has_modules_command[]

endif::requires-sudo[]
