Skip to content
Snippets Groups Projects
Commit 81235668 authored by Unit 193's avatar Unit 193
Browse files

d/rules, d/systemd/*: Add systemd user session, but only install it if building for Ubuntu.

parent 08b7ed82
No related branches found
Tags ubuntu/1%44.3-1ubuntu2
No related merge requests found
......@@ -9,6 +9,10 @@ export DEB_BUILD_MAINT_OPTIONS=hardening=+all
override_dh_install:
chmod 755 debian/xfce4-session/etc/xdg/xfce4/xinitrc
find debian/xfce4-session/usr/lib -name '*.la' -delete
ifeq ($(shell dpkg-vendor --derives-from ubuntu && echo 1),1)
dh_install debian/systemd/xfce4-session.service /usr/lib/systemd/user/
dh_install debian/systemd/run-systemd-session /usr/share/xfce4/scripts/
endif
dh_install
# default backend for Linux and Hurd
......
#!/bin/sh
set -e
# robustness: if the previous graphical session left some failed units,
# reset them so that they don't break this startup
for unit in $(systemctl --user --no-legend --state=failed list-units | cut -f1 -d' '); do
if [ "$(systemctl --user show -p PartOf --value)" = "graphical-session.target" ]; then
systemctl --user reset-failed $unit
fi
done
systemctl --user restart graphical-session-pre.target
systemctl --user restart "$1"
# Wait until the session gets closed
# FIXME: replace with an event-based waiting instead of polling (needs new systemctl functionality)
while systemctl --user --quiet is-active "$1"; do sleep 1; done
# Delay killing the X server until all graphical units stopped
# FIXME: we currently cannot make targets wait on its dependencies going to
# "inactive", only to "deactivating"
while [ -n "$(systemctl --user --no-legend --state=deactivating list-units)" ]; do sleep 0.2; done
[Unit]
Description=Xfce 4 Session Manager
PartOf=graphical-session.target
[Service]
ExecStart=/usr/bin/startxfce4
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment