Closed thorhop closed 9 years ago
Hmm, the tricky thing is some distributions put sysctl in /sbin but don't put that on the PATH for normal users (even though it works fine for them...)
I guess we want to either run sysctl from the path or fall back to /sbin/sysctl. meh :).
so an if statement then... something like...
var SYSCTLCMD
if [ -f /sbin/sysctl ];
then
SYSCTLCMD="/sbin/sysctl"
else
SYSCTLCMD="sysctl"
fi
my $swappiness = `${SYSCTLCMD} vm.swappiness`
Hey there!
In SwappinessCheck.pm the command sysctl is called using an absolute path.
Please consider not using an absolute path.
The reason being is that I'm using NixOS which doesn't place any of it's applications in /bin, /sbin, /usr/sbin, /usr/bin, /usr/share, etc. It gives each package it's own folder with their own /bin, /usr, /local, /etc structure and applications are either patched or binaries have their ELF RPATH modified to know where to look for applications and libraries. So looking for sysctl in /sbin will not work, as it's probably in /nix/store/loooonghash-packageName/ I don't know anything about perl and it might be better for it to have an absolute path for other systems to be compatible. We can certainly patch this in the packaging. But if it's not much of an inconvenience please consider changing it :)
Cheers :+1: