Skip to content
Automatic X login service for systemd
Branch: master
Clone or download
joukewitteveen README update
- Document the installation parameters
- Drop the mention about setting up the session bus as systemd
  correctly sets it up
Latest commit 6e566b5 Sep 28, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
25-xlogin.sh.in
LICENSE
Makefile Add .sh suffix to the xinitrc file Jun 13, 2016
README README update Sep 29, 2016
x-daemon.in
x@.service Remove '-nolisten tcp' as it is the default Sep 30, 2015
xlogin@.service.in Set logind session type Jun 13, 2016

README

These files make it possible to login to X without a desktop manager.


Installation
============

Several variables are supported by the installation through make:
# make [DESTDIR=</stage/path>] [BASH=</path/to/bash>]
       [SHELL=</current/path/to/bash>] [install]

DESTDIR
-------
The DESTDIR path is prepended to each target in the installation, making staged
installs possible. Empty by default.

BASH
----
The path to the Bash executable used by xlogin. Defaults to /usr/bin/bash.

SHELL
-----
The path to the Bash executable used by make. Defaults to the value of BASH.


Usage
=====

To enable automatic login at boot, execute:
# systemctl enable xlogin@<username>

The xlogin service sets up a user session and runs the .xinitrc script of the
user. Several actions are available to the user.

Logout
------
$ loginctl terminate-session "$XDG_SESSION_ID"
or
$ systemctl --user exit

Shutdown
--------
$ systemctl poweroff
If no other users are logged in, this does not require a password.

Reboot
------
$ systemctl reboot
If no other users are logged in, this does not require a password.


Files
=====

Makefile
--------
This makes installation through
# make install
possible.

x-daemon
--------
This script makes starting X as a daemon possible. It is needed by the systemd
service that manages X.

x@.service
----------
This service governs an X session on a specified VT. It is of little use on its
own.

xlogin@.service
---------------
This service is responsible for setting up the user session and running the
user's .xinitrc script. The script should not return.

25-xlogin.sh
------------
This script makes sure the systemd user dbus socket is not reused for the
user's X session. Its invocation is guaranteed by having the following on top
of your .xinitrc:

    if [ -d /etc/X11/xinit/xinitrc.d ]; then
        for f in /etc/X11/xinit/xinitrc.d/*; do
            [ -x "$f" ] && . "$f"
        done
        unset f
    fi

As a consequence, systemd commands that interface the user session will no
longer be able to communicate with the systemd instance. To alleviate this
problem, include the following in your .bashrc:

    for sd_cmd in systemctl systemd-analyze systemd-run; do
        alias $sd_cmd='DBUS_SESSION_BUS_ADDRESS="unix:path=$XDG_RUNTIME_DIR/bus" '$sd_cmd
    done

You can’t perform that action at this time.