diff --git a/app/Checks.php b/app/Checks.php index d1af6fa5a7..7ebf79cc7c 100644 --- a/app/Checks.php +++ b/app/Checks.php @@ -31,8 +31,6 @@ use Auth; use Cache; use Carbon\Carbon; use LibreNMS\Config; -use LibreNMS\Exceptions\FilePermissionsException; -use Symfony\Component\HttpFoundation\Response as SymfonyResponse; use Toastr; class Checks @@ -122,6 +120,14 @@ class Checks public static function runningUser() { if (function_exists('posix_getpwuid') && posix_getpwuid(posix_geteuid())['name'] !== get_current_user()) { + if (get_current_user() == 'root') { + self::printMessage( + 'Error: lnms file is owned by root, it should be owned and ran by a non-privileged user.', + null, + true + ); + } + self::printMessage( 'Error: You must run lnms as the user ' . get_current_user(), null,