Created attachment 214007 [details] librenms.diff This is a raw but working WIP for the port. I have not yet run time tested this on my setup. Also use ${WWWOWN} and ${WWWGRP} where applicable (these are defined variables in the ports framework) instead of using an in between variable.
I don't have time to read the PR/diff today. Does this twitter thread sound like you're doing what I'm saying? https://twitter.com/DLangille/status/1253324274447773707
Ah yes, that's exactly what I was trying to add! I didn't see your Tweet before you linked it just now, woops. Hopefully you havent started working on it yet.
(In reply to Dries Michiels from comment #2) I have not worked on this at all. My goal was to get rid of Python 2.7
I think we should enable logging: [dan@besser:~] $ echo /usr/local/bin/python3.7 /usr/local/www/librenms/librenms-service.py -m | sudo su -fm www MainThread(ERROR):Could not import .env - check that the poller user can read the file, and that composer install has been run recently Traceback (most recent call last): File "/usr/local/www/librenms/LibreNMS/service.py", line 166, in _get_config_data raise ImportError(".env does not contain a valid NODE_ID setting.") ImportError: .env does not contain a valid NODE_ID setting. [dan@besser:~] $
The dispatcher is running. I'll leave it overnight.
Node id is created via: $ php ~/tmp/uniqueid.php 5eacd76c3281a[dan@empty:~/librenms] $ where: $ cat ~/tmp/uniqueid.php <?php echo uniqid();
Created attachment 214022 [details] librenms.diff Thanks for taking such a quick look at this! This patch rebases on top of 1.63, and enables syslog logging with -S (now /var/log/daemon.log captures the output of this service). Given the Tweet of LibreNMS regard python2.7 I guess this is a viable way forward to just remove python2.7 support. https://twitter.com/LibreNMS/status/1256209304727715840 ATM I implemented them side by side to ease the user experience. Although if you OK, I can just remove the PYPOLLER option and incorporate the PYSERVICE dependencies right in the port as hard deps (no option as this will be the only and default method of polling with python2.7 removed). The unique node ID is that only to be generated once when the service is started? Maybe we can add that as a function in the RC script. Or add an extra note in pkg-message. Thanks for your direction in this!
(In reply to Dries Michiels from comment #7) > This patch rebases on top of 1.63, and enables syslog logging with -S (now > /var/log/daemon.log captures the output of this service). That file isn't on my system. /etc/syslog.conf does not have an entry for that file. Does your system have this configured?
Ah yes, its only default in FreeBSD 13 I see. https://svnweb.freebsd.org/base?view=revision&revision=352460
I created https://reviews.freebsd.org/D24671 with my latest changes
(In reply to Dan Langille from comment #10) I think the new instructions in files/pkg-message.in need to be rearranged into a logical order.
I'm using this: command_args="-S -o /var/log/$name/$name.log -p $pidfile $procname /usr/local/www/librenms/librenms-service.py -m" which requires this first: sudo touch /var/log/librenms/librenms.log sudo chown www /var/log/librenms/librenms.log
Yeah thats fine, although I would opt to go for only the file log mechanism then (only -o, not combined with -S). Given that the port already logs other librenms stuff to that same logfile. We should probably make it configurable in the rc script too. Otherwise it will be logging double.
That makes me think we should log the service to librenms-service.log instead
I have: * updated the rc.d script to remove -S and log to a new filename * adding an entry to UPDATING * pre-created the log file because daemon creates it with UID root * amended pkg-message and it now includes an install and a update message Details at https://reviews.freebsd.org/D24671
A commit references this bug: Author: dvl Date: Sun May 3 19:31:29 UTC 2020 New revision: 533804 URL: https://svnweb.freebsd.org/changeset/ports/533804 Log: Add support for polling as a service Two new options * PYPOLLER - default, deprecated, needs Python 2.7 * PYSERVICE - Dispatcher service, recompile required HEADS UP HEADS UP Polling via cron job is now deprecated. Please use the Dispatcher. LibreNMS will be dropping support for PHP 7.1 and Python 2 in the next release expected May 31 2020. see https://community.librenms.org/t/dropping-support-for-php-7-1-and-python-2/11851 Your existing crontab entries for the PYPOLLER option will be going away. You can migrate to the PYSERVICE option of LibreNMS now. PR: 246105 Submitted by: Dries Michiels <driesm.michiels@gmail.com> Changes: head/UPDATING head/net-mgmt/librenms/Makefile head/net-mgmt/librenms/files/librenms.in head/net-mgmt/librenms/files/pkg-message.in
Committed. Thank you.