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



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

2014-09-12 Thread Agustin Martin
On Fri, Sep 12, 2014 at 02:51:44AM +0430, Eliad Bagherzadegan wrote:
 Package: wdm
 Version: 1.28-17
 Severity: important
 
 Dear Maintainer,
 
 I am not sure if this is a wdm bug or a systemd bug, but anyhow, if
 systemd is chosen as the init system wdm (and xdm) won't work. What's
 more peculiar is that if one has slim installed, it (slim) would start
 as the display manager (at least it did in my case). What's even more
 peculiar is that slim starts on tty2.
 
 If this IS a wdm bug, a similar one must be filed against xdm.
 I'm not sure if the slim thing is a bug. If it is, please report it.

Hi,

May this be the same as slim's http://bugs.debian.org/748668?

Quoting from my bug report:

 After recent switch to systemd, I noticed that slim is started as
 default-x-display-manager, althought it is not the chosen default,

 $ cat /etc/X11/default-display-manager
 /usr/bin/wdm

 This did not happen under systemv and might be related to
 /lib/systemd/system/slim.service not checking default selection.

I guess that if you remove slim wdm will work again.

Not sure of systemd has provision for these kind of things or is package
responsability to use a wrapper to check for defaults and proceed
accordingly.

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#761236: wdm does not work with systemd as the init system

2014-09-12 Thread Eliad Bagherzadegan
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.

Eliad

-- 
Eliad Bagherzadegan (eliad@gmail.com)


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



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

2014-09-11 Thread Eliad Bagherzadegan
Package: wdm
Version: 1.28-17
Severity: important

Dear Maintainer,

I am not sure if this is a wdm bug or a systemd bug, but anyhow, if
systemd is chosen as the init system wdm (and xdm) won't work. What's
more peculiar is that if one has slim installed, it (slim) would start
as the display manager (at least it did in my case). What's even more
peculiar is that slim starts on tty2.

If this IS a wdm bug, a similar one must be filed against xdm.
I'm not sure if the slim thing is a bug. If it is, please report it.



-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.14-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages wdm depends on:
ii  cdebconf [debconf-2.0]  0.191
ii  debconf [debconf-2.0]   1.5.53
ii  libc6   2.19-10
ii  libpam-modules  1.1.8-3.1
ii  libpam-runtime  1.1.8-3.1
ii  libpam0g1.1.8-3.1
ii  libselinux1 2.3-2
ii  libwings2   0.95.5-2
ii  libwraster3 0.95.5-2
ii  libwutil3   0.95.5-2
ii  libx11-62:1.6.2-3
ii  libxau6 1:1.0.8-1
ii  libxdmcp6   1:1.1.1-1
ii  libxinerama12:1.1.3-1
ii  libxmu6 2:1.1.2-1
ii  psmisc  22.21-2
ii  x11-apps7.7+3
ii  x11-common  1:7.7+7
ii  x11-utils   7.7+2
ii  x11-xserver-utils   7.7+3

wdm recommends no packages.

Versions of packages wdm suggests:
ii  xfonts-base  1:1.0.3

-- Configuration Files:
/etc/X11/wdm/wdm-config [Errno 13] Permission denied:
u'/etc/X11/wdm/wdm-config'

-- debconf information:
* shared/default-x-display-manager: lightdm
  wdm/daemon_name: /usr/bin/wdm

-- 
Eliad Bagherzadegan (eliad@gmail.com)


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



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

2014-09-11 Thread Axel Beckert
Control: tag -1 + moreinfo

Hi,

Eliad Bagherzadegan wrote:
 I am not sure if this is a wdm bug or a systemd bug, but anyhow, if
 systemd is chosen as the init system wdm (and xdm) won't work.

Can you please elaborate won't work? What symptoms does your system
have? Does it come up, but you can't login? Or does wdm not even come
up at all?

Anyway, it works fine for me with systemd as well as with sysvrc. I
use it on all my boxes with X and one of them runs systemd as init
system.

(There's only a very small chance that a recent systemd upload broke
something as I haven't logged out for like one or two weeks on that
peticular box. Will check upon the next reboot.)

 What's more peculiar is that if one has slim installed, it (slim)
 would start as the display manager (at least it did in my case).
 What's even more peculiar is that slim starts on tty2.

This doesn't sound wdm-related. You can change which display manager
is started by reconfiguring any of them.

So dpkg-reconfigure -plow wdm should give you a dialog which of the
installed display managers you would like to use.

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



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

2014-09-11 Thread Eliad Bagherzadegan
On 09/12/2014 03:13 AM, Axel Beckert wrote:

 Can you please elaborate won't work? What symptoms does your system
 have? Does it come up, but you can't login? Or does wdm not even come
 up at all?

It does not come up at all. as I said, slim comes up instead.

 (There's only a very small chance that a recent systemd upload broke
 something as I haven't logged out for like one or two weeks on that
 peticular box. Will check upon the next reboot.)

It is possible. I only switched to systemd after debconf14.

 This doesn't sound wdm-related. You can change which display manager
 is started by reconfiguring any of them.

I meant when wdm is chosen (through dpkg-reconfigure wdm) to be the
display manager, it fails and instead slim comes up.


-- 
Eliad Bagherzadegan (eliad@gmail.com)


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