Source: accountsservice
Severity: wishlist
Tags: patch

Hi,

Attached are some patches to enable systemd support again.

The bug because of which it was disabled was fixed upstream:
https://bugs.freedesktop.org/show_bug.cgi?id=50112

The patches are also available on my github account:
https://github.com/schaal/accountsservice/compare/master...enable-systemd-integration

Cheers,
Daniel Schaal

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (103, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.11.0 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

-- no debconf information
>From 867903632985faa8b96e9a2f65ca3e0d919e7da6 Mon Sep 17 00:00:00 2001
From: Daniel Schaal <[email protected]>
Date: Sun, 1 Sep 2013 19:31:37 +0200
Subject: [PATCH 1/5] Revert "Disable systemd support:"

This reverts commit 2d66e9fb088e1b6b712ffba26cb12ef9eeac3c4a.

Conflicts:
	debian/rules
---
 debian/accountsservice.install | 1 +
 debian/control                 | 2 ++
 debian/rules                   | 3 ++-
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/debian/accountsservice.install b/debian/accountsservice.install
index b1522e7..a63e680 100644
--- a/debian/accountsservice.install
+++ b/debian/accountsservice.install
@@ -1,4 +1,5 @@
 etc
+lib
 usr/lib/accountsservice
 usr/share/dbus-1
 usr/share/locale
diff --git a/debian/control b/debian/control
index 5aed4ea..0f0f254 100644
--- a/debian/control
+++ b/debian/control
@@ -13,6 +13,8 @@ Build-Depends:
  libgirepository1.0-dev (>= 0.9.12),
  libglib2.0-dev (>= 2.34),
  libpolkit-gobject-1-dev,
+ libsystemd-daemon-dev,
+ libsystemd-login-dev,
  xmlto
 Build-Depends-Indep:
  gtk-doc-tools
diff --git a/debian/rules b/debian/rules
index 1dd07f0..acedf99 100755
--- a/debian/rules
+++ b/debian/rules
@@ -21,7 +21,8 @@ override_dh_shlibdeps:
 override_dh_auto_configure:
 	dh_auto_configure -- \
 		--enable-gtk-doc \
-		--enable-static=no
+		--enable-static=no \
+		--with-systemdsystemunitdir=/lib/systemd/system
 
 # Disabled to avoid FTBFS
 override_dh_auto_test:
-- 
1.8.4.rc3

>From ebbe825a8d234840bc9ed8cbdf467296e013bc5e Mon Sep 17 00:00:00 2001
From: Daniel Schaal <[email protected]>
Date: Sun, 1 Sep 2013 19:39:58 +0200
Subject: [PATCH 2/5] Revert "Strip SystemdService out of
 org.freedesktop.Accounts.service service file."

This reverts commit a54265eda6b25440e4480a3fee0f44aa5ec5349e.
---
 debian/patches/2002-disable_systemd.patch | 14 --------------
 debian/patches/series                     |  1 -
 debian/patches/ubuntu.series              |  1 -
 3 files changed, 16 deletions(-)
 delete mode 100644 debian/patches/2002-disable_systemd.patch

diff --git a/debian/patches/2002-disable_systemd.patch b/debian/patches/2002-disable_systemd.patch
deleted file mode 100644
index ce4e658..0000000
--- a/debian/patches/2002-disable_systemd.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Description: Remove SystemdService from DBus service file.
-Author: Alessio Treglia <[email protected]>
-Bug-Debian: http://bugs.debian.org/675925
----
- data/org.freedesktop.Accounts.service.in |    1 -
- 1 file changed, 1 deletion(-)
-
---- accountsservice.orig/data/org.freedesktop.Accounts.service.in
-+++ accountsservice/data/org.freedesktop.Accounts.service.in
-@@ -2,4 +2,3 @@
- Name=org.freedesktop.Accounts
- Exec=@libexecdir@/accounts-daemon
- User=root
--SystemdService=accounts-daemon.service
diff --git a/debian/patches/series b/debian/patches/series
index 8476d61..7b66d2b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,4 +4,3 @@
 0007-add-lightdm-support.patch
 1001-buildsystem.patch
 2001-filtering_out_users.patch
-2002-disable_systemd.patch
diff --git a/debian/patches/ubuntu.series b/debian/patches/ubuntu.series
index 03c7586..89ff4e3 100644
--- a/debian/patches/ubuntu.series
+++ b/debian/patches/ubuntu.series
@@ -10,4 +10,3 @@
 0012-add-keyboard-layout-support.patch
 0013-add-has-message-support.patch
 1001-buildsystem.patch
-2002-disable_systemd.patch
-- 
1.8.4.rc3

>From d51cdd992de6aead64492223f7a35d267824640f Mon Sep 17 00:00:00 2001
From: Daniel Schaal <[email protected]>
Date: Sun, 1 Sep 2013 19:34:24 +0200
Subject: [PATCH 3/5] Only enable systemd on linux-any.

---
 debian/accountsservice.install          | 1 -
 debian/accountsservice.install.linux.in | 2 ++
 debian/clean                            | 1 +
 debian/control                          | 4 ++--
 debian/rules                            | 1 +
 5 files changed, 6 insertions(+), 3 deletions(-)
 create mode 100644 debian/accountsservice.install.linux.in

diff --git a/debian/accountsservice.install b/debian/accountsservice.install
index a63e680..b1522e7 100644
--- a/debian/accountsservice.install
+++ b/debian/accountsservice.install
@@ -1,5 +1,4 @@
 etc
-lib
 usr/lib/accountsservice
 usr/share/dbus-1
 usr/share/locale
diff --git a/debian/accountsservice.install.linux.in b/debian/accountsservice.install.linux.in
new file mode 100644
index 0000000..be7cebb
--- /dev/null
+++ b/debian/accountsservice.install.linux.in
@@ -0,0 +1,2 @@
+# only list linux-specific files here
+lib
diff --git a/debian/clean b/debian/clean
index f00f8e8..ff99252 100644
--- a/debian/clean
+++ b/debian/clean
@@ -1 +1,2 @@
 gtk-doc.make
+debian/accountsservice.install.linux
diff --git a/debian/control b/debian/control
index 0f0f254..b510ec9 100644
--- a/debian/control
+++ b/debian/control
@@ -13,8 +13,8 @@ Build-Depends:
  libgirepository1.0-dev (>= 0.9.12),
  libglib2.0-dev (>= 2.34),
  libpolkit-gobject-1-dev,
- libsystemd-daemon-dev,
- libsystemd-login-dev,
+ libsystemd-daemon-dev (>= 186) [linux-any],
+ libsystemd-login-dev (>= 186) [linux-any],
  xmlto
 Build-Depends-Indep:
  gtk-doc-tools
diff --git a/debian/rules b/debian/rules
index acedf99..e2e4b44 100755
--- a/debian/rules
+++ b/debian/rules
@@ -31,6 +31,7 @@ override_dh_installchangelogs:
 	dh_installchangelogs NEWS
 
 override_dh_install:
+	cat debian/accountsservice.install debian/accountsservice.install.linux.in > debian/accountsservice.install.linux
 	dh_install
 	# patch is only applied conditionally, only install when present
 	if [ -d debian/tmp/usr/share/language-tools ]; then \
-- 
1.8.4.rc3

>From 7b281a77154a107ae0de5fba5a0ac74a05a9c4c0 Mon Sep 17 00:00:00 2001
From: Daniel Schaal <[email protected]>
Date: Mon, 2 Sep 2013 19:16:17 +0200
Subject: [PATCH 4/5] Use dh-systemd.

---
 debian/control | 1 +
 debian/rules   | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/debian/control b/debian/control
index b510ec9..cc5961f 100644
--- a/debian/control
+++ b/debian/control
@@ -5,6 +5,7 @@ Maintainer: Alessio Treglia <[email protected]>
 Build-Depends:
  debhelper (>= 7.0.50~),
  dh-autoreconf,
+ dh-systemd,
  gir1.2-freedesktop,
  gir1.2-glib-2.0 (>= 1.34),
  gnome-doc-utils,
diff --git a/debian/rules b/debian/rules
index e2e4b44..d348418 100755
--- a/debian/rules
+++ b/debian/rules
@@ -9,7 +9,7 @@ export LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
 LDFLAGS+=-Wl,--as-needed
 
 %:
-	dh $@ --parallel --with autoreconf
+	dh $@ --parallel --with autoreconf,systemd
 
 override_dh_autoreconf:
 	dh_autoreconf ./autogen.sh
-- 
1.8.4.rc3

>From 5c87d15439f4c1244c048e38be92152a4eaec19f Mon Sep 17 00:00:00 2001
From: Daniel Schaal <[email protected]>
Date: Sun, 1 Sep 2013 20:05:31 +0200
Subject: [PATCH 5/5] If it is used, let systemd handle restarting the daemon
 in maintscripts.

---
 debian/accountsservice.postinst | 2 +-
 debian/accountsservice.prerm    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/accountsservice.postinst b/debian/accountsservice.postinst
index 8b331ee..49bd08e 100644
--- a/debian/accountsservice.postinst
+++ b/debian/accountsservice.postinst
@@ -11,7 +11,7 @@ get_pid() {
               string:$1 2>/dev/null | awk '/uint32/ {print $2}'
 }
 
-if [ "$1" = "configure" ]; then
+if [ "$1" = "configure" -a ! -d /run/systemd/system ]; then
    # stop accounts-daemon
    pid=$(get_pid org.freedesktop.Accounts)
    kill $pid 2>/dev/null || true
diff --git a/debian/accountsservice.prerm b/debian/accountsservice.prerm
index 87315c4..4dd9956 100644
--- a/debian/accountsservice.prerm
+++ b/debian/accountsservice.prerm
@@ -11,7 +11,7 @@ get_pid() {
               string:$1 2>/dev/null | awk '/uint32/ {print $2}'
 }
 
-if [ "$1" = "remove" ]; then
+if [ "$1" = "remove" -a ! -d /run/systemd/system ]; then
     kill $(get_pid org.freedesktop.Accounts) 2>/dev/null || true
 fi
 
-- 
1.8.4.rc3

Reply via email to