First of all I have to thank @dvl for dedicating some of his time to my issue (I was the guy who bothered on your blog comment session; I’ll try to be more precise there as this comment can became a tad long ![]()
I ask to your questione about what I meant with “librenms user shell”, I meant lauching the commands manually after executing a “su - librenms”
I will explain what I did before on a VM (to test the installation process on FreeBSD) and on the TN Jail
############################## ON VBOX #################################
I experimented at first with LibreNMS on a Vbox VM (Freebsd 13.3-RELEASE guest) and things (after a lot of time spent pulling my last hairs) went good (by that I mean the librenms service started fine).
That is the VM validate output:
===========================================
Component | Version
--------- | -------
LibreNMS | 24.12.0 (2024-12-18T00:55:13+01:00)
DB Schema | 2024_11_22_135845_alert_log_refactor_indexes (310)
PHP | 8.3.15
Python | 3.11.11
Database | MySQL 8.0.39
RRDTool | 1.9.0
SNMP | 5.9.4.pre2
===========================================
[OK] Installed from package; no Composer required
[OK] Database connection successful
[OK] Database connection successful
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK] Database and column collations are correct
[OK] Database schema correct
[OK] MySQL and PHP time match
[OK] Active pollers found
[OK] Dispatcher Service is enabled
[OK] Locks are functional
[OK] Python wrapper cron entry is not present
[OK] Redis is unavailable
[OK] rrdtool version ok
[OK] Connected to rrdcached
[FAIL] Scheduler is not running
[FIX]:
sudo sh -c 'sed "s#/opt/librenms#/usr/local/www/librenms#" /usr/local/www/librenms/dist/librenms-scheduler.cron > /etc/cron.d/librenms-scheduler.cron'
and if I issue a “ps auxww | grep librenms” :
librenms 22175 0.0 2.8 101568 58448 - I 14:57 0:01.16 php-fpm: pool librenms (php-fpm)
librenms 22244 0.0 2.8 99520 58088 - I 14:57 0:02.13 php-fpm: pool librenms (php-fpm)
librenms 22268 0.0 2.9 101568 59260 - I 14:57 0:02.53 php-fpm: pool librenms (php-fpm)
librenms 23147 0.0 0.1 12808 2348 - Ss 15:27 0:00.01 daemon: /usr/local/bin/python3.11[23148] (daemon)
librenms 23148 0.0 1.6 62996 33824 - S 15:27 0:00.99 /usr/local/bin/python3.11 /usr/local/www/librenms/librenms-service.py
root 23699 0.0 0.0 432 256 0 R+ 15:42 0:00.00 grep librenms
and “ps auxww | grep www” :
www 18092 0.0 1.7 75668 34420 - I 13:19 0:00.05 /usr/local/sbin/httpd -DNOHTTPACCEPT
www 18149 0.0 1.7 75668 34420 - I 13:19 0:00.04 /usr/local/sbin/httpd -DNOHTTPACCEPT
www 21992 0.0 1.7 75668 34420 - S 14:55 0:00.04 /usr/local/sbin/httpd -DNOHTTPACCEPT
www 22034 0.0 1.7 75668 34420 - I 14:55 0:00.03 /usr/local/sbin/httpd -DNOHTTPACCEPT
www 22035 0.0 1.7 75668 34420 - I 14:55 0:00.05 /usr/local/sbin/httpd -DNOHTTPACCEPT
www 22036 0.0 1.7 75668 34420 - I 14:55 0:00.04 /usr/local/sbin/httpd -DNOHTTPACCEPT
www 22355 0.0 1.7 75668 34420 - I 14:59 0:00.01 /usr/local/sbin/httpd -DNOHTTPACCEPT
www 22363 0.0 1.7 75668 34420 - I 14:59 0:00.01 /usr/local/sbin/httpd -DNOHTTPACCEPT
www 22382 0.0 1.7 75668 34420 - I 15:00 0:00.01 /usr/local/sbin/httpd -DNOHTTPACCEPT
www 22754 0.0 1.7 75668 34420 - I 15:14 0:00.00 /usr/local/sbin/httpd -DNOHTTPACCEPT
and “grep librenms /etc/rc.conf”:
librenms_enable="YES"
librenms_user="librenms"
librenms_group="librenms"
I have to say that there was some fiddlings with ACLs as per the docs https://docs.librenms.org/Installation/Install-LibreNMS/#set-permissions so let me describe what I think can be related :
“getfacl /var/run/librenms/”
# file: /var/run/librenms/
# owner: www
# group: www
group:www:rwxpDdaARWc--s:fd-----:allow
group:librenms:rwxpDdaARWc--s:fd-----:allow
owner@:rwxp--aARWcCos:-------:allow
group@:rwxp--a-R-c--s:-------:allow
everyone@:r-x---a-R-c--s:-------:allow
“getfacl /var/run/librenms/librenms.pid”
# file: /var/run/librenms/librenms.pid
# owner: librenms
# group: www
group:www:rwxpDdaARWc--s:------I:allow
group:librenms:rwxpDdaARWc--s:------I:allow
owner@:rw-p--aARWcCos:-------:allow
group@:------a-R-c--s:-------:allow
everyone@:------a-R-c--s:-------:allow
“getfacl /var/db/librenms/”
# file: /var/db/librenms/
# owner: www
# group: www
group:librenms:rwxpDdaARWc--s:fd-----:allow
owner@:rwxp--aARWcCos:-------:allow
group@:rwxp--a-R-c--s:-------:allow
everyone@:r-x---a-R-c--s:-------:allow
getfacl /usr/local/www/librenms/storage/
"# file: /usr/local/www/librenms/storage/"
# owner: www
# group: www
group:www:rwxpDdaARWc--s:fd-----:allow
group:librenms:rwxpDdaARWc--s:fd-----:allow
owner@:rwxp--aARWcCos:-------:allow
group@:rwxp--a-R-c--s:-------:allow
everyone@:r-x---a-R-c--s:-------:allow
“getfacl /usr/local/www/librenms/bootstrap/cache/”
# file: /usr/local/www/librenms/bootstrap/cache/
# owner: librenms
# group: librenms
group:www:rwxpDdaARWc--s:fd-----:allow
owner@:rwxp--aARWcCos:-------:allow
group@:rwxp--a-R-c--s:-------:allow
everyone@:r-x---a-R-c--s:-------:allow
with this settings the librenms service says it’s running and the /var/run/librenms/librenms.pid file it’s created and contains the PID of the process.
############################## ON TRUENAS ###################################
Then (given the success) I started working in a Jail (basejail) on a Truenas 13.3-RELEASE host , in the meantime I edited freebsd.conf to use “latest” train and now that’s my validate.php output:
===========================================
Component | Version
--------- | -------
LibreNMS | 25.1.0 (2025-01-17T06:28:40+01:00)
DB Schema | 2024_11_22_135845_alert_log_refactor_indexes (310)
PHP | 8.3.16
Python | 3.11.11
Database | MySQL 8.0.39
RRDTool | 1.9.0
SNMP | 5.9.4.pre2
===========================================
[OK] Installed from package; no Composer required
[OK] Database connection successful
[OK] Database connection successful
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK] Database and column collations are correct
[OK] Database schema correct
[OK] MySQL and PHP time match
[OK] Active pollers found
[OK] Dispatcher Service is enabled
[OK] Locks are functional
[OK] Python wrapper cron entry is not present
[OK] Redis is unavailable
[OK] rrd_dir is writable
[OK] rrdtool version ok
and “grep librenms /etc/rc.conf”:
librenms_enable="YES"
librenms_user="librenms"
librenms_group="librenms"
and if I issue a “ps auxww | grep librenms” :
librenms 57024 0.0 0.2 93640 57968 - IJ 13:41 0:00.86 php-fpm: pool librenms (php-fpm)
librenms 57059 0.0 0.2 87496 51804 - IJ 13:41 0:00.31 php-fpm: pool librenms (php-fpm)
librenms 61104 0.0 0.1 81352 45368 - IJ 15:33 0:00.14 php-fpm: pool librenms (php-fpm)
librenms 56424 0.0 0.1 120824 40360 23- SJ 13:35 0:05.73 /usr/local/bin/python3.11 /usr/local/www/librenms/librenms-service.py
and “ps auxww | grep www” :
www 55333 0.0 0.1 66776 32836 - IJ 13:09 0:00.01 /usr/local/sbin/httpd -DNOHTTPACCEPT
www 55334 0.0 0.1 66776 32836 - IJ 13:09 0:00.02 /usr/local/sbin/httpd -DNOHTTPACCEPT
www 55335 0.0 0.1 69848 32860 - IJ 13:09 0:00.01 /usr/local/sbin/httpd -DNOHTTPACCEPT
www 55336 0.0 0.1 69848 32860 - IJ 13:09 0:00.01 /usr/local/sbin/httpd -DNOHTTPACCEPT
www 55337 0.0 0.1 66776 32832 - IJ 13:09 0:00.02 /usr/local/sbin/httpd -DNOHTTPACCEPT
www 55953 0.0 0.1 69848 32860 - IJ 13:24 0:00.01 /usr/local/sbin/httpd -DNOHTTPACCEPT
www 55954 0.0 0.1 66776 32836 - IJ 13:24 0:00.01 /usr/local/sbin/httpd -DNOHTTPACCEPT
www 56839 0.0 0.1 69848 32832 - IJ 13:38 0:00.01 /usr/local/sbin/httpd -DNOHTTPACCEPT
www 56957 0.0 0.1 66776 32784 - SJ 13:41 0:00.01 /usr/local/sbin/httpd -DNOHTTPACCEPT
www 57052 0.0 0.1 66776 32804 - IJ 13:41 0:00.00 /usr/local/sbin/httpd -DNOHTTPACCEPT
“getfacl /var/run/librenms/”:
# file: /var/run/librenms/
# owner: www
# group: www
group:www:rwxpDdaARWc--s:fd-----:allow
group:librenms:rwxpDdaARWc--s:fd-----:allow
owner@:rwxp--aARWcCos:-------:allow
group@:rwxp--a-R-c--s:-------:allow
everyone@:r-x---a-R-c--s:-------:allow
“getfacl /var/run/librenms/librenms.pid”
# file: /var/run/librenms/librenms.pid
# owner: librenms
# group: librenms
group:www:rwxpDdaARWc--s:-------:allow
group:librenms:rwxpDdaARWc--s:-------:allow
owner@:rw-p--aARWcCos:-------:allow
group@:------a-R-c--s:-------:allow
everyone@:------a-R-c--s:-------:allow
“getfacl /var/db/librenms/”
# file: /var/db/librenms/
# owner: www
# group: www
group:librenms:rwxpDdaARWc--s:fd-----:allow
owner@:rwxp--aARWcCos:-------:allow
group@:rwxp--a-R-c--s:-------:allow
everyone@:r-x---a-R-c--s:-------:allow
getfacl /usr/local/www/librenms/storage/
# file: /usr/local/www/librenms/storage/
# owner: www
# group: www
group:librenms:rwxpDdaARWc--s:fd-----:allow
owner@:rwxp--aARWcCos:-------:allow
group@:rwxp--a-R-c--s:-------:allow
everyone@:r-x---a-R-c--s:-------:allow
“getfacl /usr/local/www/librenms/bootstrap/cache/”
# file: /usr/local/www/librenms/bootstrap/cache/
# owner: librenms
# group: librenms
group:librenms:rwxpDdaARWc--s:fd-----:allow
owner@:rwxp--aARWcCos:-------:allow
group@:rwxp--a-R-c--s:-------:allow
everyone@:r-x---a-R-c--s:-------:allow
Even upgrading to latest port (25.1.0) doesn’t change the outcome: pidfile created but empty…
At the end that is how I managed to have the librenms-service (dispatcher) running:
after getting in the librenms shell (su - librenms) I gave the command
nohup /usr/local/bin/python3.11 /usr/local/www/librenms/librenms-service.py &
and called it a day but that workaround makes me cringe… ![]()
Hope it makes sense and someone in this community will be able to nudge me in the right path, in case you need other details let me know.
I really cannot grasp why if I launch the librenms-service.py “by hand” it works and it doesn’t work if I use the service command (daemon could be bad behaving?!) instead
Regards