Bug#754314: systemd support for kdm

2014-08-14 Thread Moritz Mühlenhoff
On Tue, Aug 12, 2014 at 10:43:11AM +0200, Michael Biebl wrote:
 Hi,
 
 On Thu, Jul 17, 2014 at 05:17:23PM +0200, Moritz Muehlenhoff wrote:
  On Mon, Jul 14, 2014 at 06:34:40PM +0200, Moritz Mühlenhoff wrote:
   On Wed, Jul 09, 2014 at 10:16:07PM +0200, Moritz Muehlenhoff wrote:
Source: kde-workspace
Severity: wishlist
Tags: patch

activation of the service
-

After installation of the updated package the service isn't enabled
by default. You'll need to run systemctl enable kdm.service for
that. I'm not sure how the default display manager is handled if
several systemd units are installed, so it's probably for the best 
right now.
   
   Michael Stapelberg explained to me that the unit file needs an additional
   WantedBy=multi-user.target which would resolve this.
  
  This doesn't seem to be sufficient, I still need to enable the service 
  manually
  ATM.
  
 
 This issue was discussed during the systemd/GNOME sprint this spring.
 I.e. how the display-manager.service symlink is supposed to be managed
 when multiple display managers are installed.
 
 lightdm and gdm3 are already updated to support this scheme, so I'm bringing
 their maintainers into the loop here.
 Please coordinate with them when adding systemd support to kdm.

We should really wrap this into some common code, which is included from
the respective display managers! I've looked into lightdm amd gdm3 and 
they already diverge (lightdm misses the removal code present for gdm3). 
After all, this affects wdm and xdm as well.

Cheers,
Moritz


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



Bug#754314: systemd support for kdm

2014-08-12 Thread Michael Biebl
Hi,

On Thu, Jul 17, 2014 at 05:17:23PM +0200, Moritz Muehlenhoff wrote:
 On Mon, Jul 14, 2014 at 06:34:40PM +0200, Moritz Mühlenhoff wrote:
  On Wed, Jul 09, 2014 at 10:16:07PM +0200, Moritz Muehlenhoff wrote:
   Source: kde-workspace
   Severity: wishlist
   Tags: patch
   
   activation of the service
   -
   
   After installation of the updated package the service isn't enabled
   by default. You'll need to run systemctl enable kdm.service for
   that. I'm not sure how the default display manager is handled if
   several systemd units are installed, so it's probably for the best 
   right now.
  
  Michael Stapelberg explained to me that the unit file needs an additional
  WantedBy=multi-user.target which would resolve this.
 
 This doesn't seem to be sufficient, I still need to enable the service 
 manually
 ATM.
 

This issue was discussed during the systemd/GNOME sprint this spring.
I.e. how the display-manager.service symlink is supposed to be managed
when multiple display managers are installed.

lightdm and gdm3 are already updated to support this scheme, so I'm bringing
their maintainers into the loop here.
Please coordinate with them when adding systemd support to kdm.


Cheers,
Michael


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



Bug#754314: [Pkg-xfce-devel] Bug#754314: systemd support for kdm

2014-08-12 Thread Yves-Alexis Perez
On mar., 2014-08-12 at 10:43 +0200, Michael Biebl wrote:
 This issue was discussed during the systemd/GNOME sprint this spring.
 I.e. how the display-manager.service symlink is supposed to be managed
 when multiple display managers are installed.
 
 lightdm and gdm3 are already updated to support this scheme, so I'm
 bringing
 their maintainers into the loop here.
 Please coordinate with them when adding systemd support to kdm.
 
What kind of coordination is needed from us?
-- 
Yves-Alexis


signature.asc
Description: This is a digitally signed message part


Bug#754314: systemd support for kdm

2014-07-17 Thread Moritz Muehlenhoff
On Mon, Jul 14, 2014 at 06:34:40PM +0200, Moritz Mühlenhoff wrote:
 On Wed, Jul 09, 2014 at 10:16:07PM +0200, Moritz Muehlenhoff wrote:
  Source: kde-workspace
  Severity: wishlist
  Tags: patch
  
  activation of the service
  -
  
  After installation of the updated package the service isn't enabled
  by default. You'll need to run systemctl enable kdm.service for
  that. I'm not sure how the default display manager is handled if
  several systemd units are installed, so it's probably for the best 
  right now.
 
 Michael Stapelberg explained to me that the unit file needs an additional
 WantedBy=multi-user.target which would resolve this.

This doesn't seem to be sufficient, I still need to enable the service manually
ATM.

Attached, updated patch keeps consolekit on non-Linux.
 
Cheers,
Moritz
diff -Naur kde-workspace-4.11.9.orig/debian/control kde-workspace-4.11.9/debian/control
--- kde-workspace-4.11.9.orig/debian/control	2014-05-14 19:17:33.0 +0200
+++ kde-workspace-4.11.9/debian/control	2014-07-08 22:08:44.848239782 +0200
@@ -16,7 +16,7 @@
kdepimlibs5-dev (= 4:4.11),
libakonadi-dev (= 1.1.95),
libboost-dev (= 1.34),
-   libck-connector-dev,
+   libck-connector-dev [!linux-any],
libdbus-1-dev,
libdbusmenu-qt-dev (= 0.6.0),
libdevstat-dev [kfreebsd-any],
@@ -27,6 +27,7 @@
libglu1-mesa-dev,
libgps-dev (= 2.90),
libjpeg-dev,
+   dh-systemd,
libkactivities-dev (= 4:4.11),
libnm-util-dev (= 0.9) [linux-any],
libpam0g-dev,
@@ -349,11 +350,11 @@
 Section: x11
 Architecture: any
 Depends: adduser,
- consolekit,
  debconf | debconf-2.0,
  kde-wallpapers-default,
  kde-workspace-kgreet-plugins (= ${binary:Version}),
  lsb-base (= 3.2-14),
+ libpam-systemd [linux-any], consolekit [!linux-any],
  ${misc:Depends},
  ${shlibs:Depends}
 Recommends: kde-workspace | x-session-manager | x-window-manager,
diff -Naur kde-workspace-4.11.9.orig/debian/kdm-debian-setup-config kde-workspace-4.11.9/debian/kdm-debian-setup-config
--- kde-workspace-4.11.9.orig/debian/kdm-debian-setup-config	1970-01-01 01:00:00.0 +0100
+++ kde-workspace-4.11.9/debian/kdm-debian-setup-config	2014-07-08 22:05:45.072565352 +0200
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+# parameters to support kdm customization
+KDMRC=/etc/kde4/kdm/kdmrc
+BACKGROUNDRC=/etc/kde4/kdm/backgroundrc
+
+# if configuration is changed by kdmtheme or other tools, don't do magick
+if grep -q ^[[:space:]]*Theme=@@@ToBeReplacedByDesktopBase@@@ ${KDMRC}; then
+
+  KDMOVERRIDEDIR=/etc/default/kdm.d
+  KDMCFGDIR=/var/run/kdm
+  KDMCFG=$KDMCFGDIR/kdmrc
+  BACKGROUNDCFG=$KDMCFGDIR/backgroundrc
+  DEFAULT_KDM_THEME=/usr/share/kde4/apps/kdm/themes/elarun
+
+  # we use an alternative kdm master configuration file
+  ARG=$ARG -config $KDMCFG
+
+  # we generate kdm configuration files
+  genkdmconf --in $KDMCFGDIR 1 /dev/null
+
+  # we source overrides. run-parts sorts the list in a predictable order
+  if [ -d $KDMOVERRIDEDIR ]; then
+for part in $(run-parts --list $KDMOVERRIDEDIR 2/dev/null || true); do
+  . $part
+done
+  fi
+
+  # we update kdm configuration files (only overridden values)
+  [ -n $USEBACKGROUND ]  sed -i s|^#\?UseBackground=.*|UseBackground=$USEBACKGROUND| $KDMCFG
+  [ -n $BACKGROUNDCFG ]  sed -i s|^#\?BackgroundCfg=.*|BackgroundCfg=$BACKGROUNDCFG| $KDMCFG
+  [ -n $USETHEME ]  sed -i s|^#\?UseTheme=.*|UseTheme=$USETHEME| $KDMCFG
+  [ -n $THEME ]  [ -e $THEME ]  sed -i s|^#\?Theme=.*|Theme=$THEME| $KDMCFG
+  [ -n $LANGUAGE ]  sed -i s|^#\?Language=.*|Language=$LANGUAGE| $KDMCFG
+
+  if grep -q ^[[:space:]]*Wallpaper=stripes.png ${BACKGROUNDRC}; then
+[ -n $WALLPAPER ]  [ -e $WALLPAPER ]  sed -i s|^#\?Wallpaper=.*|Wallpaper=`readlink -f $WALLPAPER`| $BACKGROUNDCFG
+  fi
+
+  # usetheme is now on by default so we need to be sure Theme is not invalid ...
+  sed -i s|@@@ToBeReplacedByDesktopBase@@@|$DEFAULT_KDM_THEME| ${KDMCFG}
+
+  # autologin overrides are useful for live debian environment
+  if [ -n $AUTOLOGINUSER ]; then
+sed -i s|^#\?AutoLoginEnable=.*|AutoLoginEnable=true| $KDMCFG
+sed -i s|^#\?AutoLoginUser=.*|AutoLoginUser=$AUTOLOGINUSER| $KDMCFG
+  fi
+  [ -n $AUTOLOGINDELAY ]  sed -i s|^#\?AutoLoginDelay=.*|AutoLoginDelay=$AUTOLOGINDELAY| $KDMCFG
+  [ -n $AUTOLOGINAGAIN ]  sed -i s|^#\?AutoLoginAgain=.*|AutoLoginAgain=$AUTOLOGINAGAIN| $KDMCFG
+  [ -n $AUTOLOGINLOCKED ]  sed -i s|^#\?AutoLoginLocked=.*|AutoLoginLocked=$AUTOLOGINLOCKED| $KDMCFG
+fi
+
+exit 0
diff -Naur kde-workspace-4.11.9.orig/debian/kdm.install kde-workspace-4.11.9/debian/kdm.install
--- kde-workspace-4.11.9.orig/debian/kdm.install	2014-05-14 19:17:33.0 +0200
+++ kde-workspace-4.11.9/debian/kdm.install	2014-07-08 22:05:45.072565352 

Bug#754314: systemd support for kdm

2014-07-14 Thread Moritz Mühlenhoff
On Wed, Jul 09, 2014 at 10:16:07PM +0200, Moritz Muehlenhoff wrote:
 Source: kde-workspace
 Severity: wishlist
 Tags: patch
 
 activation of the service
 -
 
 After installation of the updated package the service isn't enabled
 by default. You'll need to run systemctl enable kdm.service for
 that. I'm not sure how the default display manager is handled if
 several systemd units are installed, so it's probably for the best 
 right now.

Michael Stapelberg explained to me that the unit file needs an additional
WantedBy=multi-user.target which would resolve this.

Maybe we should upload an systemd-enabled version of kde-workspace/kdm 
to experimental so that people running into bugs under systemd 
(e.g. #743649 and #754257) can try it out?

Cheers,
Moritz


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



Bug#754314: systemd support for kdm

2014-07-09 Thread Moritz Muehlenhoff
Source: kde-workspace
Severity: wishlist
Tags: patch

Hi KDE maintainers,
the attached patch adds systemd support to KDM. It's working well for
me, but some things are still up for discussion/need work.

Some notes:
consolekit:
---
This patch disables consolekit support (this part of the change
can be avoid by removing the hunks which remove the dep on
consolekit and the build-dep on libck-connector-dev. I'm not
sure on the usability of KDE on kfreebsd/hurd. These deps should
likely be kept for kfreebsd-any and hurd. There was a discussion
on debian-devel which stated that the systemd maintainers have
come up with a plan to ensure systemd is pid 1 for updated
and newly installed Linux systems. Unless that comes up it
additionally
needs a dependency on systemd-sysv.

Why did I disable consolekit? First of all, kdm with systemd/pid1
as currently in the archive has been quite unrealiable for me
with the KDM login failing with error messages like

  service 'org.freedesktop.ConsoleKit': timed out
  Jun 27 18:26:59 chartreuse kdm: :0[1362]: Cannot open ConsoleKit
  session: Unable to open session: Did not receive a reply. Possible
  causes include: the remote application did not send a reply, the
  message bus security policy blocked the reply, the reply timeout
  expired, or the network connection was broken.

  Or the following error messages from the consolekit service:

  console-kit-daemon.service - Console Manager
 Loaded: loaded (/lib/systemd/system/console-kit-daemon.service;
 enabled)
 Active: failed (Result: timeout) since Di 2014-06-10 18:01:25
 CEST;
 2min 44s ago
   Main PID: 792
 CGroup: name=systemd:/system/console-kit-daemon.service

  Jun 10 18:00:30 chartreuse console-kit-daemon[792]: (process:995):
  GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0'
  failed
  Jun 10 18:00:30 chartreuse console-kit-daemon[792]: missing action
  Jun 10 18:00:54 chartreuse console-kit-daemon[792]: WARNING:
  polkit_authority_get: Error getting authority: Error initializing
  authority: Error calling StartServiceByName for
  org.freedesktop.PolicyKit1:
  GDBus.Error:org.freedesktop.DBus.Error.TimedOut: Activation of
  org.freedesktop.PolicyKit1 timed out
  Jun 10 18:00:54 chartreuse console-kit-daemon[792]:
  console-kit-daemon[792]: WARNING: polkit_authority_get: Error
  getting
  authority: Error initializing authority: Error calling
  StartServiceByName for org.freedesktop.PolicyKit1:
  GDBus.Error:org.freedesktop.DBus.Error.TimedOut: Activation of
  org.freedesktop.PolicyKit1 timed out
  Jun 10 18:01:25 chartreuse systemd[1]: console-kit-daemon.service
  operation timed out. Terminating.
  Jun 10 18:01:25 chartreuse systemd[1]: Failed to start Console
  Manager.
  Jun 10 18:01:25 chartreuse systemd[1]: Unit
  console-kit-daemon.service
  entered failed state.

Without consolekit enabled everything works fine for me.

I found an upstream discussion started by one of the Kubuntu people (who
have also disabled consolekit) which also recommends to disable it:
http://article.gmane.org/gmane.comp.kde.devel.core/82597
http://article.gmane.org/gmane.comp.kde.devel.core/82598
http://article.gmane.org/gmane.comp.kde.devel.core/82601
http://article.gmane.org/gmane.comp.kde.devel.core/82610
https://bugs.launchpad.net/ubuntu/+source/kde-workspace/+bug/1281036


KDM conffile customisation
--

The sysvinit script has customisation code which generates the
kdmrc at runtime based on /etc/kde4/kdm/kdmrc. I've moved this
code to a separate script, the init.d script should be adapted
to share the same script.

activation of the service
-

After installation of the updated package the service isn't enabled
by default. You'll need to run systemctl enable kdm.service for
that. I'm not sure how the default display manager is handled if
several systemd units are installed, so it's probably for the best 
right now.

Cheers,
Moritz
diff -Naur kde-workspace-4.11.9.orig/debian/control kde-workspace-4.11.9/debian/control
--- kde-workspace-4.11.9.orig/debian/control	2014-05-14 19:17:33.0 +0200
+++ kde-workspace-4.11.9/debian/control	2014-07-07 18:57:44.128546659 +0200
@@ -16,7 +16,6 @@
kdepimlibs5-dev (= 4:4.11),
libakonadi-dev (= 1.1.95),
libboost-dev (= 1.34),
-   libck-connector-dev,
libdbus-1-dev,
libdbusmenu-qt-dev (= 0.6.0),
libdevstat-dev [kfreebsd-any],
@@ -27,6 +26,7 @@
libglu1-mesa-dev,
libgps-dev (= 2.90),
libjpeg-dev,
+	dh-systemd,
libkactivities-dev (= 4:4.11),
libnm-util-dev (= 0.9) [linux-any],
libpam0g-dev,
@@ -349,7 +349,6 @@
 Section: x11
 Architecture: any
 Depends: adduser,
- consolekit,
  debconf | debconf-2.0,
  kde-wallpapers-default,
  kde-workspace-kgreet-plugins