summaryrefslogtreecommitdiff
path: root/units/user
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-11-11 14:11:02 +0100
committerGitHub <noreply@github.com>2020-11-11 14:11:02 +0100
commit23dce98e89616092007005692a4574ab908db5a6 (patch)
tree829c00842440ba9fb8c42d765b25b341860ba45c /units/user
parentb5e798de20608266b6248367d939a645e4908483 (diff)
parent5ee24fa0a09ded9d842499a251e2e939a1a26b0b (diff)
downloadsystemd-23dce98e89616092007005692a4574ab908db5a6.tar.gz
Merge pull request #16603 from benzea/benzea/special-app-slice
Use app.slice by default in user manager (and define special user slices)
Diffstat (limited to 'units/user')
-rw-r--r--units/user/app.slice12
-rw-r--r--units/user/background.slice12
-rw-r--r--units/user/meson.build3
-rw-r--r--units/user/session.slice12
-rw-r--r--units/user/systemd-exit.service4
-rw-r--r--units/user/systemd-tmpfiles-clean.service1
6 files changed, 44 insertions, 0 deletions
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 b2a599b6d8..337a92092d 100644
--- a/units/user/meson.build
+++ b/units/user/meson.build
@@ -1,6 +1,8 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
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 91953e0524..18725253bb 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
diff --git a/units/user/systemd-tmpfiles-clean.service b/units/user/systemd-tmpfiles-clean.service
index ff319d2b3a..6a937071f7 100644
--- a/units/user/systemd-tmpfiles-clean.service
+++ b/units/user/systemd-tmpfiles-clean.service
@@ -19,3 +19,4 @@ Type=oneshot
ExecStart=systemd-tmpfiles --user --clean
SuccessExitStatus=DATAERR
IOSchedulingClass=idle
+Slice=background.slice