By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.
Bug 1998 - systemd - user session tracking/multiseat implementation required
Summary: systemd - user session tracking/multiseat implementation required
Status: CONFIRMED
Alias: None
Product: TDE
Classification: Unclassified
Component: tdebase (show other bugs)
Version: R14.0.x [Trinity]
Hardware: Other Linux
: P5 enhancement
Assignee: Timothy Pearson
URL:
Depends on:
Blocks:
 
Reported: 2014-03-07 07:10 CST by David C. Rankin
Modified: 2018-05-27 10:50 CDT (History)
3 users (show)

See Also:
Compiler Version:
TDE Version String:
Application Version:
Application Name:


Attachments
port of kde4-workspace logind multiseat patch to TDE with "greeter" (12.83 KB, patch)
2014-03-07 07:10 CST, David C. Rankin
Details | Diff
port of logind multiseat patch with "greeter" and debug statements (13.92 KB, patch)
2014-03-08 03:45 CST, David C. Rankin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David C. Rankin 2014-03-07 07:10:51 CST
Created attachment 1987 [details]
port of kde4-workspace logind multiseat patch to TDE with "greeter"

This bug is related to issues discussed in bug 1902. 

http://bugs.pearsoncomputing.net/show_bug.cgi?id=1902

The latest patch (port of kde4 implementation of multiseat) builds without error on TDE, but will require work to insure proper function in TDE. Bug 1902 should be read in conjunction with the information provided here. The prior patches are:

(original kdm4 multiseat implementation)
http://bugs.pearsoncomputing.net/attachment.cgi?id=1942&action=diff

(port of multiseat patch to TDE & FindSystemd.cmake macro)
http://bugs.pearsoncomputing.net/attachment.cgi?id=1962&action=diff

An additional patch specifically implementing the "greeter" registration exists and is attached to this report as a starting point for TDE multiseat implementation.

PROBLEM:

TDE fails to provide user session tracking in a pure-systemd environment (systemd launching tdm -- not a wrapper script, and NO consolekit installed). This causes all user hardware access to user controlled hardware to fail (sound, user mount of cd/dvd/usb, etc.) and causes race conditions in some TDE applications (tdepowersave, etc.) Essentially, proper user session tracking is required for the proper function of udev/polkit user-access to hardware devices. At present TDE user session tracking does not work in a pure-systemd environment.

THE SOLUTION:

freedesktop.org has published migration requirements for display managers to function properly in a pure-systemd environment:

http://www.freedesktop.org/wiki/Software/systemd/writing-display-managers/

http://www.freedesktop.org/wiki/Software/systemd/writing-desktop-environments/

According to the above links, only minimal code changes will be required to make TDE compliant with systemd user session tracking.

All of the criteria for implementing a fix as well as the indications for success are provided in the links above and summarized in Bug 1902.
Comment 1 David C. Rankin 2014-03-07 21:54:10 CST
I applied the tdebase-tdm-logind-multiseat_03+greeter.patch to the current tdebase to troubleshoot the tdepowersave error. It solves the tdepowersave race condition showing the patch is working to an extent. 

Where before the patch the logs were filled with:

Mar 06 13:31:28 valhalla dbus[176]: [system] Activating service name='org.trinitydesktop.hardwarecontrol' (using servicehelper)
Mar 06 13:31:28 valhalla org.trinitydesktop.hardwarecontrol[176]: [tde_dbus_hardwarecontrol] Listening...
Mar 06 13:31:28 valhalla dbus[176]: [system] Successfully activated service
'org.trinitydesktop.hardwarecontrol'
Mar 06 13:31:28 valhalla dbus[176]: [system] Rejected send message, 2 matched
rules; type="method_call", sender=":1.37" (uid=1000 pid=674 comm="tdepowersave
[tdeinit]                            ")
interface="org.trinitydesktop.hardwarecontrol.InputEvents"
member="GetProvidedSwitches" error name="(unset)" requested_reply="0"
destination="org.trinitydesktop.hardwarecontrol" (uid=0 pid=12966
comm="/opt/trinity/bin/tde_dbus_hardwarecontrol ")
Mar 06 13:31:28 valhalla org.trinitydesktop.hardwarecontrol[176]:
[tde_dbus_hardwarecontrol] Name request failed with error 'Rejected send
message, 2 matched rules; type="method_call", sender=":1.37" (uid=1000 pid=674
comm="tdepowersave [tdeinit]                            ")
interface="org.trinitydesktop.hardwarecontrol.InputEvents"
member="GetProvidedSwitches" error name="(unset)" requested_reply="0"
destination="org.trinitydesktop.hardwarecontrol" (uid=0 pid=12966
comm="/opt/trinity/bin/tde_dbus_hardwarecontrol ")'
Mar 06 13:31:28 valhalla org.trinitydesktop.hardwarecontrol[176]:
[tde_dbus_hardwarecontrol] Not primary owner (-1), exiting!
Mar 06 13:31:28 valhalla dbus[176]: [system] Activated service
'org.trinitydesktop.hardwarecontrol' failed: Launch helper exited with unknown
return code 1

After applying the patch, dbus obtains and accepts the correct name for tde_dbus_hardwarecontrol:

Mar 07 19:42:01 valhalla systemd[1]: Starting TDE Display Manager...
Mar 07 19:42:01 valhalla systemd[1]: Started TDE Display Manager.
Mar 07 19:42:22 valhalla [448]: pam_unix(kde:session): session opened for user david by (uid=0)
Mar 07 19:44:09 valhalla dbus[183]: [system] Activating service name='org.trinitydesktop.hardwarecontrol' (using servicehelper)
Mar 07 19:44:09 valhalla dbus[183]: [system] Successfully activated service 'org.trinitydesktop.hardwarecontrol'
Mar 07 19:44:10 valhalla org.trinitydesktop.hardwarecontrol[183]: [tde_dbus_hardwarecontrol] Listening...
Mar 07 19:44:10 valhalla org.trinitydesktop.hardwarecontrol[183]: [tde_dbus_hardwarecontrol] Name acquired: :1.9
Mar 07 19:44:11 valhalla org.trinitydesktop.hardwarecontrol[183]: [tde_dbus_hardwarecontrol] Name acquired: org.trinitydesktop.hardwarecontrol

This is a positive sign. We now need to confirm the rest of the patch functionality!
Comment 2 David C. Rankin 2014-03-08 02:35:38 CST
Checking running processes after the patch, the systemd startup and user login look fine. The launch of tdm is also correct on :0 vt7. 

1    /sbin/init
97   /usr/lib/systemd/systemd-journald
111  /usr/lib/systemd/systemd-udevd
171  /usr/lib/systemd/systemd-logind

192  login -- david
428   \_ -bash
426  /usr/lib/systemd/systemd --user
427   \_ (sd-pam)

443  /opt/trinity/bin/tdm
445   \_ /usr/bin/X -br -nolisten tcp :0 vt7 -auth /var/run/xauth/A:0-nQmpSb
448   \_ -:0
467       \_ /bin/sh /opt/trinity/bin/starttde
753           \_ /opt/trinity/bin/tdeinit_phase1
754               \_ kwrapper ksmserver --windowmanager twin

729  dcopserver [tdeinit] --nosid --suicide

I'm not sure if tdeinit_phase1 or kwrapper ksmserver have any bearing on user/session tracking.

tdepowersave no longer hangs on tde start every time, I have had the tdepowersave hang again even with the patches for multiseat applied.

As a side effect, I now get multiple konqueror processes spawned similar to what was seen with tdeioslaves:

744  [tdeinit] tdeinit Running...
747   \_ tdelauncher [tdeinit] --new-startup
760   \_ twin [tdeinit] -session 10d7cdd8c9000139108311200000009720000_1394
777   \_ tdeio_file [tdeinit] file /tmp/tdesocket-david/tdelauncheryJVvBs.s
789   \_ notification-daemon-tde
808   \_ konqueror [tdeinit] -session 10d7cdd8c9000139235256900000063930014
809   \_ konqueror [tdeinit] -session 10d7cdd8c9000139241737300000063930020
810   \_ konqueror [tdeinit] -session 10d7cdd8c9000139269956500000004590015
811   \_ konqueror [tdeinit] -session 10d7cdd8c9000139271054100000004590028
812   \_ konqueror [tdeinit] -session 10d7cdd8c9000139340009600000013660015
813   \_ konqueror [tdeinit] -session 10d7cdd8c9000139346014900000005280015
814   \_ konqueror [tdeinit] -session 10d7cdd8c9000139379884100000005870016
815   \_ konqueror [tdeinit] -session 10d7cdd8c9000139409296600000005690019
816   \_ konqueror [tdeinit] -session 10d7cdd8c9000139413951100000006350015
828   \_ konqueror [tdeinit] -session 10d7cdd8c9000139417287400000007980015
905   \_ konqueror [tdeinit] --silent


Full process list at:

http://www.3111skyline.com/dl/dt/trinity/err/systemd/psaxf-tdebase-systemd-20140307.txt

I have no idea what is causing konqueror to act up now.
Comment 3 David C. Rankin 2014-03-08 03:45:18 CST
Created attachment 1993 [details]
port of logind multiseat patch with "greeter" and debug statements

this latest patch contains a new CMakeLists.txt flag 'WITH_SYSTEMD_SESSIONS (OFF) "Enable systemd user session tracking without consolekit". It is used later in CMakeLists.txt to set the prepocessor WITH_SYSTEMD_SESSIONS:

##### check if systemd is installed #############
find_package(Systemd)
if(SYSTEMD_FOUND)
  add_definitions(-DWITH_SYSTEMD)
  message( STATUS "*****  Systemd preprocessor flag WITH_SYSTEMD set  *****" )
  if(WITH_SYSTEMD_SESSIONS)
    add_definitions(-DWITH_SYSTEMD_SESSIONS)
    message( STATUS "*****  Systemd preprocessor flag WITH_SYSTEMD_SESSIONS set  *****" )
  endif()
else()
  message( STATUS "*****  Systemd preprocessor flag WITH_SYSTEMD -- NOT set  *****" )
endif()

WITH_SYSTEMD_SESSIONS is simply a test to insure consolekit headers are not loaded, etc.

Checking running processes after the patch, the systemd startup and user login look fine. The launch of tdm is also correct on :0 vt7. 

1    /sbin/init
97   /usr/lib/systemd/systemd-journald
111  /usr/lib/systemd/systemd-udevd
171  /usr/lib/systemd/systemd-logind

192  login -- david
428   \_ -bash
426  /usr/lib/systemd/systemd --user
427   \_ (sd-pam)

443  /opt/trinity/bin/tdm
445   \_ /usr/bin/X -br -nolisten tcp :0 vt7 -auth /var/run/xauth/A:0-nQmpSb
448   \_ -:0
467       \_ /bin/sh /opt/trinity/bin/starttde
753           \_ /opt/trinity/bin/tdeinit_phase1
754               \_ kwrapper ksmserver --windowmanager twin

729  dcopserver [tdeinit] --nosid --suicide



while tdepowersave doesn't hang, I now get multiple konqueror processes spawned similar to what was seen with tdeioslaves:

744  [tdeinit] tdeinit Running...
747   \_ tdelauncher [tdeinit] --new-startup
760   \_ twin [tdeinit] -session 10d7cdd8c9000139108311200000009720000_1394
777   \_ tdeio_file [tdeinit] file /tmp/tdesocket-david/tdelauncheryJVvBs.s
789   \_ notification-daemon-tde
808   \_ konqueror [tdeinit] -session 10d7cdd8c9000139235256900000063930014
809   \_ konqueror [tdeinit] -session 10d7cdd8c9000139241737300000063930020
810   \_ konqueror [tdeinit] -session 10d7cdd8c9000139269956500000004590015
811   \_ konqueror [tdeinit] -session 10d7cdd8c9000139271054100000004590028
812   \_ konqueror [tdeinit] -session 10d7cdd8c9000139340009600000013660015
813   \_ konqueror [tdeinit] -session 10d7cdd8c9000139346014900000005280015
814   \_ konqueror [tdeinit] -session 10d7cdd8c9000139379884100000005870016
815   \_ konqueror [tdeinit] -session 10d7cdd8c9000139409296600000005690019
816   \_ konqueror [tdeinit] -session 10d7cdd8c9000139413951100000006350015
828   \_ konqueror [tdeinit] -session 10d7cdd8c9000139417287400000007980015
905   \_ konqueror [tdeinit] --silent


Full process list at:

http://www.3111skyline.com/dl/dt/trinity/err/systemd/psaxf-tdebase-systemd-20140307.txt

This was a surprise. I have not seen a repeat since earlier this evening. I'll be out next week with my kids on spring break, I'll take my laptop and try and check in from time to time.
Comment 4 Slávek Banko 2014-07-12 19:14:58 CDT
A few notes:

1) This error has no relation with the bug in 1902.

2) The proposal patch for KDE4, which was the template for the patch attached here, is still reviewed - has not been incorporated into KDE4 - see https://git.reviewboard.kde.org/r/112294/

3) I consider more appropriate solution to use dbus calls that was not made ​​direct dependency on systemd.

Please do not push patches that are currently attached to this bug report.
Comment 5 David C. Rankin 2014-07-12 20:42:54 CDT
(In reply to Slávek Banko from comment #4)
> A few notes:
> 
> 1) This error has no relation with the bug in 1902.
> 
> 2) The proposal patch for KDE4, which was the template for the patch
> attached here, is still reviewed - has not been incorporated into KDE4 - see
> https://git.reviewboard.kde.org/r/112294/
> 
> 3) I consider more appropriate solution to use dbus calls that was not made
> ​​direct dependency on systemd.
> 
> Please do not push patches that are currently attached to this bug report.

Slavek, excellent! I am glad this is finally getting attention. I have not had time to build tde lately, but it was somewhat of a low priority due to this bug. TDE on Archlinux cannot move forward until this is fixed or a workaround found. I have tinkered with the original patch, but have not been able to get anything to work. I look forward to testing any solutions. I have expert depositions upcoming, but those will conclude by the 23rd. I'll be able to devote time to this issue after thatt.