Mailinglist Archive: opensuse-commit (1855 mails)

< Previous Next >
commit systemd for openSUSE:Factory

Hello community,

here is the log from the commit of package systemd for openSUSE:Factory
checked in at Tue Sep 27 16:06:22 CEST 2011.



--------
--- systemd/systemd-gtk.changes 2011-09-23 17:52:08.000000000 +0200
+++ /mounts/work_src_done/STABLE/systemd/systemd-gtk.changes 2011-09-26
17:08:10.000000000 +0200
@@ -1,0 +2,8 @@
+Mon Sep 26 14:52:46 UTC 2011 - fcrozat@xxxxxxxx
+
+- Merge migration rpm macros into service_add/service_del macros.
+- Use systemd presets in rpm macros
+- Add fix-reload.patch: handle daemon-reload and start condition
+ properly (bnc#719221).
+
+-------------------------------------------------------------------
systemd.changes: same change

calling whatdependson for head-i586


New:
----
fix-reload.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ systemd.spec ++++++
--- /var/tmp/diff_new_pack.E3B4tO/_old 2011-09-27 16:06:18.000000000 +0200
+++ /var/tmp/diff_new_pack.E3B4tO/_new 2011-09-27 16:06:18.000000000 +0200
@@ -67,6 +67,8 @@
# in the patch. Any patches added here without a very good reason to make
# an exception will be silently removed with the next version update.
Patch9: 0001-execute-fix-bus-serialization-for-commands.patch
+# PATCH-FIX-UPSTREAM fix-reload.patch fcrozat@xxxxxxxx bnc#719221 -- Fix
daemon-reload and conditions when service is starting
+Patch11: fix-reload.patch

%description
Systemd is a system and service manager, compatible with SysV and LSB
@@ -121,6 +123,7 @@
%patch8 -p1
%patch9 -p1
%patch10 -p1
+%patch11 -p1

%build
autoreconf -fiv
@@ -141,7 +144,7 @@
mkdir -p %{buildroot}%{_sysconfdir}/rpm
install -m644 %{S:4} %{buildroot}%{_sysconfdir}/rpm
find %{buildroot} -type f -name '*.la' -exec rm -f {} ';'
-mkdir -p
%{buildroot}/{sbin,var/lib/systemd/sysv-convert,var/lib/systemd/migrated}
+mkdir -p
%{buildroot}/{sbin,var/lib/systemd/sysv-convert,var/lib/systemd/migrated}
%{buildroot}/lib/systemd/{system.preset,user.preset}
install -m755 %{S:3} -D %{buildroot}%{_sbindir}/systemd-sysv-convert
install -m755 %{S:5} %{buildroot}/lib/systemd/system-generators
install -m755 %{S:7} %{buildroot}/lib/systemd/
@@ -251,6 +254,8 @@
%{_bindir}/systemd-cgls
/lib/systemd/systemd-*
%dir /lib/systemd/system-shutdown
+%dir /lib/systemd/system.preset
+%dir /lib/systemd/user.preset
/%{_lib}/security/pam_systemd.so
%dir %{_sysconfdir}/systemd/system
%dir %{_sysconfdir}/systemd/user

++++++ fix-reload.patch ++++++
From a82e5507a6e03766957d43ca8818112ae9766288 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@xxxxxxxxxxxxxx>
Date: Thu, 22 Sep 2011 21:32:18 +0200
Subject: [PATCH] unit: don't recheck conditions when a unit is already starting
but unit_start() is invoked

---
src/unit.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/unit.c b/src/unit.c
index 3ce87ea..0b435cb 100644
--- a/src/unit.c
+++ b/src/unit.c
@@ -888,16 +888,20 @@ int unit_start(Unit *u) {
if (u->meta.load_state != UNIT_LOADED)
return -EINVAL;

- /* If this is already (being) started, then this will
- * succeed. Note that this will even succeed if this unit is
- * not startable by the user. This is relied on to detect when
- * we need to wait for units and when waiting is finished. */
+ /* If this is already started, then this will succeed. Note
+ * that this will even succeed if this unit is not startable
+ * by the user. This is relied on to detect when we need to
+ * wait for units and when waiting is finished. */
state = unit_active_state(u);
if (UNIT_IS_ACTIVE_OR_RELOADING(state))
return -EALREADY;

- /* If the conditions failed, don't do anything at all */
- if (!unit_condition_test(u)) {
+ /* If the conditions failed, don't do anything at all. If we
+ * already are activating this call might still be useful to
+ * speed up activation in case there is some hold-off time,
+ * but we don't want to recheck the condition in that case. */
+ if (state != UNIT_ACTIVATING &&
+ !unit_condition_test(u)) {
log_debug("Starting of %s requested but condition failed.
Ignoring.", u->meta.id);
return -EALREADY;
}
--
1.7.3.4

++++++ macros.systemd ++++++
--- /var/tmp/diff_new_pack.E3B4tO/_old 2011-09-27 16:06:18.000000000 +0200
+++ /var/tmp/diff_new_pack.E3B4tO/_new 2011-09-27 16:06:18.000000000 +0200
@@ -6,8 +6,11 @@
#
# add %systemd_requires in the specfile
#
+# %pre
+# %service_add_pre demo.service demo1.service
+#
# %post
-# %service_add demo.service demo1.service
+# %service_add_post demo.service demo1.service
#
# %preun
# %service_del_preun demo.service
@@ -15,64 +18,30 @@
# %postun
# %service_del_postun demo.service
#
-#
-# when migrating a package from sysvinit to systemd :
-# %triggerun -- package_name < version_where_switch_occured
-# %service_migrate_to_systemd [ -l run_level ] service_name.service
-# foobar.socket
-#
-# -l <run_level> is optional
###

# This is for /bin/systemctl
-%systemd_requires \
-Requires(pre): systemd \
-Requires(post): systemd \
-Requires(preun): systemd \
-Requires(postun): systemd \
+%systemd_requires
\
+Requires(pre): systemd
\
+Requires(post): systemd
\
+Requires(preun): systemd
\
+Requires(postun): systemd
\

%_unitdir /lib/systemd/system

-# On install, tell systemd to reload its unit files
-%service_add() \
-test -n "$FIRST_ARG" || FIRST_ARG=$1 \
-if [ $FIRST_ARG -eq 1 ]; then \
-# Initial installation \
- /bin/systemctl daemon-reload >/dev/null 2>&1 || : \
-fi \
-%{nil}
-
-# On uninstall, disable and stop services
-%service_del_preun() \
-test -n "$FIRST_ARG" || FIRST_ARG=$1 \
-if [ $FIRST_ARG -eq 0 ]; then \
-# Package removal, not upgrade \
- /bin/systemctl --no-reload disable %{?*} > /dev/null 2>&1 || : \
- /bin/systemctl stop %{?*} > /dev/null 2>&1 || : \
-fi \
-%{nil}
-
-# On uninstall, tell systemd to reload its unit files
-%service_del_postun() \
-test -n "$FIRST_ARG" || FIRST_ARG=$1 \
-/bin/systemctl daemon-reload >/dev/null 2>&1 || : \
-if [ $FIRST_ARG -ge 1 ]; then \
-# Package upgrade, not uninstall \
- /bin/systemctl try-restart %{?*} >/dev/null 2>&1 || : \
-fi \
-%{nil}
-
-%service_migrate_to_systemd_pre()
\
+%service_add_pre()
\
test -n "$FIRST_ARG" || FIRST_ARG=$1
\
# disable migration if initial install under systemd
\
if [ $FIRST_ARG -eq 1 ]; then
\
for service in %{?*} ; do
\
- touch "/var/lib/systemd/migrated/$service"
\
+ sysv_service=`echo $service | sed -e 's/\\.[a-z]*//g'`
\
+ touch "/var/lib/systemd/migrated/$sysv_service"
\
done
\
else
\
for service in %{?*} ; do
\
- if [ ! -e "/var/lib/systemd/migrated/$service" ]; then
\
- services_to_migrate="$services_to_migrate $service"
\
+ sysv_service=`echo $service | sed -e 's/\\.[a-z]*//g'`
\
+ if [ ! -e "/var/lib/systemd/migrated/$sysv_service" ]; then
\
+ services_to_migrate="$services_to_migrate $sysv_service"
\
fi
\
done
\
if [ -n "$services_to_migrate" ]; then
\
@@ -81,25 +50,45 @@
fi
\
%{nil}

-%service_migrate_to_systemd_post()
\
+# On install, tell systemd to reload its unit files
+%service_add_post()
\
+test -n "$FIRST_ARG" || FIRST_ARG=$1
\
for service in %{?*} ; do
\
- if [ ! -e "/var/lib/systemd/migrated/$service" ]; then
\
- services_to_migrate="$services_to_migrate $service"
\
- touch "/var/lib/systemd/migrated/$service"
\
+ sysv_service=`echo $service | sed -e 's/\\.[a-z]*//g'`
\
+ if [ ! -e "/var/lib/systemd/migrated/$sysv_service" ]; then
\
+ services_to_migrate="$services_to_migrate $sysv_service"
\
+ touch "/var/lib/systemd/migrated/$sysv_service"
\
fi
\
done
\
if [ -n "$services_to_migrate" ]; then
\
/usr/sbin/systemd-sysv-convert --apply $services_to_migrate >/dev/null 2>&1
|| : \
- /bin/systemctl daemon-reload >/dev/null 2>&1 || :
\
+fi
\
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
\
+/bin/systemctl preset %{?*} >/dev/null 2>&1 || :
\
+%{nil}
+
+# On uninstall, disable and stop services
+%service_del_preun()
\
+test -n "$FIRST_ARG" || FIRST_ARG=$1
\
+if [ $FIRST_ARG -eq 0 ]; then
\
+# Package removal, not upgrade
\
+ /bin/systemctl --no-reload disable %{?*} > /dev/null 2>&1 || :
\
+ /bin/systemctl stop %{?*} > /dev/null 2>&1 || :
\
fi
\
%{nil}

-%service_migrate_to_systemd_postun() \
-test -n "$FIRST_ARG" || FIRST_ARG=$1 \
-if [ $FIRST_ARG -eq 0 ]; then \
- for service in %{?*} ; do \
- rm -f "/var/lib/systemd/migrated/$service" 2> /dev/null \
- done \
-fi \
+# On uninstall, tell systemd to reload its unit files
+%service_del_postun()
\
+test -n "$FIRST_ARG" || FIRST_ARG=$1
\
+if [ $FIRST_ARG -ge 1 ]; then
\
+# Package upgrade, not uninstall
\
+ /bin/systemctl try-restart %{?*} >/dev/null 2>&1 || :
\
+else # package uninstall
\
+ for service in %{?*} ; do
\
+ sysv_service=`echo $service | sed -e 's/\\.[a-z]*//g'`
\
+ rm -f "/var/lib/systemd/migrated/$sysv_service" 2> /dev/null
\
+ done
\
+ /bin/systemctl daemon-reload >/dev/null 2>&1 || :
\
+fi
\
%{nil}



++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-commit+help@xxxxxxxxxxxx

< Previous Next >