summaryrefslogtreecommitdiffstats
path: root/units
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2024-03-26 13:19:33 +0100
committerGitHub <noreply@github.com>2024-03-26 13:19:33 +0100
commitc38e4e2fda402948ab213b53bbec059cc1a151ae (patch)
treeda7a15fc115b7edb3cc95743bcdc2b08ec5fa7d2 /units
parentbuild(deps): bump pkg/opensuse from `af49127` to `acdb1cd` (diff)
parentupdate TODO (diff)
downloadsystemd-c38e4e2fda402948ab213b53bbec059cc1a151ae.tar.xz
systemd-c38e4e2fda402948ab213b53bbec059cc1a151ae.zip
Merge pull request #29721 from poettering/systemd-project
New capsule@.service feature
Diffstat (limited to 'units')
-rw-r--r--units/capsule.slice13
-rw-r--r--units/capsule@.service.in33
-rw-r--r--units/meson.build2
-rw-r--r--units/user/capsule@.target15
-rw-r--r--units/user/meson.build1
5 files changed, 64 insertions, 0 deletions
diff --git a/units/capsule.slice b/units/capsule.slice
new file mode 100644
index 0000000000..cb8995a03f
--- /dev/null
+++ b/units/capsule.slice
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+#
+# 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=Capsule Slice
+Documentation=man:systemd.special(7)
+Before=slices.target
diff --git a/units/capsule@.service.in b/units/capsule@.service.in
new file mode 100644
index 0000000000..f2bb9e3a45
--- /dev/null
+++ b/units/capsule@.service.in
@@ -0,0 +1,33 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+#
+# 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=Capsule Service Manager for %i
+Documentation=man:capsule@.service(5)
+After=dbus.service systemd-oomd.service
+
+[Service]
+User=c-%i
+DynamicUser=yes
+Type=notify-reload
+ExecStart={{LIBEXECDIR}}/systemd --user --unit=capsule@%i.target
+Environment=HOME=/var/lib/capsules/%i
+Environment=XDG_RUNTIME_DIR=/run/capsules/%i
+StateDirectory=capsules/%i
+RuntimeDirectory=capsules/%i
+LogExtraFields=CAPSULE=%i
+Slice=capsule.slice
+KillMode=mixed
+Delegate=pids memory cpu
+DelegateSubgroup=init.scope
+TasksMax=infinity
+TimeoutStopSec={{ DEFAULT_USER_TIMEOUT_SEC*4//3 }}s
+KeyringMode=inherit
+OOMScoreAdjust=100
+MemoryPressureWatch=skip
diff --git a/units/meson.build b/units/meson.build
index 8808c5501c..953f8b0341 100644
--- a/units/meson.build
+++ b/units/meson.build
@@ -746,6 +746,8 @@ units = [
{ 'file' : 'user-runtime-dir@.service.in' },
{ 'file' : 'user.slice' },
{ 'file' : 'user@.service.in' },
+ { 'file' : 'capsule@.service.in' },
+ { 'file' : 'capsule.slice' },
{
'file' : 'var-lib-machines.mount',
'conditions' : ['ENABLE_MACHINED'],
diff --git a/units/user/capsule@.target b/units/user/capsule@.target
new file mode 100644
index 0000000000..986e3ad92e
--- /dev/null
+++ b/units/user/capsule@.target
@@ -0,0 +1,15 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+#
+# 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=Main Capsule Target for %i
+Documentation=man:systemd.special(7)
+Requires=basic.target
+After=basic.target
+AllowIsolate=yes
diff --git a/units/user/meson.build b/units/user/meson.build
index 850ac2c297..248745d933 100644
--- a/units/user/meson.build
+++ b/units/user/meson.build
@@ -11,6 +11,7 @@ units = [
'graphical-session.target',
'paths.target',
'printer.target',
+ 'capsule@.target',
'session.slice',
'shutdown.target',
'smartcard.target',