From 33887417ee13fb08079574ce0cfa6565efa7cd8c Mon Sep 17 00:00:00 2001 From: costasd Date: Tue, 10 Jul 2018 22:41:24 +0200 Subject: [PATCH] discovery.php: don't exit(5) without new devices discovered (#8893) Don't exit with a non-zero value in case no new devices were discovered, as non-zero codes are considered failed jobs for most cron implementations and produce logs like the following (in Debian): ``` cron.info CRON[963890]: (CRON) error (grandchild #963892 failed with exit status 5) ``` DO NOT DELETE THIS TEXT #### Please note > Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting. - [X] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/) #### Testers If you would like to test this pull request then please run: `./scripts/github-apply `, i.e `./scripts/github-apply 5926` --- discovery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discovery.php b/discovery.php index 2b62fce380..6fb9f15703 100755 --- a/discovery.php +++ b/discovery.php @@ -153,7 +153,7 @@ if (!isset($options['q'])) { logfile($string); -if ($discovered_devices == 0) { +if ($doing !== 'new' && $discovered_devices == 0) { # No discoverable devices, either down or disabled exit(5); }