summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoktornotor <notordoktor@gmail.com>2015-09-27 18:39:32 +0200
committerdoktornotor <notordoktor@gmail.com>2015-09-27 18:39:32 +0200
commitce7edffff26e91ec9ccbb532ac023bccaff74b83 (patch)
tree809a77825a49500a1eb7cb4a1142378a5daeb0b1
parentacce84046a0cf038620500cf0890f01542d28e9b (diff)
downloadpfsense-ce7edffff26e91ec9ccbb532ac023bccaff74b83.zip
pfsense-ce7edffff26e91ec9ccbb532ac023bccaff74b83.tar.gz
Remove syslog.conf entries on package uninstall (Bug #5210)
The remove_text_from_file() is not needed at all. However, system_syslogd_start() must be run after the package entries are gone from config.xml, otherwise system_syslogd_start() just re-adds the (now almost removed) package logging configuration from there.
-rw-r--r--src/etc/inc/pkg-utils.inc11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/etc/inc/pkg-utils.inc b/src/etc/inc/pkg-utils.inc
index d4a1ec4..90d2e63 100644
--- a/src/etc/inc/pkg-utils.inc
+++ b/src/etc/inc/pkg-utils.inc
@@ -863,14 +863,14 @@ function delete_package_xml($package_name, $when = "post-deinstall") {
}
}
/* syslog */
+ $need_syslog_restart = false;
if (is_array($pkg_info['logging']) && $pkg_info['logging']['logfilename'] <> "") {
$static_output .= "Syslog entries... ";
update_output_window($static_output);
- remove_text_from_file("/etc/syslog.conf", $pkg_info['logging']['facilityname'] . "\t\t\t\t" . $pkg_info['logging']['logfilename']);
- system_syslogd_start();
@unlink("{$g['varlog_path']}/{$pkg_info['logging']['logfilename']}");
$static_output .= "done.\n";
update_output_window($static_output);
+ $need_syslog_restart = true;
}
/* remove config.xml entries */
@@ -880,6 +880,13 @@ function delete_package_xml($package_name, $when = "post-deinstall") {
$static_output .= gettext("done.") . "\n";
update_output_window($static_output);
write_config("Removed {$package_name} package.\n");
+
+ /* remove package entry from /etc/syslog.conf if needed */
+ /* this must to be done after removing the entries from config.xml */
+ if ($need_syslog_restart) {
+ system_syslogd_start();
+ }
+
conf_mount_ro();
}
OpenPOWER on IntegriCloud