On 12/05/2022 18:38, Zé Loff wrote:
On Thu, May 12, 2022 at 05:51:34PM +0200, Carlos López Martínez wrote:


On 12/05/2022 17:40, Zé Loff wrote:

On Thu, May 12, 2022 at 03:40:36PM +0200, Carlos López Martínez wrote:
Hi all,

Does telegraf package works under OpenBSD 7.1? I have installed from package
binaries and returns the following error:

+ daemon=/usr/local/bin/telegraf
+ daemon_logger=daemon.info
+ daemon_user=_telegraf
+ . /etc/rc.d/rc.subr
+ _rc_actions=start stop restart reload check
+ readonly _rc_actions
+ [ -n  ]
+ _name=telegraf
+ _rc_check_name telegraf
+ [ -n @(#)PD KSH v5.2.14 99/07/13.2 ]
+ [ -n /usr/local/bin/telegraf ]
+ unset _RC_DEBUG _RC_FORCE
+ getopts df c
+ shift 0
+ _RC_RUNDIR=/var/run/rc.d
+ _RC_RUNFILE=/var/run/rc.d/telegraf
+ _rc_do _rc_parse_conf
+ rc_reload_signal=HUP
+ rc_stop_signal=TERM
+ eval _rcflags=${telegraf_flags}
+ _rcflags=
+ eval _rclogger=${telegraf_logger}
+ _rclogger=
+ eval _rcrtable=${telegraf_rtable}
+ _rcrtable=
+ eval _rctimeout=${telegraf_timeout}
+ _rctimeout=
+ eval _rcuser=${telegraf_user}
+ _rcuser=
+ getcap -f /etc/login.conf.d/telegraf:/etc/login.conf telegraf
+ > /dev/null
+ 2>&1
+ daemon_class=telegraf
+ [ -z  ]
+ daemon_rtable=0
+ [ -z  ]
+ daemon_timeout=30
+ [ -z _telegraf ]
+ [ -n  -o start != start ]
+ [ -n  ]
+ [ -n  ]
+ [ -n  ]
+ [ -n  ]
+ [ -n  ]
+ [ -n  ]
+ readonly daemon_class
+ unset _rcflags _rclogger _rcrtable _rctimeout _rcuser
+ eval echo /usr/local/bin/telegraf
+ echo /usr/local/bin/telegraf
+ pexp=/usr/local/bin/telegraf
+ rcexec=su -fl -c telegraf -s /bin/sh _telegraf -c
+ id -R
+ [ 0 -eq 0 ]
+ rc_bg=YES
+ rc_reload=NO
+ rc_cmd start
telegraf(failed)

   Trying to execute as root from shell:

root@obsdnode01:/etc/login.conf.d# telegraf -h
2022/05/12 13:39:49 mmap: cannot allocate memory

   Any idea?
--
Best regards,
C. L. Martinez


I'm running telegraf on several amd64 7.1 (both -stable and recent-ish
-current) machines.  I also get the mmap error when running by hand,
but it works fine with the default rc script:

      $ cat /etc/rc.d/telegraf
      #!/bin/ksh

      daemon="/usr/local/bin/telegraf"
      daemon_logger="daemon.info"
      daemon_user="_telegraf"

      . /etc/rc.d/rc.subr

      rc_bg=YES
      rc_reload=NO

      rc_cmd $1

Cheers
Zé

Uhmm ... In my case, it fails using rc script also ... and it is the same as
yours ...

/etc/login.conf.d/telegraf sets the datasize at 8G.  You might not have
as much.

In my case, it fails as a regular user -- because they aren't allowed to
allocate that much -- but works using the rc script because in that case
the daemon is ran as _telegraf, which has its own login class, with the
appropriate values.



I have tried using a simple configuration without configuring inputs, only outputs, and it doesn't work either (neither manually nor by rc script).

At this point I have no idea why it fails. I have other virtual machines with FreeBSD with 1 GB of ram allocated with multiple configured inputs and it works without problems....

--
Best regards,
C. L. Martinez

Reply via email to