Installing DTail on OpenBSD

Published at 2022-10-30T11:03:19+02:00

This will be a quick blog post, as I am busy with my personal life now. I have relocated to a different country and am still busy arranging things. So bear with me :-)

In this post, I want to give a quick overview (or how-to) about installing DTail on OpenBSD, as the official documentation only covers Red Hat and Fedora Linux! And this blog post will also be used as my reference!

https://dtail.dev

I am using Rexify for my OpenBSD automation. Check out the following article covering my Rex setup in a little bit more detail:

Let's Encrypt with OpenBSD and Rex

I will also mention some relevant `Rexfile` snippets in this post!

Table of Contents

Compile it

First of all, DTail needs to be downloaded and compiled. For that, `git`, `go`, and `gmake` are required:

I am happy that the Go Programming Language is readily available in the OpenBSD packaging system. Once the dependencies got installed, clone DTail and compile it:

You can verify the version by running the following command:

Now, there isn't any need anymore to keep `git`, `go` and `gmake`, so they can be deinstalled now:

One day I shall create an official OpenBSD port for DTail.

Install it

Installing the binaries is now just a matter of copying them to `/usr/local/bin` as follows:

Also, we will be creating the `_dserver` service user:

The OpenBSD init script is created from scratch (not part of the official DTail project). Run the following to install the bespoke script:

Rexification

This is the task for setting it up via Rex. Note the `. . . .`, that's a placeholder which we will fill up more and more during this blog post:

Configure it

Now, DTail is fully installed but still needs to be configured. Grab the default config file from GitHub ...

... and then edit it and adjust `LogDir` in the `Common` section to `/var/log/dserver`. The result will look like this:

Rexification

That's as simple as adding the following to the Rex task:

Update the key cache for it

DTail relies on SSH for secure authentication and communication. However, the system user `_dserver` has no permission to read the SSH public keys from the user's home directories, so the DTail server also checks for available public keys in an alternative path `/var/run/dserver/cache`.

The following script, populating the DTail server key cache, can be run periodically via `CRON`:

Note that the script above is a slight variation of the official DTail script. The official DTail one is a `bash` script, but on OpenBSD, there's `ksh`. I run it once daily by adding it to the `daily.local`:

Rexification

That's done by adding ...

... to the Rex task!

Start it

Now, it's time to enable and start the DTail server:

As we don't want to wait until tomorrow, let's populate the key cache manually:

Use it

The DTail server is now ready to serve connections. You can use any DTail commands, such as `dtail`, `dgrep`, `dmap`, `dcat`, `dtailhealth`, to do so. Checkout out all the usage examples on the official DTail page.

I have installed DTail server this way on my personal OpenBSD frontends `blowfish`, and `fishfinger`, and the following command connects as user `rex` to both machines and greps the file `/etc/fstab` for the string `local`:

Running it the second time, and given that you trusted the keys the first time, it won't prompt you for the host keys anymore:

Conclusions

It's a bit of manual work, but it's ok on this small scale! I shall invest time in creating an official OpenBSD port, though. That would render most of the manual steps obsolete, as outlined in this post!

Check out the following for more information:

https://dtail.dev

https://github.com/mimecast/dtail

https://www.rexify.org

E-Mail your comments to `paul@nospam.buetow.org` :-)

Other related posts are:

2023-09-25 DTail usage examples

2022-10-30 Installing DTail on OpenBSD (You are currently reading this)

2022-03-06 The release of DTail 4.0.0

2021-04-22 DTail - The distributed log tail program

Back to the main site

Proxied content from gemini://foo.zone/gemfeed/2022-10-30-installing-dtail-on-openbsd.gmi (external content)

Gemini request details:

Original URL
gemini://foo.zone/gemfeed/2022-10-30-installing-dtail-on-openbsd.gmi
Status code
Success
Meta
text/gemini;
Proxied by
kineto

Be advised that no attempt was made to verify the remote SSL certificate.