Bug#748668: Bug#761236: wdm does not work with systemd as the init system

2014-11-21 Thread Alessandro Ghedini
On lun, set 15, 2014 at 12:14:07 +0200, Agustin Martin wrote:
 Control: tag 748668 +patch

Maybe I'm missing something but your email doesn't provide any patch.

Anyway, I wrote a patch that fixes this bug (see attached) as you suggested. The
patch does:

1 Patches the systemd service file to not start unless slim is the default
  manager (as per /etc/X11/default-display-manager).
2 Removes the [Install] section in the systemd service file so that it doesn't
  take over the system on install. This also removes the WantedBy statement that
  was added as part of the fix for #741511 which is IMO wrong.
3 Creates the /etc/systemd/system/display-manager.service in postinst if slim is
  the dfault manager.

Note that 1 and 3 above actually come from the lightdm package (I only removed
the part where it reloads dbus, which is not used by slim).

I think that this patch should be included in jessie.

Cheers
From 0edf3170f060aa69248fd37164e1c415272d631c Mon Sep 17 00:00:00 2001
From: Alessandro Ghedini alessan...@ghedini.me
Date: Fri, 21 Nov 2014 15:44:17 +0100
Subject: [PATCH] Properly integrate with systemd

Closes: #748668
---
 debian/patches/fix-systemd-service.patch | 14 ++
 debian/slim.postinst | 13 +
 2 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/debian/patches/fix-systemd-service.patch b/debian/patches/fix-systemd-service.patch
index fc53dd0..d36c4bd 100644
--- a/debian/patches/fix-systemd-service.patch
+++ b/debian/patches/fix-systemd-service.patch
@@ -4,8 +4,14 @@ Bug-Debian: http://bugs.debian.org/741511
 
 --- a/slim.service
 +++ b/slim.service
-@@ -7,3 +7,4 @@ ExecStart=/usr/bin/slim -nodaemon
+@@ -3,7 +3,7 @@
+ After=systemd-user-sessions.service
  
- [Install]
- Alias=display-manager.service
-+WantedBy=graphical.target
+ [Service]
++# temporary safety check until all DMs are converted to correct
++# display-manager.service symlink handling
++ExecStartPre=/bin/sh -c '[ $(cat /etc/X11/default-display-manager 2/dev/null) = /usr/bin/slim ]'
+ ExecStart=/usr/bin/slim -nodaemon
+-
+-[Install]
+-Alias=display-manager.service
diff --git a/debian/slim.postinst b/debian/slim.postinst
index 91a857f..cb3d51c 100644
--- a/debian/slim.postinst
+++ b/debian/slim.postinst
@@ -29,6 +29,19 @@ if [ -e $DEFAULT_DISPLAY_MANAGER_FILE.dpkg-tmp ]; then
   rm $DEFAULT_DISPLAY_MANAGER_FILE.dpkg-tmp
 fi
 
+if [ $1 = configure ];
+then
+  # set default-display-manager systemd service link according to our config
+  if [ -e $DEFAULT_DISPLAY_MANAGER_FILE -a -d /etc/systemd/system/ ]; then
+SERVICE=/lib/systemd/system/$(basename $(cat $DEFAULT_DISPLAY_MANAGER_FILE)).service
+if [ -e $SERVICE ]; then
+  ln -sf $SERVICE /etc/systemd/system/display-manager.service
+else
+  echo ERROR: $SERVICE is the selected default display manager but does not exist 2
+fi
+  fi
+fi
+
 # debconf hangs if slim gets started below without this
 db_stop || true
 
-- 
2.1.3



signature.asc
Description: Digital signature


Bug#748668: Bug#761236: wdm does not work with systemd as the init system

2014-11-21 Thread Agustin Martin
On Fri, Nov 21, 2014 at 04:19:06PM +0100, Alessandro Ghedini wrote:
 On lun, set 15, 2014 at 12:14:07 +0200, Agustin Martin wrote:
  Control: tag 748668 +patch
 
 Maybe I'm missing something but your email doesn't provide any patch.

Thanks,

As I wrote when forcemerging 768774, 

  That info should be enough for a fix, so I tagged that bug report
  as +patch even if no explicit patch was added.

 Anyway, I wrote a patch that fixes this bug (see attached) as you suggested. 
 The
 patch does:
 
 1 Patches the systemd service file to not start unless slim is the default
   manager (as per /etc/X11/default-display-manager).
 2 Removes the [Install] section in the systemd service file so that it doesn't
   take over the system on install. This also removes the WantedBy statement 
 that
   was added as part of the fix for #741511 which is IMO wrong.
 3 Creates the /etc/systemd/system/display-manager.service in postinst if slim 
 is
   the dfault manager.
 
 Note that 1 and 3 above actually come from the lightdm package (I only removed
 the part where it reloads dbus, which is not used by slim).

Thanks again. 

I did not write the actual patch because I am not yet using systemd, so I could 
not
test it properly. 
 
 I think that this patch should be included in jessie.

Me too, 

Maintainers?

Regards,

-- 
Agustin


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#748668: Bug#761236: wdm does not work with systemd as the init system

2014-09-15 Thread Agustin Martin
Control: tag 748668 +patch
2014-09-13 10:46 GMT+02:00 Axel Beckert a...@debian.org:
 Control: affects 748668 wdm
 Control: severity 748668 important

 Hi Eliad,

 Eliad Bagherzadegan wrote:
 On 09/12/2014 02:04 PM, Agustin Martin wrote:
  I guess that if you remove slim wdm will work again.

 Thank you. I actually had to purge slim for wdm to work again.
 Sorry for the duplicate bug report and on the wrong package.

 You don't need to be sorry. I, as wdm package maintainer, wasn't aware
 of the issue which causes unexpected behaviour of my package and now I
 am. I probably would have found out after testing, and since you
 mentioned slim, I likely would have installed it at some point during
 testing.

 Thanks also to Agustin for the notice about the other report.

Hi, Axel,

Sorry, I forgot to mark this bug report as affecting wdm, thanks for doing.

IIRC, last time I looked about how other display managers deal with
this I found no info. I later switched back to sysv until I can make
two local services behave exactly as I want under systemd, so forgot
about this until now.

However seems that more info is now available, some of it from the
gnome folks. There are service files for at least gnome3 and lightdm.
lightdm is probably closer to slim (and wdm) needs and the most useful
place to look at.

References for the bug reports,

   https://bugs.debian.org/733220

Also info available in

  https://titanpad.com/s-gsprintchangelog

section = default display manager selection =

In short they suggest using something like

ExecStartPre=/bin/sh -c '[ ! -f /etc/X11/default-display-manager -o
$(cat /etc/X11/default-display-manager 2/dev/null) =
/usr/sbin/lightdm ]'

but there are some other details like symlinks and aliases
discouraging to care about.

From titanpad:

* /etc/X11/default-display-manager is and remains the definitive selection

* graphical.target has Wants=display-manager.service which provides
the dependency for auto-starting DM

* In DM packages' .service files: Don't have an [Install] section
(Dependency or Alias) as systemctl enable will otherwise make the last
installed package win instead of the one selected in debconf

* DM postinst: Create symlink
/etc/systemd/system/display-manager.service →
/lib/systemd/system/$(basename $(cat /e/X/d)).service

* Until all DM .services are converted: Add ExecStartPre= check that
/e/X/d is pointing to me, and fail otherwise

I think that might be useful for fixing slim and for the future
implementation of a wdm.service file.

Regards,

-- 
Agustin


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#748668: Bug#761236: wdm does not work with systemd as the init system

2014-09-13 Thread Axel Beckert
Control: affects 748668 wdm
Control: severity 748668 important

Hi Eliad,

Eliad Bagherzadegan wrote:
 On 09/12/2014 02:04 PM, Agustin Martin wrote:
  I guess that if you remove slim wdm will work again.
 
 Thank you. I actually had to purge slim for wdm to work again.
 Sorry for the duplicate bug report and on the wrong package.

You don't need to be sorry. I, as wdm package maintainer, wasn't aware
of the issue which causes unexpected behaviour of my package and now I
am. I probably would have found out after testing, and since you
mentioned slim, I likely would have installed it at some point during
testing.

Thanks also to Agustin for the notice about the other report.

Closing #761236 report now. I'm not sure if #748668 should be marked
as affects for _all_ other display managers (or only those which
don't have a service file yet?).

I'll mark it at least as affecting wdm as there were already two users
who ran in to this issue. (I saw in #748668 that Agustin also had wdm
as default.)

And I'm raising the severity of #748668 to important for now. Not sure
if it should be even RC, depends if wdm counts as unrelated. (The
description of the severity critical contains the phrase makes
unrelated software on the system break. Then again, critical is
very likely a too severe rating.)

Regards, Axel
-- 
 ,''`.  |  Axel Beckert a...@debian.org, http://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE
  `-|  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org