[ Posting here for increased visibility ]

Right now, cloud-init is only installed in the cloud images, so it's OK
if it enables itself by default.

However, for future Atomic work, we'll likely only have one tree
that's also running on bare metal, and that will include cloud-init.

This change should be safe because the Fedora Cloud kickstart in
spin-kickstarts uses services --enabled=cloud-init.
---
 cloud-init.spec | 22 ++--------------------
 1 file changed, 2 insertions(+), 20 deletions(-)

From 71d73e3ae96fd66f401db44e74a6aacecc030ecc Mon Sep 17 00:00:00 2001
From: Colin Walters <[email protected]>
Date: Mon, 14 Jul 2014 16:55:33 -0400
Subject: [PATCH] Don't enable by default

Right now, cloud-init is only installed in the cloud images, so it's OK
if it enables itself by default.

However, for future Atomic work, we'll likely only have one tree
that's also running on bare metal, and that will include cloud-init.

This change should be safe because the Fedora Cloud kickstart in
spin-kickstarts uses services --enabled=cloud-init.
---
 cloud-init.spec | 22 ++--------------------
 1 file changed, 2 insertions(+), 20 deletions(-)

diff --git a/cloud-init.spec b/cloud-init.spec
index 206aec6..71d22f4 100644
--- a/cloud-init.spec
+++ b/cloud-init.spec
@@ -7,7 +7,7 @@
 
 Name:           cloud-init
 Version:        0.7.5
-Release:        6%{?dist}
+Release:        7.atomic%{?dist}
 Summary:        Cloud instance init scripts
 
 Group:          System Environment/Base
@@ -112,26 +112,8 @@ cp -p systemd/*  $RPM_BUILD_ROOT/%{_unitdir}
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-
-%post
-if [ $1 -eq 1 ] ; then
-    # Initial installation
-    # Enabled by default per "runs once then goes away" exception
-    /bin/systemctl enable cloud-config.service     >/dev/null 2>&1 || :
-    /bin/systemctl enable cloud-final.service      >/dev/null 2>&1 || :
-    /bin/systemctl enable cloud-init.service       >/dev/null 2>&1 || :
-    /bin/systemctl enable cloud-init-local.service >/dev/null 2>&1 || :
-fi
-
 %preun
-if [ $1 -eq 0 ] ; then
-    # Package removal, not upgrade
-    /bin/systemctl --no-reload disable cloud-config.service >/dev/null 2>&1 || :
-    /bin/systemctl --no-reload disable cloud-final.service  >/dev/null 2>&1 || :
-    /bin/systemctl --no-reload disable cloud-init.service   >/dev/null 2>&1 || :
-    /bin/systemctl --no-reload disable cloud-init-local.service >/dev/null 2>&1 || :
-    # One-shot services -> no need to stop
-fi
+%systemd_preun cloud-config.service cloud-final.service cloud-init.service cloud-init-local.service
 
 %postun
 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
-- 
1.8.3.1

_______________________________________________
cloud mailing list
[email protected]
https://admin.fedoraproject.org/mailman/listinfo/cloud
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct

Reply via email to