Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I start my window manager with systemd service units (following this tutorial). After I log in at tty1 the following gets executed in .zlogin (I'm using ZSH as a login shell):

if [[ -z "$DISPLAY" && $(tty) = /dev/tty1 ]]; then
  nohup systemd --user > ~/.xlog 2>&1 &
  disown %2

Systemd starts a X server, a window manager, ... through service units.

The problem starts when I want to logout.
Should I simply execute kill $MANAGERPID to kill the systemd daemon ?
It seems much cleaner to do a loginctl terminate-session $XDG_SESSION_ID but this command requires further privileges.

Here's the question: What is the preferred way to log out with the setup described above ?

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.