The @newuser line in PLIST shouldn't include the class. It's set
automatically by the rc.d subsystem.
(The reason it fails is because the class didn't exist until the
login.conf.d/telegraf file was created, which didn't happen until after the
new user was created - but there's no need to set the class for the user
account anyway).
--
Sent from a phone, apologies for poor formatting.
On 7 October 2022 03:52:01 Chris Narkiewicz <hello@ezaquarii.com> wrote:
> I'm installing telegraf on my server and I noticed that the pkg_add fails
> to install it:
>
> dev# uname -a
> OpenBSD dev 7.1 GENERIC#3 amd64
> dev# pkg_add telegraf
> quirks-5.5 signed on 2022-10-06T09:54:45Z
> useradd: No such login class `telegraf'
> system(/usr/sbin/useradd, -u, 826, -g, _telegraf, -L, telegraf, -c,
> telegraf user, -d, /var/empty, -s, /sbin/nologin, --, _telegraf) failed:
> exit(1)
> telegraf-1.22.1: ok
> The following new rcscripts were installed: /etc/rc.d/telegraf
> See rcctl(8) for details.
>
> I can see that login class is in /etc/login.conf.d/telegraf:
>
> dev# ls -la /etc/login.conf.d
> total 16
> drwxr-xr-x 2 root wheel 512 Oct 7 03:41 .
> drwxr-xr-x 36 root wheel 2048 Oct 7 03:42 ..
> -rw-r--r-- 1 root wheel 45 Jun 24 12:12 postgresql
> -rw-r--r-- 1 root wheel 40 Oct 7 03:41 telegraf
>
> When I copy-paste the useradd line printed by pkg_add, it creates the user.
> I suspect some sort of a race there.
>
> This issue happens on latest 7.2-current with latest pkg from snapshot.
>
> A bug in ports?
No comments:
Post a Comment