You are not logged in.

#1 2013-07-19 02:12:06

polson136
Member
Registered: 2012-03-03
Posts: 39

Running a graphical environment through systemd

I am wanting to use systemd to control my x sessions because it simplifies many operations and, if I can get a couple things worked out, will probably result in a much cleaner environment.

The problem that I am having trouble theorizing about is this: I often have graphical logins running from multiple locations (local, and remote via vnc, for example), which means that the same code block has to work for both, in parallel.

If I run multiple user instances of systemd, then it seems there is no way of knowing which one systemctl will talk to. If I don't, then there does not seem to be a way that I can start my window manager through systemd, then hold the X server open until the window manager terminates.

Does anyone have any thoughts?

Last edited by polson136 (2013-07-19 02:12:41)

Offline

#2 2013-07-19 03:09:53

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,725

Re: Running a graphical environment through systemd

https://wiki.archlinux.org/index.php/Display_Manager

Edit:  Also, you are only allowed to have one PID 1.  There can exist only one systemd process.  It is called //sbin/Init.  Period.

Last edited by ewaller (2013-07-19 03:12:58)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#3 2013-07-19 03:35:20

polson136
Member
Registered: 2012-03-03
Posts: 39

Re: Running a graphical environment through systemd

I use xdm as my display manager. I am trying to figure out how to use that and a systemd user session.

If you use the --user option with systemd, you can run it in user space, any user can use systemd to start/stop their own personal daemons, such as a sound server, screensaver, window manager, etc.

https://wiki.archlinux.org/index.php/Systemd/User
describes how to do it.

The problem is that systemctl does not appear to handle multiple user sessions for the same user very well, and it also doesn't seem to allow you to wait until a unit terminates, either of which would solve my problem. (I think)

Offline

#4 2013-07-19 03:52:44

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,725

Re: Running a graphical environment through systemd

Okay...  You learn something new every day.  I had not heard of that, and I thought you were trying to have multiple init processes running.  This looks like a way of instantiating systemd in a completely different manner to which I am accustomed.  I will read up on this lest I make that mistake again.

Carry on....


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#5 2013-07-19 04:21:02

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Running a graphical environment through systemd

@ewaller, "systemd --user" is actually why systemd 205 will not come to our repos.  The cgroup changes break "systemd --user" and there are a pretty decent number of users who have configured their machines to use this (myself included).

@OP, setting up "systemd --user" locally is easy.  But I have no idea how you would go about doing the remote stuff.  TBH, I use the terminal/tty most of the time, so I just SSH to remotely access things.  I would imagine though that the vnc server would simply be able to run as a systemd service like anything else, and you would just be logging in to that.  I do not think that such a setup would constitute a "multi-seat" type setup.

In any case, you can certainly set up user sessions without breaking the other stuffs.  So I have my system set up to use either.  For a while I was using the CK kernel, and unfortunately the CK patchset requires that a specific cgroup setting be turned off in the kernel in order for BFS to be turned on, and that breaks the user sessions.  So I like to keep my options open in terms of how I do things.

Offline

#6 2013-07-19 04:40:00

polson136
Member
Registered: 2012-03-03
Posts: 39

Re: Running a graphical environment through systemd

The big hangup that I am concerned over is that I use the same startup scripts for everything. (ex: .vnc/xstartup -> .xsession)

If I start a systemd user session locally, then I log in through RDP, and run the same startup script, then, according to some tests that I have run via virtual terminal, systemctl would always control the rdp session, regardless of where I run it. That is the problem that I have. I want a startup sequence that I can run as many times as I feel like, concurrently (which I already have, just not with systemd).

If I go with one systemd instance starting a new unit for every login, then I have no foreground process to keep the session open in the eyes of the session manager, which would cause the session to instantly close.

Offline

#7 2013-07-19 09:08:50

EvanPurkhiser
Member
From: San Francisco
Registered: 2010-08-17
Posts: 225
Website

Re: Running a graphical environment through systemd

WonderWoofy wrote:

"systemd --user" is actually why systemd 205 will not come to our repos.  The cgroup changes break "systemd --user" and there are a pretty decent number of users who have configured their machines to use this (myself included)..

@WonderWoofy, are there any discussion threads going on about this? I've read through the NEWS for 205, but don't see what breaks systemd --user

Offline

#8 2013-07-19 10:36:26

Thaodan
Member
From: Dortmund, Nordrein-Westfalen
Registered: 2012-04-28
Posts: 448

Re: Running a graphical environment through systemd

This problem is with systemd --user is that when you use an complex DE like KDE or GNOME that you have to know how it works to call DE specific stuff like KDED (KDE inits some KDE Modules like Krandr for monitor management) for KDE.
I started to digged some idea how it could work: https://github.com/Thaodan/systemd-desktop-session


Linux odin 3.13.1-pf #1 SMP PREEMPT Wed Mar 5 21:47:28 CET 2014 x86_64 GNU/Linux

Offline

#9 2013-07-19 10:57:01

89c51
Member
Registered: 2012-06-05
Posts: 741

Re: Running a graphical environment through systemd

hijacking abit but wasn't  systemd --user supposed to be used by default at some point in Arch? Or we wait for upstream stuff??

Offline

#10 2013-07-19 11:31:20

Thaodan
Member
From: Dortmund, Nordrein-Westfalen
Registered: 2012-04-28
Posts: 448

Re: Running a graphical environment through systemd

89c51 wrote:

hijacking abit but wasn't  systemd --user supposed to be used by default at some point in Arch? Or we wait for upstream stuff??

I think we have to wait till DEs and login managers support this since some DE dependent stuff needs to figured out.


Linux odin 3.13.1-pf #1 SMP PREEMPT Wed Mar 5 21:47:28 CET 2014 x86_64 GNU/Linux

Offline

Board footer

Powered by FluxBB