From a3081a7a898d84f9f52e39cf141a02d307dc22a2 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Tue, 28 Jul 2020 19:10:31 +0200 Subject: [PATCH] units: Add special Desktop Environment user related units This adds app.slice, session.slice and background.slice. --- units/user/app.slice | 12 ++++++++++++ units/user/background.slice | 12 ++++++++++++ units/user/meson.build | 3 +++ units/user/session.slice | 12 ++++++++++++ units/user/systemd-exit.service | 4 ++++ 5 files changed, 43 insertions(+) create mode 100644 units/user/app.slice create mode 100644 units/user/background.slice create mode 100644 units/user/session.slice diff --git a/units/user/app.slice b/units/user/app.slice new file mode 100644 index 0000000000..065ea77e96 --- /dev/null +++ b/units/user/app.slice @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=User Application Slice +Documentation=man:systemd.special(7) diff --git a/units/user/background.slice b/units/user/background.slice new file mode 100644 index 0000000000..03c89b66be --- /dev/null +++ b/units/user/background.slice @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=User Background Tasks Slice +Documentation=man:systemd.special(7) diff --git a/units/user/meson.build b/units/user/meson.build index 33732e7d59..744c1e7c5e 100644 --- a/units/user/meson.build +++ b/units/user/meson.build @@ -1,6 +1,8 @@ # SPDX-License-Identifier: LGPL-2.1+ units = [ + 'app.slice', + 'background.slice', 'basic.target', 'bluetooth.target', 'default.target', @@ -9,6 +11,7 @@ units = [ 'graphical-session.target', 'paths.target', 'printer.target', + 'session.slice', 'shutdown.target', 'smartcard.target', 'sockets.target', diff --git a/units/user/session.slice b/units/user/session.slice new file mode 100644 index 0000000000..e0b38c5e32 --- /dev/null +++ b/units/user/session.slice @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=User Core Session Slice +Documentation=man:systemd.special(7) diff --git a/units/user/systemd-exit.service b/units/user/systemd-exit.service index 1d3b61e3ab..87f906c3b7 100644 --- a/units/user/systemd-exit.service +++ b/units/user/systemd-exit.service @@ -14,3 +14,7 @@ DefaultDependencies=no Requires=shutdown.target After=shutdown.target SuccessAction=exit-force + +[Service] +# Place into the root slice to not keep another slice unit alive +Slice=-.slice -- 2.25.1