Create a dummy /etc/printcap when starting bsnmpd so it it will not log errors. Fixes #6838

This commit is contained in:
jim-p 2016-12-02 13:03:18 -05:00
parent bb6d61b102
commit 63b44eed9e

View File

@ -2300,6 +2300,11 @@ function services_snmpd_configure() {
echo gettext("Starting SNMP daemon... ");
}
/* Make sure a printcap file exists or else bsnmpd will log errors. See https://redmine.pfsense.org/issues/6838 */
if (!file_exists('/etc/printcap')) {
@file_put_contents('/etc/printcap', "# Empty file to prevent bsnmpd from logging errors.\n");
}
/* generate snmpd.conf */
$fd = fopen("{$g['varetc_path']}/snmpd.conf", "w");
if (!$fd) {