summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/etc/inc/service-utils.inc5
-rwxr-xr-xsrc/etc/rc.start_packages2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/etc/inc/service-utils.inc b/src/etc/inc/service-utils.inc
index b525faa..3a46ce2 100644
--- a/src/etc/inc/service-utils.inc
+++ b/src/etc/inc/service-utils.inc
@@ -84,6 +84,11 @@ function start_service($name) {
if (is_array($config['installedpackages']) && is_array($config['installedpackages']['service'])) {
foreach ($config['installedpackages']['service'] as $service) {
if (strtolower($service['name']) == strtolower($name)) {
+ /* Avoid starting twice if this is called just after a
+ * package sync which starts the service itself. */
+ if ($after_sync && isset($service['starts_on_sync'])) {
+ break;
+ }
if ($service['rcfile']) {
$prefix = RCFILEPREFIX;
if (!empty($service['prefix'])) {
diff --git a/src/etc/rc.start_packages b/src/etc/rc.start_packages
index 2b06080..bbe6006 100755
--- a/src/etc/rc.start_packages
+++ b/src/etc/rc.start_packages
@@ -58,7 +58,7 @@ if (is_array($config['installedpackages']['package'])) {
echo " Starting package {$package['name']}...";
sync_package($package['name']);
$internal_name = get_package_internal_name($package);
- start_service($internal_name);
+ start_service($internal_name, true);
unset($rcfiles[RCFILEPREFIX . strtolower($internal_name) . ".sh"]);
echo "done.\n";
}
OpenPOWER on IntegriCloud