From 7eea44079f4609e30ff0478f4d0c0ea34593f7cd Mon Sep 17 00:00:00 2001 From: Ermal Date: Tue, 17 May 2011 22:23:54 +0000 Subject: When uninstalling a service actually stop it first. --- etc/inc/pkg-utils.inc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'etc/inc/pkg-utils.inc') diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index 5c21428..d475a40 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -42,6 +42,7 @@ require_once("globals.inc"); require_once("xmlrpc.inc"); +require_once("service-utils.inc"); if(file_exists("/cf/conf/use_xmlreader")) require_once("xmlreader.inc"); else @@ -324,6 +325,8 @@ function uninstall_package($pkg_name) { } } + stop_service($pkg_name); + $id = get_pkg_id($pkg_name); if ($id >= 0) { $pkg_depends =& $config['installedpackages']['package'][$id]['depends_on_package']; -- cgit v1.1 From 941baf1e268f9e4483983a14c55de1b3cc20efea Mon Sep 17 00:00:00 2001 From: Ermal Date: Wed, 18 May 2011 22:49:07 +0000 Subject: When uninstalling packages try to remove even any rc files created by packages. --- etc/inc/pkg-utils.inc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'etc/inc/pkg-utils.inc') diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index d475a40..070dade 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -895,7 +895,7 @@ function delete_package($pkg) { } function delete_package_xml($pkg) { - global $g, $config, $static_output, $pkg_interface; + global $g, $config, $static_output, $pkg_interface, $rcfileprefix; conf_mount_rw(); @@ -967,6 +967,13 @@ function delete_package_xml($pkg) { if($instservice['name'] == $service['name']) { if($g['booting'] != true) stop_service($service['name']); + if($service['rcfile']) { + $prefix = $rcfileprefix; + if (!empty($service['prefix'])) + $prefix = $service['prefix']; + if (file_exists("{$prefix}{$service['rcfile']}")) + @unlink("{$prefix}{$service['rcfile']}"); + } unset($services[$key]); } } -- cgit v1.1