platform/upstream/user-session-units.git
11 years agoRev to v6. upstream upstream/6 v6
Auke Kok [Tue, 23 Oct 2012 19:15:11 +0000 (12:15 -0700)]
Rev to v6.

11 years agoExplicitly stop systemd user session units at shutdown.
Auke Kok [Tue, 23 Oct 2012 17:41:03 +0000 (10:41 -0700)]
Explicitly stop systemd user session units at shutdown.

Taken from:
  http://gitweb.merproject.org/gitweb?p=mer-core/systemd.git;a=patch;h=18ee801483fc71f4c423c8e16b039f5902e879b9
See also:
  https://bugs.nemomobile.org/show_bug.cgi?id=502

This is a stop-gap measure to shutdown any remaining user-session's.

Systemd still has a race (even in 195) that kills the logic in
user sessions before it can properly exit that same user session. Hence,
the user sessions time out shutting down for 90 seconds. This unit
forces the shutdown procedure again which works.

This is not supposed to be a final solution, which is why I'm
merging it here instead of pushing this fix to systemd itself. Ultimately
this patch needs to be dropped and the original logic made functional.

Thanks to the Mer project for coming up with this one.

=======
From 18ee801483fc71f4c423c8e16b039f5902e879b9 Mon Sep 17 00:00:00 2001
From: Pekka Lundstrom <pekka.lundstrom@jollamobile.com>
Date: Thu, 11 Oct 2012 12:07:07 +0300
Subject: [PATCH] Added file /lib/systemd/system/systemd-stop-user-sessions.service
 Fixes NEMO#502: Shutdown is not working properly when systemd user session is used

Signed-off-by: Pekka Lundstrom <pekka.lundstrom@jollamobile.com>
---
 systemd-stop-user-sessions.service |   20 ++++++++++++++++++++
 systemd.changes                    |    4 ++++
 systemd.spec                       |    6 ++++++
 3 files changed, 30 insertions(+), 0 deletions(-)
 create mode 100644 systemd-stop-user-sessions.service

diff --git a/systemd-stop-user-sessions.service b/systemd-stop-user-sessions.service
new file mode 100644
index 0000000..ce24c0f
--- /dev/null
+++ b/systemd-stop-user-sessions.service
@@ -0,0 +1,20 @@
+#  This file is part of systemd.
+#
+#  systemd is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU Lesser General Public License as published by
+#  the Free Software Foundation; either version 2.1 of the License, or
+#  (at your option) any later version.
+
+[Unit]
+Description=Disable User Sessions
+Documentation=man:systemd-user-sessions.service(8)
+Before=shutdown.target
+DefaultDependencies=no
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/lib/systemd/systemd-user-sessions stop
+
+[Install]
+WantedBy=shutdown.target
diff --git a/systemd.changes b/systemd.changes
index caadfbd..5865f2b 100644
--- a/systemd.changes
+++ b/systemd.changes
@@ -1,3 +1,7 @@
+* Thu Oct 11 2012 Pekka Lundstrom <pekka.lundstrom@jollamobile.com> - 187
+- Added file /lib/systemd/system/systemd-stop-user-sessions.service
+  Fixes NEMO#502: Shutdown is not working properly when systemd user session is used
+
 * Mon Aug 27 2012 Marko Saukko <marko.saukko@jollamobile.com> - 187
 - Fix tty1 autostart by excluding the file in /etc/systemd/system/getty.target.wants/

diff --git a/systemd.spec b/systemd.spec
index 607570e..9c78060 100644
--- a/systemd.spec
+++ b/systemd.spec
@@ -28,6 +28,7 @@ Requires:       filesystem >= 3
 # fsck with -l option was introduced in 2.21.2 packaging
 Requires:       util-linux >= 2.21.2
 Source0:        http://www.freedesktop.org/software/systemd/%{name}-%{version}.tar.xz
+Source1:        systemd-stop-user-sessions.service
 Patch0:         systemd-185-pkgconfigdir.patch
 Patch1:         systemd-187-reintroduce-support-for-deprecated-oom.patch
 Patch2: systemd-187-video.patch
@@ -255,6 +256,11 @@ rm %{buildroot}/%{_docdir}/systemd/*

 mkdir -p %{buildroot}/etc/systemd/system/basic.target.wants

+# Fix shutdown hang problem with user-serssions
+install -D -m 644 %{SOURCE1} %{buildroot}/lib/systemd/system/systemd-stop-user-sessions.service
+mkdir -p %{buildroot}/lib/systemd/system/shutdown.target.wants
+ln -s ../systemd-stop-user-sessions.service %{buildroot}/lib/systemd/system/shutdown.target.wants/systemd-stop-user-sessions.service
+
 #console-ttyMFD2
 ln -s ../serial-getty@.service %{buildroot}/lib/systemd/system/getty.target.wants/serial-getty@ttyMFD2.service

11 years agoMerge pull request #4 from mmonaco/master
Auke Kok [Sat, 29 Sep 2012 00:21:54 +0000 (17:21 -0700)]
Merge pull request #4 from mmonaco/master

dbus-1.6.8

11 years agodbus patch: update to dbus-1.6.8
Matthew Monaco [Fri, 28 Sep 2012 21:12:10 +0000 (15:12 -0600)]
dbus patch: update to dbus-1.6.8

Fuzzy patches make me nervous

11 years agoMerge pull request #2 from phmccarty/master
Auke Kok [Mon, 17 Sep 2012 22:37:45 +0000 (15:37 -0700)]
Merge pull request #2 from phmccarty/master

Two improvements for user-session@.service

11 years agoMerge pull request #3 from phmccarty/dbus-patch
Auke Kok [Mon, 17 Sep 2012 22:36:47 +0000 (15:36 -0700)]
Merge pull request #3 from phmccarty/dbus-patch

dbus patch: update to latest revision

11 years agodbus patch: update to latest revision
Patrick McCarty [Mon, 17 Sep 2012 20:14:28 +0000 (13:14 -0700)]
dbus patch: update to latest revision

11 years agouser session: Add membership to the memory cgroup
Patrick McCarty [Wed, 5 Sep 2012 18:51:49 +0000 (11:51 -0700)]
user session: Add membership to the memory cgroup

In order to set cgroup memory limits for systemd user session services
(by setting MemoryLimit and MemorySoftLimit), the systemd user instance
must have write permissions for the toplevel memory cgroup controller
hierarchy, located at /sys/fs/cgroup/memory.

To grant access to this hierarchy, this commits adds "memory:/" to
ControlGroup for the user session service file, which makes the user
instance a member of the memory cgroup and enables writing
/sys/fs/cgroup/memory/user and populating additional cgroups within that
directory.

11 years agoSet TTYPath for user-session@.service
Patrick McCarty [Wed, 5 Sep 2012 18:50:16 +0000 (11:50 -0700)]
Set TTYPath for user-session@.service

In order for a login session (managed by systemd-logind) to become fully
active, it must be assigned to both a seat and a VT.  Without using a
display manager, two options are available for ensuring these
assignments are made: (a) set XDG_SEAT and XDG_VTNR in the PAM session,
or (b) set PAM_TTY in the PAM session.

This commit implements the second option by setting TTYPath to
"/dev/tty1" for user-session@.service, thereby forcing systemd to set
PAM_TTY in the PAM session, which then sets XDG_SEAT to "seat0" and
XDG_VTNR to "1" for the user session.  "/dev/tty1" is the TTY of choice
because xorg-launch-helper spawns Xorg on tty1.

11 years agoAdd hint about permission requirements.
Auke Kok [Fri, 27 Jul 2012 04:33:35 +0000 (21:33 -0700)]
Add hint about permission requirements.

groups audio/video may need to be added.
Xorg may need to be setuid root.

11 years agodebug: hint about dbus-monitor
Auke Kok [Mon, 16 Jul 2012 19:22:32 +0000 (12:22 -0700)]
debug: hint about dbus-monitor

11 years agodebugging: some useful hints for those debugging issues.
Auke Kok [Mon, 16 Jul 2012 19:19:11 +0000 (12:19 -0700)]
debugging: some useful hints for those debugging issues.

11 years agoREADME: clarify the auto-login method a bit more.
Auke Kok [Mon, 16 Jul 2012 19:09:28 +0000 (12:09 -0700)]
README: clarify the auto-login method a bit more.

11 years agov5 v5
Auke Kok [Tue, 3 Jul 2012 06:46:48 +0000 (23:46 -0700)]
v5

11 years agoMerge branch 'master' of github.com:/sofar/user-session-units
Auke Kok [Tue, 3 Jul 2012 06:44:01 +0000 (23:44 -0700)]
Merge branch 'master' of github.com:/sofar/user-session-units

11 years agoAdd units for "mythfrontend".
Auke Kok [Tue, 3 Jul 2012 06:42:38 +0000 (23:42 -0700)]
Add units for "mythfrontend".

With these user session units, you can create a quick and easy
Multimedia Center setup. You will likely need to add separate
units for the backend yourself.

11 years agoMerge pull request #1 from hdhoang/patch-1
Auke Kok [Sun, 1 Jul 2012 04:15:32 +0000 (21:15 -0700)]
Merge pull request #1 from hdhoang/patch-1

Add note about XDG_RUNTIME_DIR's change to UID

11 years agoAdd note about XDG_RUNTIME_DIR's change to UID
Hoàng Đức Hiếu [Sat, 30 Jun 2012 20:57:16 +0000 (03:57 +0700)]
Add note about XDG_RUNTIME_DIR's change to UID

Changed in systemd v185-42-g2138e96.

11 years agov4 v4
Auke Kok [Thu, 28 Jun 2012 03:39:08 +0000 (20:39 -0700)]
v4

11 years agoTargets: AllowIsolate=true
Auke Kok [Wed, 27 Jun 2012 18:08:46 +0000 (11:08 -0700)]
Targets: AllowIsolate=true

This simple directive allows us to start implementing
some "neat tricks". One of them is to restart a completely
different UI using the systemctl command "isolate".

11 years agoBad oops: This will break all dbus usage in any of all the sessions
Auke Kok [Wed, 27 Jun 2012 04:33:19 +0000 (21:33 -0700)]
Bad oops: This will break all dbus usage in any of all the sessions

11 years agoAdd link to releases.
Auke Kok [Tue, 26 Jun 2012 00:28:29 +0000 (17:28 -0700)]
Add link to releases.

11 years agoSome subtle hints as to where this package should end up going.
Auke Kok [Mon, 25 Jun 2012 21:57:44 +0000 (14:57 -0700)]
Some subtle hints as to where this package should end up going.

11 years agoAnd include the KDE files in the install procedure. v3
Auke Kok [Mon, 25 Jun 2012 21:12:51 +0000 (14:12 -0700)]
And include the KDE files in the install procedure.

11 years agoRev to v3.
Auke Kok [Mon, 25 Jun 2012 21:06:35 +0000 (14:06 -0700)]
Rev to v3.

Quick drop of AC version needed - it may be too low, but, sure
doesn't hurt much at this point. --2.64.

11 years agoAdding .gitignore.
Auke Kok [Mon, 25 Jun 2012 21:05:08 +0000 (14:05 -0700)]
Adding .gitignore.

11 years agoVarious fixes and cleanups, add KDE.
Auke Kok [Mon, 25 Jun 2012 21:02:04 +0000 (14:02 -0700)]
Various fixes and cleanups, add KDE.

- Added [Install] sections for everything
- Changed tests for progs to use AC_TEST_PROG() generic
- Add KDE using `startkde`.

11 years agoOops here too. typo in the service name. v2
Auke Kok [Mon, 25 Jun 2012 06:49:56 +0000 (23:49 -0700)]
Oops here too. typo in the service name.

11 years agoOops, these should have been deleted.
Auke Kok [Mon, 25 Jun 2012 06:48:24 +0000 (23:48 -0700)]
Oops, these should have been deleted.

11 years agoTypo here.
Auke Kok [Mon, 25 Jun 2012 06:47:32 +0000 (23:47 -0700)]
Typo here.

11 years agoGnome: Add units for gnome-shell.
Auke Kok [Mon, 25 Jun 2012 06:40:12 +0000 (23:40 -0700)]
Gnome: Add units for gnome-shell.

I tested these units under a fc17 livecd. Obviously, you'll
need to install the gnome-desktop-devel package in order for
the pkgconfig magic to work for you.

11 years agodbus: add the patch to dist... v1
Auke Kok [Fri, 22 Jun 2012 18:25:59 +0000 (11:25 -0700)]
dbus: add the patch to dist...

11 years agoXBMC: display that we're testing for it.
Auke Kok [Fri, 22 Jun 2012 18:16:47 +0000 (11:16 -0700)]
XBMC: display that we're testing for it.

11 years agodbus: reference the upstream bug, and patch.
Auke Kok [Fri, 22 Jun 2012 18:05:58 +0000 (11:05 -0700)]
dbus: reference the upstream bug, and patch.

dbus activation is broken under the systemd user session
because dbus emits an env with DBUS_SESSION_BUS_ADDRESS=systemd:
to it's dbus-activated children.

To fix, the session bus should just pass the value of its own
DBUS_SESSION_BUS_ADDRESS if it is running under systemd with
systemd activation. This commit includes a copy of the patch
which should be applied to dbus.

11 years agoXfce: I'm assuming dbus activation will work properly.
Auke Kok [Fri, 22 Jun 2012 06:58:45 +0000 (23:58 -0700)]
Xfce: I'm assuming dbus activation will work properly.

11 years agoCleanup.
Auke Kok [Fri, 22 Jun 2012 06:58:25 +0000 (23:58 -0700)]
Cleanup.

11 years agoXfce: add units file here too. Also use ln -sf.
Auke Kok [Fri, 22 Jun 2012 06:56:56 +0000 (23:56 -0700)]
Xfce: add units file here too. Also use ln -sf.

11 years agoAdd Xbmc, also create the proper symlinks for xbmc, e17.
Auke Kok [Fri, 22 Jun 2012 06:38:20 +0000 (23:38 -0700)]
Add Xbmc, also create the proper symlinks for xbmc, e17.

11 years agoenlightenment: Add units for e17.
Auke Kok [Fri, 22 Jun 2012 06:19:54 +0000 (23:19 -0700)]
enlightenment: Add units for e17.

These are installed conditionally - when E is present, only.

11 years agoParse systemd.pc to get the proper path to the systemd binary
Auke Kok [Fri, 22 Jun 2012 05:43:54 +0000 (22:43 -0700)]
Parse systemd.pc to get the proper path to the systemd binary

11 years agodbus: finalize installing these properly.
Auke Kok [Fri, 22 Jun 2012 05:32:57 +0000 (22:32 -0700)]
dbus: finalize installing these properly.

11 years agoDbus: make these units generated with proper paths.
Auke Kok [Fri, 22 Jun 2012 05:28:08 +0000 (22:28 -0700)]
Dbus: make these units generated with proper paths.

11 years agodbus: use pkg-config to find the daemon path.
Auke Kok [Fri, 22 Jun 2012 05:21:54 +0000 (22:21 -0700)]
dbus: use pkg-config to find the daemon path.

11 years agoskeleton COPYING and INSTALL.
Auke Kok [Fri, 22 Jun 2012 05:13:55 +0000 (22:13 -0700)]
skeleton COPYING and INSTALL.

11 years agoMisc files needed for autoreconf.
Auke Kok [Fri, 22 Jun 2012 05:13:32 +0000 (22:13 -0700)]
Misc files needed for autoreconf.

11 years agoAdd Makefile.am.
Auke Kok [Fri, 22 Jun 2012 05:13:12 +0000 (22:13 -0700)]
Add Makefile.am.

11 years agoAC_SUBST the systemd paths.
Auke Kok [Fri, 22 Jun 2012 05:12:57 +0000 (22:12 -0700)]
AC_SUBST the systemd paths.

11 years agoREADME: basic guide as to how this all should work.
Auke Kok [Fri, 22 Jun 2012 04:58:58 +0000 (21:58 -0700)]
README: basic guide as to how this all should work.

11 years agoInitial import of user-session-units.
Auke Kok [Fri, 22 Jun 2012 04:37:27 +0000 (21:37 -0700)]
Initial import of user-session-units.