Package Details: librenms 1.37-3

Git Clone URL: https://aur.archlinux.org/librenms.git (read-only)
Package Base: librenms
Description: Autodiscovering PHP/MySQL-based network monitoring system.
Upstream URL: https://www.librenms.org/
Licenses: GPL3
Submitter: freaknils
Maintainer: Anthony25
Last Packager: Anthony25
Votes: 3
Popularity: 0.137046
First Submitted: 2015-12-14 12:03
Last Updated: 2018-03-09 23:28

Latest Comments

HeyCitizen commented on 2018-04-26 15:45

this PKGBUILD tries to install a package named php-mcrypt which does not exist, rather than selecting an existing package that provides 'php-mcrypt'

dvzrv commented on 2018-03-10 01:18

@Anthony25:

ln -sf /var/log/${pkgname} logs

should be in package() (not install(), sorry):

ln -sf "/var/log/${pkgname}" "${pkgdir}/usr/share/webapps/${pkgname}/logs"

Plus, you can add yourself as maintainer! ;-)

Anthony25 commented on 2018-03-09 23:29

@dvzrv: Thanks for the review.

I tried to fix it as much as I could. I just don't see what you mean by Do that in install() and use ${pkgdir}!.

dvzrv commented on 2018-03-05 11:53

@Anthony25: You're welcome. That's what I'm here for ;-) Sometimes it's easier to just start from scratch.

However, there are still some things to fix:

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=librenms#n8

Should be GPL3 (pacman -Ql licenses).

You can switch to https for url.

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=librenms#n11

source has to be unique ("${pkgname}-${pkgver}.tar.gz::<https://github.com/>${pkgname}/${pkgname}/archive/${pkgver}.tar.gz")

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=librenms#n33

Do that in install() and use ${pkgdir}!

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=librenms#n37

You can just install them in one go: install -d "$pkgdir"/{etc/{webapps/$pkgname,logrotate.d},usr/share/webapps/$pkgname,var/log/$pkgname} and fix the permissions using tmpfiles.d. Also, 775 is probably too permissive for the logs of such an application.

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=librenms#n42

All PKGBUILD functions are in ${srcdir} initially. No need to use it again. Still, cd should be the first thing to do, unless you have weird sources.

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=librenms#n45

If you are symlinking this file later on anyways, but it's just the default (an example file, I suppose?), why not just leave it there, or is the user supposed to modify this file? Also, use install -Dm644 instead of cp.

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=librenms#n56

A cleaner way would be to install this as a separate file.

P.S.: You got tab-poisening ;-)

https://aur.archlinux.org/cgit/aur.git/tree/librenms.sysusers?h=librenms#n3

I think it's not a good choice to set /usr/share/webapps/librenms as the user's $HOME. Leaving it empty is a better choice. https://www.freedesktop.org/software/systemd/man/sysusers.d.html#Home%20Directory

https://aur.archlinux.org/cgit/aur.git/tree/librenms.tmpfile?h=librenms#n2

Is that really needed? Does the application or the webserver need to modify files on your filesystem, apart from the logs? If not, don't use this!

Sorry for the many edits of this post. The new Markdown support still bugs me ;-)

Anthony25 commented on 2018-03-05 00:06

@dvzrv: thanks a lot for your review.

For my defense, all comments you've made were about something I've not written, but it is not an excuse as I did not change them.

I began to fix a lot of the issues your pointed, only the pear packages are still badly installed at the pkg installation. When I will find some time to create the 2 AUR packages needed for those, I will be able to add them as dependencies and remove the usage of pear. However, if anyone has some free time to create those packages, tell me and I will handle the changes on the librenms side as soon as possible.

dvzrv commented on 2018-03-04 17:31

"I changed the versioning system, so please force the package installation to upgrade."

@Anthony25: That's where you usually introduce an epoch: https://wiki.archlinux.org/index.php/PKGBUILD#epoch

Please re-read the Arch packaging standards: https://wiki.archlinux.org/index.php/Arch_packaging_standards

dvzrv commented on 2018-03-04 17:27

@Anthony25: Please use sysusers.d (man sysusers.d) and tmpfiles.d (man tmpfiles.d) to setup the dedicated user and set file permissions. The install file is not needed at all.

Also, please, never do something like this: https://aur.archlinux.org/cgit/aur.git/tree/librenms.install?h=librenms#n11 You thereby introduce files to the filesystem, that are not owned by any package! This is bad! If those packages are dependencies to this package, you have to provide them!

If you have to do modifications to the source before you use install(), put those actions to prepare() (e.g. the use of sed). Sometimes (depending on the project really) one will have to make sure, that files are 0644 and folders are 0755.

If you symlink, copy, move or install during install(), you have to use $pkgdir as destination! Please fix this!

Anthony25 commented on 2018-02-18 15:26

I updated the package. It now copies the logrotate config file in /etc/logrotate.d and correctly symlinks the logs dir to /var/logs/librenms.

I quickly tested it, but please report any bug you might find.

Anthony25 commented on 2018-02-11 01:32

@TheAmigo: thanks a lot, I will update the package as soon as I can.

FYI, I don't use it anymore, I moved to kubernetes for a lot of self-hosting tools. I will continue to maintain it, but I think it would be better to be maintained by someone also using it. If someone would like to be the new maintainer, contact me.

TheAmigo commented on 2018-02-11 01:25

It looks like the logs are pointed at /var/log/librenms (seems decent), but the link in /usr/share/webapps/librenms/logs is broken.

Also, the logrotate snippet (/usr/share/webapps/librenms/misc/librenms.logrotate) should be updated to point to the actual log directory, or even better, copied directly into /etc/logrotate.d/

All comments