You are not logged in.
I wanted to see if anyone else is using systemd --user as their user session. I have a few questions, but first I'll just describe what I've done.
/usr/share/xsessions/systemd.desktop
[Desktop Entry]
Name=systemd
Exec=systemd --user
Type=XSessionThen, in $HOME/.config/systemd/usr/default.target.wants, I placed a bunch of services for my desktop session. Right now, these are:
bluetooth-applet.service
dock.service
gnome-settings-daemon.service
nm-applet.service
openbox.service
xcompmgr.serviceI plan on making up a whole bunch of these, and possibly hosting them on github/aur if there is interest.
Question one, how can I have a user service depend on a system service?
bluetooth-applet.service:
[Unit]
Description=Bluetooth Manager Applet
Requisite=bluetooth.service
[Service]
ExecStart=/usr/bin/bluetooth-appletI'm probably doing something wrong, because the applet is starting anyway, but bluetooth.service is definitely not running on my system.
Question two, what are my options for ending my session? Right now, I'm just doing pkill systemd Is there a way for systemd --user to exist if a specific unit exists? (openbox.service for example)
Offline
1. As far as I know, you can't directly. However, you can use many of the system-wide targets (network.target, bluetooth.target, etc).
2. Why not just just exit with `systemctl --user exit`? This will bring down any running units (your window manager included). If you want a system that allows simultaneous logins, you can try something like: http://www.mail-archive.com/systemd-dev … 06065.html
Offline
1. As far as I know, you can't directly. However, you can use many of the system-wide targets (network.target, bluetooth.target, etc).
I'm not following. I don't want to start a system/bluetooth.service. I want user/bluetooth-applet.service to only start if system/bluetooth.service is running.
2. Why not just just exit with `systemctl --user exit`? This will bring down any running units (your window manager included). If you want a system that allows simultaneous logins, you can try something like: http://www.mail-archive.com/systemd-dev … 06065.html
That's the same as using pkill. I'm looking for a way to stop a particular service and have the trigger systemd --user exit. I wonder if it will be overkill to write a DBus daemon that listens for the standard freedesktop.org/gnome logout() api.
Offline
Stebalien wrote:1. As far as I know, you can't directly. However, you can use many of the system-wide targets (network.target, bluetooth.target, etc).
I'm not following. I don't want to start a system/bluetooth.service. I want user/bluetooth-applet.service to only start if system/bluetooth.service is running.
I've been reading through the systemd mailing lists recently, and as far as I recall, that is not yet properly implemented. Your system-wide instance of systemd would have to be able to "talk" to the user instance over dbus, and vice versa. There are a few things left to be ironed out for that, especially with regards to seat management.
I'll post a few mails I've collected since I've been meaning to get systemd --user to work as well.
This is Auke Kok's first mail on the subject, in which he explains how he managed to get systemd --user to work in Tizen (it seemed to be a simple environment, with a single, automatically logged-on user). This is basically Tizen's systemd --user implementation adapted for PCs (the package mentioned in this mail is in the AUR).
The most insightful mails with regard to your problem are probably this one and this one. Here Auke describes some of the problems with dbus which seemed relevant enough to me, and here another user describes the problems with using systemd --user over SSH (which might be related to seat management as well).
Last edited by Runiq (2012-09-06 21:06:15)
Offline
Here is a bug report (w/ patch) about getting dbus --session and systemd --user to work together: https://bugs.freedesktop.org/show_bug.cgi?id=50962
Offline
ignore, sry
Last edited by sunite (2012-09-21 18:36:36)
Offline
So the stuff that Auke Kok is doing the work of the display manager. What I was originally getting as was the next step in the desktop process.
What I've done is created .service files for all of the stuff I want to be started when I log in. That includes openbox, cairo-dock, and some other applets and daemons. When I log in (using LXDM), I have a very short .Xsession script that launches dbus, and then execs as gnome-session. My gnome-session does nothing but start systemd --user, and my default.target.wants has all of my service files.
The next step is to be able to start gnome-session from systemd. To do this I'd need a way of getting the SESSION_MANAGER environmental variable that gnome-session gives to all of its children.
A similar step is needed for DBUS, but this is easier because dbus-daemon allows you to set the bus address. Anyone know how to do this for gnome-session?
Offline
One of my original questions was how to have a user unit dependant on a system unit. By default, there is a bluetooth.target in user that's a symlink to system. For bluetooth-applet Requisite=bluetooth.target, the behavior is exactly what I want.
This doesn't work for nm-applet though. I have a symlink to the system NetworkManager.service, but the user session doesn't see it as active.
Also, I've managed to start dbus-daemon --session from within systemd --user, but it requires a patch to dbus.
Offline