Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 07 Oct 2023 06:56:40 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 274194] sysutils/loki: New rc.d file for promtail
Message-ID:  <bug-274194-7788-YNLi3FycFx@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-274194-7788@https.bugs.freebsd.org/bugzilla/>
References:  <bug-274194-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D274194

--- Comment #4 from Eren T=C3=BCrkay <turkay.eren@gmail.com> ---
Created attachment 245475
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D245475&action=
=3Dedit
first attempt to add rc.d script for promtail

Hello,

The patch is ready and tested but I've came across a few issues. 2 of them =
are
port related (I used portfmt and portlint), and the last one is
configuration/daemon behavior.



SHA2 Mismatch (hashicorp-consul-v1.5.1_GH0.tar.gz)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
I got checksum error on this file. I do not think it should change but I ha=
d to
build the package with `NO_CHECKSUM=3Dyes` to proceed. When I manually down=
load
the file, the hash in `distinfo` does not match the one I download. Since I=
 do
not know what's going on with the hash, I did not include it in the patch.

```
$ wget
'https://codeload.github.com/hashicorp/consul/tar.gz/v1.5.1?dummy=3D/hashic=
orp-consul-v1.5.1_GH0.tar.gz'
-O hashicorp-consul-v1.5.1_GH0.tar.gz
$ sha256sum hashicorp-consul-v1.5.1_GH0.tar.gz
7d9a318ca5fe3c5f35adb950750e92dff45a67d5fe37d447f173b4f0f99c095f=20
hashicorp-consul-v1.5.1_GH0.tar.gz
```


Portlint Messages
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
I generated the patch using `make makepatch` but I still get a warning. I k=
now
portlint can give some false positives but I still wanted to let you know:


```
WARN: Makefile: possible use of absolute pathname "/seed".
WARN: Makefile: possible use of absolute pathname "/var/db/${PORTNAME}".
WARN: Makefile: possible use of absolute pathname "/var/db/promtail".
WARN:
/usr/home/ec2-user/ports/sysutils/loki/files/patch-cmd-loki-loki-local-conf=
ig.yaml:
patch was not generated using ``make makepatch''.  It is recommended to use
``make makepatch'' when you need to [re-]generate a patch to ensure proper
patch format.
WARN:
/usr/home/ec2-user/ports/sysutils/loki/files/patch-promtail-local-config.ya=
ml:
patch was not generated using ``make makepatch''.  It is recommended to use
``make makepatch'' when you need to [re-]generate a patch to ensure proper
patch format.
0 fatal errors and 5 warnings found.
```


Promtail Stop Behavior
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
This one is interesting. Since we include upstream default configuration an=
d I
do not have loki server installed, promtail has a long retry configuration.
Once it reads the file, it cannot find the loki server and starts retrying.
When you want to stop the daemon, you wait on `waiting for PIDs` message.

I waited for a couple of minutes at first, the daemon did not stop and I
interrupted it to stop it again. I thought it was a problem with the rc.d
script but it turns out it's related with retry configuration.

The defaults are described here:
https://grafana.com/docs/loki/latest/send-data/promtail/configuration/#clie=
nts

min_period: 500ms
max_period: 5m
max_retries: 10

This means you need to wait at least 5 minutes before promtail finishes
retries. I have confirmed it by lowering those values and seeing that
max_retries need to be reached before stopping the server. So, if for any
reason promtail cannot reach loki and retries, it should finish first. The =
sad
thing is that you do not see how many retries are left in the log file, you
just see `will retry` message and it can be confusing.

As someone worked on this package, I know this information but daemon stop
behavior can be hard to spot. Do you think it's appropriate to add a note
somewhere and refer to the official documentation?

Regards,
Eren

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-274194-7788-YNLi3FycFx>