summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO397
-rw-r--r--man/logind.conf.xml15
-rw-r--r--man/systemd-system.conf.xml17
-rw-r--r--man/systemd.resource-control.xml5
-rw-r--r--man/systemd.time.xml4
-rw-r--r--man/tmpfiles.d.xml16
-rw-r--r--src/basic/btrfs-util.c49
-rw-r--r--src/basic/btrfs-util.h4
-rw-r--r--src/basic/time-util.c71
-rw-r--r--src/core/dbus-manager.c14
-rw-r--r--src/core/load-fragment-gperf.gperf.m42
-rw-r--r--src/core/load-fragment.c7
-rw-r--r--src/core/main.c9
-rw-r--r--src/core/manager.c2
-rw-r--r--src/core/manager.h1
-rw-r--r--src/core/scope.c14
-rw-r--r--src/core/slice.c1
-rw-r--r--src/core/system.conf3
-rw-r--r--src/core/unit.c6
-rw-r--r--src/core/unit.h3
-rw-r--r--src/login/logind-dbus.c94
-rw-r--r--src/login/logind-gperf.gperf1
-rw-r--r--src/login/logind-session.c26
-rw-r--r--src/login/logind-user.c54
-rw-r--r--src/login/logind.c1
-rw-r--r--src/login/logind.conf1
-rw-r--r--src/login/logind.h4
-rw-r--r--src/nspawn/nspawn-register.c4
-rw-r--r--src/test/test-cgroup-mask.c10
-rw-r--r--src/tmpfiles/tmpfiles.c24
-rw-r--r--units/systemd-nspawn@.service.in1
31 files changed, 515 insertions, 345 deletions
diff --git a/TODO b/TODO
index f32e53f7e9..10a20758ba 100644
--- a/TODO
+++ b/TODO
@@ -48,22 +48,14 @@ Features:
* push CPUAffinity= also into the "cpuset" cgroup controller (only after the cpuset controller got ported to the unified hierarchy)
-* add a concept of RemainAfterExit= to scope units
-
* add a new command "systemctl revert" or so, that removes all dropin
snippets in /run and /etc, and all unit files with counterparts in
/usr, and thus undoes what "systemctl set-property" and "systemctl
edit" create. Maybe even add "systemctl revert -a" to do this for
all units.
-* sd-event: maybe add support for inotify events
-
* PID 1 should send out sd_notify("WATCHDOG=1") messages (for usage in the --user mode, and when run via nspawn)
-* nspawn should send out sd_notify("WATCHDOG=1") messages
-
-* nspawn should optionally support receiving WATCHDOG=1 messages from its payload PID 1...
-
* consider throwing a warning if a service declares it wants to be "Before=" a .device unit.
* "systemctl edit" should know a mode to create a new unit file
@@ -73,62 +65,17 @@ Features:
prefixed with /sys generally special.
http://lists.freedesktop.org/archives/systemd-devel/2015-June/032962.html
-* nspawn: fix logic always print a final newline on output.
- https://github.com/systemd/systemd/pull/272#issuecomment-113153176
-
* man: document that unless you use StandardError=null the shell >/dev/stderr won't work in shell scripts in services
* "systemctl daemon-reload" should result in /etc/systemd/system.conf being reloaded by systemd
* install: include generator dirs in unit file search paths
-* logind: follow PropertiesChanged state more closely, to deal with quick logouts and relogins
-
* invent a better systemd-run scheme for naming scopes, that works with remoting
-* add journalctl -H that talks via ssh to a remote peer and passes through binary logs data
-
-* change journalctl -M to acquire fd to journal directory via machined, and then operate on that via openat() instead of absolute paths
-
-* add a version of --merge which also merges /var/log/journal/remote
-
-* log accumulated resource usage after each service invocation
-
-* nspawn: a nice way to boot up without machine id set, so that it is set at boot automatically for supporting --ephemeral. Maybe hash the host machine id together with the machine name to generate the machine id for the container
-
-* logind: rename session scope so that it includes the UID. THat way
- the session scope can be arranged freely in slices and we don't have
- make assumptions about their slice anymore.
-
-* journalctl: -m should access container journals directly by enumerating them via machined, and also watch containers coming and going. Benefit: nspawn --ephemeral would start working nicely with the journal.
-
-* nspawn: don't copy /etc/resolv.conf from host into container unless we are in shared-network mode
-
-* nspawn: optionally automatically add FORWARD rules to iptables whenever nspawn is running, remove them when shut down.
-
-* importd: generate a nice warning if mkfs.btrfs is missing
-
-* nspawn: add a logic for cleaning up read-only, hidden container images in /var/lib/machines that are not ancestors of any non-hidden containers
-
-* nspawn: Improve error message when --bind= is used on a non-existing source directory
-
-* nspawn: maybe make copying of /etc/resolv.conf optional, and skip it if --read-only is used
-
-* man: document how update dkr images works with machinectl
- http://lists.freedesktop.org/archives/systemd-devel/2015-February/028630.html
-
-* nspawn: as soon as networkd has a bus interface, hook up --network-interface=, --network-bridge= with networkd, to trigger netdev creation should an interface be missing
-
* rework C11 utf8.[ch] to use char32_t instead of uint32_t when referring
to unicode chars, to make things more expressive.
-* "machinectl migrate" or similar to copy a container from or to a
- difference host, via ssh
-
-* tmpfiles: creating new directories/subvolumes/fifos/device nodes
- should not follow symlinks. None of the other adjustment or creation
- calls follow symlinks.
-
* fstab-generator: default to tmpfs-as-root if only usr= is specified on the kernel cmdline
* docs: bring http://www.freedesktop.org/wiki/Software/systemd/MyServiceCantGetRealtime up to date
@@ -145,84 +92,21 @@ Features:
* Maybe add support for the equivalent of "ethtool advertise" to .link files?
http://lists.freedesktop.org/archives/systemd-devel/2015-April/030112.html
-* .timer units should optionally support CLOCK_BOOTTIME in addition to CLOCK_MONOTONIC
-
-* When logging about multiple units (stopping BoundTo units, conflicts, etc.),
- log both units as UNIT=, so that journalctl -u triggers on both.
-
-* to allow "linking" of nspawn containers, extend --network-bridge= so
- that it can dynamically create bridge interfaces that are refcounted
- by the containers on them. For each group of containers to link together
-
-* journalctl --verify: don't show files that are currently being
- written to as FAIL, but instead show that their are being written
- to.
-
-* assign MESSAGE_ID to log messages about failed services
-
-* coredump: make the handler check /proc/$PID/rlimits for RLIMIT_CORE,
- and supress coredump if turned off. Then change RLIMIT_CORE to
- infinity by default for all services. This then allows per-service
- control of coredumping.
-
-* generate better errors when people try to set transient properties
- that are not supported...
- http://lists.freedesktop.org/archives/systemd-devel/2015-February/028076.html
-
-* maybe introduce WantsMountsFor=? Usecase:
- http://lists.freedesktop.org/archives/systemd-devel/2015-January/027729.html
-
* The udev blkid built-in should expose a property that reflects
whether media was sensed in USB CF/SD card readers. This should then
be used to control SYSTEMD_READY=1/0 so that USB card readers aren't
picked up by systemd unless they contain a medium. This would mirror
the behaviour we already have for CD drives.
-* nspawn: emulate /dev/kmsg using CUSE and turn off the syslog syscall
- with seccomp. That should provide us with a useful log buffer that
- systemd can log to during early boot, and disconnect container logs
- from the kernel's logs.
-
* networkd/udev: implement SR_IOV configuration in .link files:
http://lists.freedesktop.org/archives/systemd-devel/2015-January/027451.html
-* Set RLIMIT_NPROC for systemd-journal-xyz, and all other of our
- services that run under their own user ids, and use User= (but only
- in a world where userns is ubiquitous since otherwise we cannot
- invoke those daemons on the host AND in a container anymore). Also,
- if LimitNPROC= is used without User= we should warn and refuse
- operation.
-
-* logind: maybe allow configuration of the StopTimeout for session scopes
-
-* Set NoNewPrivileges= on all of our own services, where that makes sense
-
* Rework systemctl's GetAll property parsing to use the generic bus_map_all_properties() API
-* rework journald sigbus stuff to use mutex
-
-* import-dkr: support tarsum checksum verification, if it becomes reality one day...
-
-* import-dkr: convert json bits to nspawn configuration
-
* core/cgroup: support net_cls modules, and support automatically allocating class ids, then add support for making firewall changes depending on it, to implement a per-service firewall
-* introduce systemd-nspawn-ephemeral@.service, and hook it into "machinectl start" with a new --ephemeral switch
-
-* "machinectl status" should also show internal logs of the container in question
-
-* "machinectl list-images" should show os-release data, as well as machine-info data (including deployment level)
-
* Port various tools to make use of verbs.[ch], where applicable
-* "machinectl history"
-
-* "machinectl diff"
-
-* "machinectl commit" that takes a writable snapshot of a tree, invokes a shell in it, and marks it read-only after use
-
-* systemd-nspawn -x should support ephemeral instances of gpt images
-
* hostnamectl: show root image uuid
* sysfs set api in libudev is not const
@@ -235,15 +119,6 @@ Features:
ensure deterministic behaviour if two unit files conflict (like DMs
do, for example)
-* resolved should optionally register additional per-interface LLMNR
- names, so that for the container case we can establish the same name
- (maybe "host") for referencing the server, everywhere.
-
-* systemd-journal-upload (or a new, related tool): allow pushing out
- journal messages onto the network in BSD syslog protocol,
- continuously. Default to some link-local IP mcast group, to make this
- useful as a one-stop debugging tool.
-
* synchronize console access with BSD locks:
http://lists.freedesktop.org/archives/systemd-devel/2014-October/024582.html
@@ -263,12 +138,8 @@ Features:
* firstboot: make it useful to be run immediately after yum --installroot to set up a machine. (most specifically, make --copy-root-password work even if /etc/passwd already exists
-* timesyncd + resolved: add ugly bus calls to set NTP and DNS servers per-interface, for usage by NM
-
* add infrastructure to allocate dynamic/transient users and UID ranges, for use in user-namespaced containers, per-seat gdm login screens and gdm guest sessions
-* machined: add an API so that libvirt-lxc can inform us about network interfaces being removed or added to an existing machine
-
* maybe add support for specifier expansion in user.conf, specifically DefaultEnvironment=
* introduce systemd-timesync-wait.service or so to sync on an NTP fix?
@@ -277,8 +148,6 @@ Features:
* consider showing the unit names during boot up in the status output, not just the unit descriptions
-* dhcp: do we allow configuring dhcp routes on interfaces that are not the one we got the dhcp info from?
-
* maybe allow timer units with an empty Units= setting, so that they
can be used for resuming the system but nothing else.
@@ -288,12 +157,8 @@ Features:
* maybe support a new very "soft" reboot mode, that simply kills all processes, disassembles everything, flushes /run and sysvipc, and then reexecs systemd again
-* man: document that corrupted journal files is nothing to act on
-
* man: maybe use the word "inspect" rather than "introspect"?
-* "machinectl list" should probably show columns for OS version and IP addresses
-
* systemctl: if some operation fails, show log output?
* systemctl edit:
@@ -301,10 +166,10 @@ Features:
- use equvalent of cat() to insert existing config as a comment, prepended with #.
Upon editor exit, lines with one # are removed, lines with two # are left with one #, etc.
-* refcounting in sd-resolve is borked
-
* exponential backoff in timesyncd and resolved when we cannot reach a server
+* timesyncd + resolved: add ugly bus calls to set NTP and DNS servers per-interface, for usage by NM
+
* extract_many_words() should probably be used by a lot of code that
currently uses FOREACH_WORD and friends. For example, most conf
parsing callbacks should use it.
@@ -317,24 +182,6 @@ Features:
* add systemd.abort_on_kill or some other such flag to send SIGABRT instead of SIGKILL
(throughout the codebase, not only PID1)
-* networkd:
- - add LLDP client side support
- - the DHCP lease data (such as NTP/DNS) is still made available when
- a carrier is lost on a link. It should be removed instantly.
- - expose in the API the following bits:
- - option 15, domain name and/or option 119, search list
- - option 12, host name and/or option 81, fqdn
- - option 123, 144, geolocation
- - option 252, configure http proxy (PAC/wpad)
- - provide a way to define a per-network interface default metric value
- for all routes to it. possibly a second default for DHCP routes.
- - allow Name= to be specified repeatedly in the [Match] section. Maybe also
- support Name=foo*|bar*|baz ?
- - duplicate address check for static IPs (like ARPCHECK in network-scripts)
- - allow DUID/IAID to be customized, see issue #394.
- - support configuration option for TSO (tcp segmentation offload)
- - networkd: whenever uplink info changes, make DHCP server send out FORCERENEW
-
* resolved:
- put networkd events and rtnl events at a higher priority, so that
we always process them before we process client requests
@@ -350,8 +197,11 @@ Features:
announce dname support. However, for DNSSEC it is necessary as the synthesized cname
will not be signed.
- cname on PTR (?)
+ - resolved should optionally register additional per-interface LLMNR
+ names, so that for the container case we can establish the same name
+ (maybe "host") for referencing the server, everywhere.
-* Allow multiple ExecStart= for all Type= settings, so that we can cover rescue.service nicely
+* refcounting in sd-resolve is borked
* Add a new verb "systemctl top"
@@ -376,14 +226,8 @@ Features:
* Run most system services with cgroupfs read-only and procfs with a more secure mode (doesn't work, since the hidepid= option is per-pid-namespace, not per-mount)
-* sd-event: generate a failure of a default event loop is executed out-of-thread
-
* add bus api to query unit file's X fields.
-* consider adding RuntimeDirectoryUser= + RuntimeDirectoryGroup=
-
-* sd-event: define more intervals where we will shift wakeup intervals around in, 1h, 6h, 24h, ...
-
* gpt-auto-generator:
- Support LUKS for root devices
- Define new partition type for encrypted swap? Support probed LUKS for encrypted swap?
@@ -434,8 +278,6 @@ Features:
* when we detect low battery and no AC on boot, show pretty splash and refuse boot
-* machined, localed: when we try to kill an empty cgroup, generate an ESRCH error over the bus
-
* libsystemd-journal, libsystemd-login, libudev: add calls to easily attach these objects to sd-event event loops
* be more careful what we export on the bus as (usec_t) 0 and (usec_t) -1
@@ -493,6 +335,9 @@ Features:
* sd-event
- allow multiple signal handlers per signal?
- document chaining of signal handler for SIGCHLD and child handlers
+ - define more intervals where we will shift wakeup intervals around in, 1h, 6h, 24h, ...
+ - generate a failure of a default event loop is executed out-of-thread
+ - maybe add support for inotify events
* in the final killing spree, detect processes from the root directory, and
complain loudly if they have argv[0][0] == '@' set.
@@ -537,14 +382,10 @@ Features:
* systemd-inhibit: make taking delay locks useful: support sending SIGINT or SIGTERM on PrepareForSleep()
-* journal-or-kmsg is currently broken? See reverted commit 4a01181e460686d8b4a543b1dfa7f77c9e3c5ab8.
-
* remove any syslog support from log.c -- we probably cannot do this before split-off udev is gone for good
* shutdown logging: store to EFI var, and store to USB stick?
-* write UI tool that pops up emergency messages from the journal as notification
-
* think about window-manager-run-as-user-service problem: exit 0 → activate shutdown.target; exit != 0 → restart service
* merge unit_kill_common() and unit_kill_context()
@@ -587,6 +428,12 @@ Features:
probably reduce the capability set it retains substantially.
(we need CAP_SYS_ADMIN for drmSetMaster(), so maybe not worth it)
- expose orientation sensors and tablet mode through logind
+ - maybe allow configuration of the StopTimeout for session scopes
+ - rename session scope so that it includes the UID. THat way
+ the session scope can be arranged freely in slices and we don't have
+ make assumptions about their slice anymore.
+ - follow PropertiesChanged state more closely, to deal with quick logouts and
+ relogins
* exec: when deinitializating a tty device fix the perms and group, too, not only when initializing. Set access mode/gid to 0620/tty.
@@ -641,6 +488,32 @@ Features:
lazily. Encode just enough information in the file name, so that we
do not have to open it to know that it is not interesting for us, for
the most common operations.
+ - journal-or-kmsg is currently broken? See reverted
+ commit 4a01181e460686d8b4a543b1dfa7f77c9e3c5ab8.
+ - man: document that corrupted journal files is nothing to act on
+ - systemd-journal-upload (or a new, related tool): allow pushing out
+ journal messages onto the network in BSD syslog protocol,
+ continuously. Default to some link-local IP mcast group, to make this
+ useful as a one-stop debugging tool.
+ - rework journald sigbus stuff to use mutex
+ - Set RLIMIT_NPROC for systemd-journal-xyz, and all other of our
+ services that run under their own user ids, and use User= (but only
+ in a world where userns is ubiquitous since otherwise we cannot
+ invoke those daemons on the host AND in a container anymore). Also,
+ if LimitNPROC= is used without User= we should warn and refuse
+ operation.
+ - journalctl --verify: don't show files that are currently being
+ written to as FAIL, but instead show that their are being written to.
+ - add journalctl -H that talks via ssh to a remote peer and passes through
+ binary logs data
+ - change journalctl -M to acquire fd to journal directory via machined, and
+ then operate on that via openat() instead of absolute paths
+ - add a version of --merge which also merges /var/log/journal/remote
+ - log accumulated resource usage after each service invocation
+ - journalctl: -m should access container journals directly by enumerating
+ them via machined, and also watch containers coming and going.
+ Benefit: nspawn --ephemeral would start working nicely with the journal.
+ - assign MESSAGE_ID to log messages about failed services
* document:
- document that deps in [Unit] sections ignore Alias= fields in
@@ -685,8 +558,6 @@ Features:
* add libsystemd-password or so to query passwords during boot using the password agent logic
-* If we show an error about a unit (such as not showing up) and it has no Description string, then show a description string generated form the reverse of unit_name_mangle().
-
* clean up date formatting and parsing so that all absolute/relative timestamps we format can also be parsed
* on shutdown: move utmp, wall, audit logic all into PID 1 (or logind?), get rid of systemd-update-utmp-runlevel
@@ -699,7 +570,62 @@ Features:
* currently x-systemd.timeout is lost in the initrd, since crypttab is copied into dracut, but fstab is not
* nspawn:
- - refuses to boot containers without /etc/machine-id (OK?), and with empty /etc/machine-id (not OK).
+ - to allow "linking" of nspawn containers, extend --network-bridge= so
+ that it can dynamically create bridge interfaces that are refcounted
+ by the containers on them. For each group of containers to link together
+ - refuses to boot containers without /etc/machine-id (OK?), and with empty
+ /etc/machine-id (not OK).
+ - nspawn -x should support ephemeral instances of gpt images
+ - emulate /dev/kmsg using CUSE and turn off the syslog syscall
+ with seccomp. That should provide us with a useful log buffer that
+ systemd can log to during early boot, and disconnect container logs
+ from the kernel's logs.
+ - as soon as networkd has a bus interface, hook up --network-interface=,
+ --network-bridge= with networkd, to trigger netdev creation should an
+ interface be missing
+ - don't copy /etc/resolv.conf from host into container unless we are in
+ shared-network mode
+ - a nice way to boot up without machine id set, so that it is set at boot
+ automatically for supporting --ephemeral. Maybe hash the host machine id
+ together with the machine name to generate the machine id for the container
+ - fix logic always print a final newline on output.
+ https://github.com/systemd/systemd/pull/272#issuecomment-113153176
+ - should optionally support receiving WATCHDOG=1 messages from its payload
+ PID 1...
+ - should send out sd_notify("WATCHDOG=1") messages
+ - optionally automatically add FORWARD rules to iptables whenever nspawn is
+ running, remove them when shut down.
+ - add a logic for cleaning up read-only, hidden container images in
+ /var/lib/machines that are not ancestors of any non-hidden containers
+ - Improve error message when --bind= is used on a non-existing source
+ directory
+ - maybe make copying of /etc/resolv.conf optional, and skip it if --read-only
+ is used
+
+* machined:
+ - "machinectl list" should probably show columns for OS version and IP
+ addresses
+ - add an API so that libvirt-lxc can inform us about network interfaces being
+ removed or added to an existing machine
+ - "machinectl migrate" or similar to copy a container from or to a
+ difference host, via ssh
+ - man: document how update dkr images works with machinectl
+ http://lists.freedesktop.org/archives/systemd-devel/2015-February/028630.html
+ - introduce systemd-nspawn-ephemeral@.service, and hook it into
+ "machinectl start" with a new --ephemeral switch
+ - "machinectl status" should also show internal logs of the container in
+ question
+ - "machinectl list-images" should show os-release data, as well as
+ machine-info data (including deployment level)
+ - "machinectl history"
+ - "machinectl diff"
+ - "machinectl commit" that takes a writable snapshot of a tree, invokes a
+ shell in it, and marks it read-only after use
+
+* importd:
+ - dkr: support tarsum checksum verification, if it becomes reality one day...
+ - dkr: convert json bits to nspawn configuration
+ - generate a nice warning if mkfs.btrfs is missing
* cryptsetup:
- cryptsetup-generator: allow specification of passwords in crypttab itself
@@ -710,40 +636,16 @@ Features:
* hw watchdog: optionally try to use the preset watchdog timeout instead of always overriding it
https://bugs.freedesktop.org/show_bug.cgi?id=54712
-* after deserializing sockets in socket.c we should reapply sockopts and things
-
-* make timer units go away after they elapsed
-
-* move PID 1 segfaults to /var/lib/systemd/coredump?
-
* create /sbin/init symlinks from the build system
-* allow writing multiple conditions in unit files on one line
-
* MountFlags=shared acts as MountFlags=slave right now.
-* drop PID 1 reloading, only do reexecing (difficult: Reload()
- currently is properly synchronous, Reexec() is weird, because we
- cannot delay the response properly until we are back, so instead of
- being properly synchronous we just keep open the fd and close it
- when done. That means clients do not get a successful method reply,
- but much rather a disconnect on success.
-
* properly handle loop back mounts via fstab, especially regards to fsck/passno
* initialize the hostname from the fs label of /, if /etc/hostname does not exist?
* rename "userspace" to "core-os"
-* load-fragment: when loading a unit file via a chain of symlinks
- verify that it is not masked via any of the names traversed.
-
-* introduce Type=pid-file
-
-* when breaking cycles drop sysv services first, then services from /run, then from /etc, then from /usr
-
-* ExecOnFailure=/usr/bin/foo
-
* udev:
- move to LGPL
- kill scsi_id
@@ -752,13 +654,17 @@ Features:
* when a service has the same env var set twice we actually store it twice and return that in systemctl show -p... We should only show the last setting
-* introduce mix of BindTo and Requisite
-
* There's currently no way to cancel fsck (used to be possible via C-c or c on the console)
* add option to sockets to avoid activation. Instead just drop packets/connections, see http://cyberelk.net/tim/2012/02/15/portreserve-systemd-solution/
-* save coredump in Windows/Mozilla minidump format
+* coredump:
+ - save coredump in Windows/Mozilla minidump format
+ - move PID 1 segfaults to /var/lib/systemd/coredump?
+ - make the handler check /proc/$PID/rlimits for RLIMIT_CORE,
+ and supress coredump if turned off. Then change RLIMIT_CORE to
+ infinity by default for all services. This then allows per-service
+ control of coredumping.
* support crash reporting operation modes (https://live.gnome.org/GnomeOS/Design/Whiteboards/ProblemReporting)
@@ -767,31 +673,16 @@ Features:
* be able to specify a forced restart of service A where service B depends on, in case B
needs to be auto-respawned?
-* when a bus name of a service disappears from the bus make sure to queue further activation requests
-
* tmpfiles:
- apply "x" on "D" too (see patch from William Douglas)
- replace F with f+.
- instead of ignoring unknown fields, reject them.
-
-* for services: do not set $HOME in services unless requested
-
-* hide PAM options in fragment parser when compile time disabled
-
-* when we automatically restart a service, ensure we restart its rdeps, too.
-
-* allow Type=simple with PIDFile=
- https://bugzilla.redhat.com/show_bug.cgi?id=723942
-
-* move PAM code into its own binary
-
-* implement Register= switch in .socket units to enable registration
- in Avahi, RPC and other socket registration services.
+ - creating new directories/subvolumes/fifos/device nodes
+ should not follow symlinks. None of the other adjustment or creation
+ calls follow symlinks.
* make sure systemd-ask-password-wall does not shutdown systemd-ask-password-console too early
-* add ReloadSignal= for configuring a reload signal to use
-
* verify that the AF_UNIX sockets of a service in the fs still exist
when we start a service in order to avoid confusion when a user
assumes starting a service is enough to make it accessible
@@ -801,8 +692,6 @@ Features:
* and a dbus call to generate target from current state
-* GC unreferenced jobs (such as .device jobs)
-
* write blog stories about:
- hwdb: what belongs into it, lsusb
- enabling dbus services
@@ -823,20 +712,59 @@ Features:
- instantiated apache, dovecot and so on
- hooking a script into various stages of shutdown/rearly booot
-* allow port=0 in .socket units
-
-* recreate systemd's D-Bus private socket file on SIGUSR2
-
-* Support --test based on current system state
-
* investigate whether the gnome pty helper should be moved into systemd, to provide cgroup support.
-* maybe introduce ExecRestartPre=
-
* dot output for --test showing the 'initial transaction'
* fingerprint.target, wireless.target, gps.target, netdevice.target
+* pid1:
+ - .timer units should optionally support CLOCK_BOOTTIME in addition to CLOCK_MONOTONIC
+ - When logging about multiple units (stopping BoundTo units, conflicts, etc.),
+ log both units as UNIT=, so that journalctl -u triggers on both.
+ - generate better errors when people try to set transient properties
+ that are not supported...
+ http://lists.freedesktop.org/archives/systemd-devel/2015-February/028076.html
+ - maybe introduce WantsMountsFor=? Usecase:
+ http://lists.freedesktop.org/archives/systemd-devel/2015-January/027729.html
+ - recreate systemd's D-Bus private socket file on SIGUSR2
+ - GC unreferenced jobs (such as .device jobs)
+ - move PAM code into its own binary
+ - when we automatically restart a service, ensure we restart its rdeps, too.
+ - for services: do not set $HOME in services unless requested
+ - hide PAM options in fragment parser when compile time disabled
+ - Support --test based on current system state
+ - If we show an error about a unit (such as not showing up) and it has no Description string, then show a description string generated form the reverse of unit_name_mangle().
+ - after deserializing sockets in socket.c we should reapply sockopts and things
+ - make timer units go away after they elapsed
+ - drop PID 1 reloading, only do reexecing (difficult: Reload()
+ currently is properly synchronous, Reexec() is weird, because we
+ cannot delay the response properly until we are back, so instead of
+ being properly synchronous we just keep open the fd and close it
+ when done. That means clients do not get a successful method reply,
+ but much rather a disconnect on success.
+ - when breaking cycles drop sysv services first, then services from /run, then from /etc, then from /usr
+ - when a bus name of a service disappears from the bus make sure to queue further activation requests
+
+* unit files:
+ - allow port=0 in .socket units
+ - maybe introduce ExecRestartPre=
+ - add ReloadSignal= for configuring a reload signal to use
+ - implement Register= switch in .socket units to enable registration
+ in Avahi, RPC and other socket registration services.
+ - allow Type=simple with PIDFile=
+ https://bugzilla.redhat.com/show_bug.cgi?id=723942
+ - allow writing multiple conditions in unit files on one line
+ - load-fragment: when loading a unit file via a chain of symlinks
+ verify that it is not masked via any of the names traversed.
+ - introduce Type=pid-file
+ - ExecOnFailure=/usr/bin/foo
+ - introduce mix of BindTo and Requisite
+ - add a concept of RemainAfterExit= to scope units
+ - Set NoNewPrivileges= on all of our own services, where that makes sense
+ - Allow multiple ExecStart= for all Type= settings, so that we can cover rescue.service nicely
+ - consider adding RuntimeDirectoryUser= + RuntimeDirectoryGroup=
+
* systemd-python:
- figure out a simple way to wait for journal events in a way that
works with ^C
@@ -868,6 +796,23 @@ Features:
- add more attribute support for SIT tunnel
- work with non-Ethernet devices
- add support for more bond options
+ - dhcp: do we allow configuring dhcp routes on interfaces that are not the one we got the dhcp info from?
+ - add LLDP client side support
+ - the DHCP lease data (such as NTP/DNS) is still made available when
+ a carrier is lost on a link. It should be removed instantly.
+ - expose in the API the following bits:
+ - option 15, domain name and/or option 119, search list
+ - option 12, host name and/or option 81, fqdn
+ - option 123, 144, geolocation
+ - option 252, configure http proxy (PAC/wpad)
+ - provide a way to define a per-network interface default metric value
+ for all routes to it. possibly a second default for DHCP routes.
+ - allow Name= to be specified repeatedly in the [Match] section. Maybe also
+ support Name=foo*|bar*|baz ?
+ - duplicate address check for static IPs (like ARPCHECK in network-scripts)
+ - allow DUID/IAID to be customized, see issue #394.
+ - support configuration option for TSO (tcp segmentation offload)
+ - whenever uplink info changes, make DHCP server send out FORCERENEW
* networkd-wait-online:
- make operstates to wait for configurable?
diff --git a/man/logind.conf.xml b/man/logind.conf.xml
index 43d1ffbd3c..94376656d5 100644
--- a/man/logind.conf.xml
+++ b/man/logind.conf.xml
@@ -1,4 +1,4 @@
-<?xml version='1.0'?> <!--*-nxml-*-->
+<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
@@ -277,7 +277,18 @@
limit relative to the amount of physical RAM. Defaults to 10%.
Note that this size is a safety limit only. As each runtime
directory is a tmpfs file system, it will only consume as much
- memory as is needed. </para></listitem>
+ memory as is needed.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><varname>UserTasksMax=</varname></term>
+
+ <listitem><para>Sets the maximum number of OS tasks each user
+ may run concurrently. This controls the
+ <varname>TasksMax=</varname> setting of the per-user slice
+ unit, see
+ <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>
+ for details. Defaults to 4096.</para></listitem>
</varlistentry>
<varlistentry>
diff --git a/man/systemd-system.conf.xml b/man/systemd-system.conf.xml
index 54ce992b85..ead52951da 100644
--- a/man/systemd-system.conf.xml
+++ b/man/systemd-system.conf.xml
@@ -1,4 +1,4 @@
-<?xml version='1.0'?> <!--*-nxml-*-->
+<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
@@ -317,7 +317,20 @@
<varname>MemoryAccounting=</varname> and
<varname>TasksAccounting=</varname>. See
<citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>
- for details on the per-unit settings.</para></listitem>
+ for details on the per-unit
+ settings. <varname>DefaulTasksAccounting=</varname> defaults
+ to on, the other three settings to off.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><varname>DefaultTasksMax=</varname></term>
+
+ <listitem><para>Configure the default value for the per-unit
+ <varname>TasksMax=</varname> setting. See
+ <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>
+ for details. This setting applies to all unit types that
+ support resource control settings, with the exception of slice
+ units. Defaults to 512.</para></listitem>
</varlistentry>
<varlistentry>
diff --git a/man/systemd.resource-control.xml b/man/systemd.resource-control.xml
index 0497f60546..b1106c759d 100644
--- a/man/systemd.resource-control.xml
+++ b/man/systemd.resource-control.xml
@@ -241,7 +241,10 @@
see <ulink
url="https://www.kernel.org/doc/Documentation/cgroups/pids.txt">pids.txt</ulink>.</para>
- <para>Implies <literal>TasksAccounting=true</literal>.</para>
+ <para>Implies <literal>TasksAccounting=true</literal>. The
+ system default for this setting may be controlled with
+ <varname>DefaultTasksMax=</varname> in
+ <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
</listitem>
</varlistentry>
diff --git a/man/systemd.time.xml b/man/systemd.time.xml
index 135eb35f1b..a6fcc95e4c 100644
--- a/man/systemd.time.xml
+++ b/man/systemd.time.xml
@@ -82,8 +82,8 @@
<listitem><para>hours, hour, hr, h</para></listitem>
<listitem><para>days, day, d</para></listitem>
<listitem><para>weeks, week, w</para></listitem>
- <listitem><para>months, month</para></listitem>
- <listitem><para>years, year, y</para></listitem>
+ <listitem><para>months, month, M (defined as 30.44 days)</para></listitem>
+ <listitem><para>years, year, y (define as 365.25 days)</para></listitem>
</itemizedlist>
<para>If no time unit is specified, generally seconds are assumed,
diff --git a/man/tmpfiles.d.xml b/man/tmpfiles.d.xml
index 3f6128cb5b..5bf1f2956b 100644
--- a/man/tmpfiles.d.xml
+++ b/man/tmpfiles.d.xml
@@ -169,13 +169,15 @@
<varlistentry>
<term><varname>v</varname></term>
<listitem><para>Create a subvolume if the path does not
- exist yet and the file system supports this
- (btrfs). Otherwise, create a normal directory, in the same
- way as <varname>d</varname>. A subvolume created with this
- line type is not assigned to any higher-level quota
- group. For that, use <varname>q</varname> or
- <varname>Q</varname>, which allow creating simple quota group
- hierarchies, see below.</para></listitem>
+ exist yet, the file system supports subvolumes (btrfs), and
+ the system itself is installed into a subvolume
+ (specifically: the root directory <filename>/</filename> is
+ itself a subvolume). Otherwise, create a normal directory, in
+ the same way as <varname>d</varname>. A subvolume created
+ with this line type is not assigned to any higher-level
+ quota group. For that, use <varname>q</varname> or
+ <varname>Q</varname>, which allow creating simple quota
+ group hierarchies, see below.</para></listitem>
</varlistentry>
<varlistentry>
diff --git a/src/basic/btrfs-util.c b/src/basic/btrfs-util.c
index 290fabdeff..be40dc5702 100644
--- a/src/basic/btrfs-util.c
+++ b/src/basic/btrfs-util.c
@@ -105,7 +105,7 @@ int btrfs_is_filesystem(int fd) {
return F_TYPE_EQUAL(sfs.f_type, BTRFS_SUPER_MAGIC);
}
-int btrfs_is_subvol(int fd) {
+int btrfs_is_subvol_fd(int fd) {
struct stat st;
assert(fd >= 0);
@@ -121,6 +121,18 @@ int btrfs_is_subvol(int fd) {
return btrfs_is_filesystem(fd);
}
+int btrfs_is_subvol(const char *path) {
+ _cleanup_close_ int fd = -1;
+
+ assert(path);
+
+ fd = open(path, O_RDONLY|O_NOCTTY|O_CLOEXEC|O_DIRECTORY);
+ if (fd < 0)
+ return -errno;
+
+ return btrfs_is_subvol_fd(fd);
+}
+
int btrfs_subvol_make(const char *path) {
struct btrfs_ioctl_vol_args args = {};
_cleanup_close_ int fd = -1;
@@ -1423,12 +1435,16 @@ static int copy_quota_hierarchy(int fd, uint64_t old_subvol_id, uint64_t new_sub
return n_old_qgroups;
r = btrfs_subvol_get_parent(fd, old_subvol_id, &old_parent_id);
- if (r < 0)
+ if (r == -ENXIO)
+ /* We have no parent, hence nothing to copy. */
+ n_old_parent_qgroups = 0;
+ else if (r < 0)
return r;
-
- n_old_parent_qgroups = btrfs_qgroup_find_parents(fd, old_parent_id, &old_parent_qgroups);
- if (n_old_parent_qgroups < 0)
- return n_old_parent_qgroups;
+ else {
+ n_old_parent_qgroups = btrfs_qgroup_find_parents(fd, old_parent_id, &old_parent_qgroups);
+ if (n_old_parent_qgroups < 0)
+ return n_old_parent_qgroups;
+ }
for (i = 0; i < n_old_qgroups; i++) {
uint64_t id;
@@ -1682,7 +1698,7 @@ int btrfs_subvol_snapshot_fd(int old_fd, const char *new_path, BtrfsSnapshotFlag
assert(old_fd >= 0);
assert(new_path);
- r = btrfs_is_subvol(old_fd);
+ r = btrfs_is_subvol_fd(old_fd);
if (r < 0)
return r;
if (r == 0) {
@@ -1868,7 +1884,7 @@ int btrfs_subvol_auto_qgroup_fd(int fd, uint64_t subvol_id, bool insert_intermed
*/
if (subvol_id == 0) {
- r = btrfs_is_subvol(fd);
+ r = btrfs_is_subvol_fd(fd);
if (r < 0)
return r;
if (!r)
@@ -1885,14 +1901,19 @@ int btrfs_subvol_auto_qgroup_fd(int fd, uint64_t subvol_id, bool insert_intermed
if (n > 0) /* already parent qgroups set up, let's bail */
return 0;
+ qgroups = mfree(qgroups);
+
r = btrfs_subvol_get_parent(fd, subvol_id, &parent_subvol);
- if (r < 0)
+ if (r == -ENXIO)
+ /* No parent, hence no qgroup memberships */
+ n = 0;
+ else if (r < 0)
return r;
-
- qgroups = mfree(qgroups);
- n = btrfs_qgroup_find_parents(fd, parent_subvol, &qgroups);
- if (n < 0)
- return n;
+ else {
+ n = btrfs_qgroup_find_parents(fd, parent_subvol, &qgroups);
+ if (n < 0)
+ return n;
+ }
if (insert_intermediary_qgroup) {
uint64_t lowest = 256, new_qgroupid;
diff --git a/src/basic/btrfs-util.h b/src/basic/btrfs-util.h
index fc9efd72d5..8c11ce35d2 100644
--- a/src/basic/btrfs-util.h
+++ b/src/basic/btrfs-util.h
@@ -56,7 +56,9 @@ typedef enum BtrfsRemoveFlags {
} BtrfsRemoveFlags;
int btrfs_is_filesystem(int fd);
-int btrfs_is_subvol(int fd);
+
+int btrfs_is_subvol_fd(int fd);
+int btrfs_is_subvol(const char *path);
int btrfs_reflink(int infd, int outfd);
int btrfs_clone_range(int infd, uint64_t in_offset, int ofd, uint64_t out_offset, uint64_t sz);
diff --git a/src/basic/time-util.c b/src/basic/time-util.c
index b36fbe4f09..647763a230 100644
--- a/src/basic/time-util.c
+++ b/src/basic/time-util.c
@@ -323,15 +323,15 @@ char *format_timespan(char *buf, size_t l, usec_t t, usec_t accuracy) {
const char *suffix;
usec_t usec;
} table[] = {
- { "y", USEC_PER_YEAR },
- { "month", USEC_PER_MONTH },
- { "w", USEC_PER_WEEK },
- { "d", USEC_PER_DAY },
- { "h", USEC_PER_HOUR },
- { "min", USEC_PER_MINUTE },
- { "s", USEC_PER_SEC },
- { "ms", USEC_PER_MSEC },
- { "us", 1 },
+ { "y", USEC_PER_YEAR },
+ { "month", USEC_PER_MONTH },
+ { "w", USEC_PER_WEEK },
+ { "d", USEC_PER_DAY },
+ { "h", USEC_PER_HOUR },
+ { "min", USEC_PER_MINUTE },
+ { "s", USEC_PER_SEC },
+ { "ms", USEC_PER_MSEC },
+ { "us", 1 },
};
unsigned i;
@@ -711,33 +711,34 @@ int parse_time(const char *t, usec_t *usec, usec_t default_unit) {
const char *suffix;
usec_t usec;
} table[] = {
- { "seconds", USEC_PER_SEC },
- { "second", USEC_PER_SEC },
- { "sec", USEC_PER_SEC },
- { "s", USEC_PER_SEC },
+ { "seconds", USEC_PER_SEC },
+ { "second", USEC_PER_SEC },
+ { "sec", USEC_PER_SEC },
+ { "s", USEC_PER_SEC },
{ "minutes", USEC_PER_MINUTE },
- { "minute", USEC_PER_MINUTE },
- { "min", USEC_PER_MINUTE },
- { "months", USEC_PER_MONTH },
- { "month", USEC_PER_MONTH },
- { "msec", USEC_PER_MSEC },
- { "ms", USEC_PER_MSEC },
- { "m", USEC_PER_MINUTE },
- { "hours", USEC_PER_HOUR },
- { "hour", USEC_PER_HOUR },
- { "hr", USEC_PER_HOUR },
- { "h", USEC_PER_HOUR },
- { "days", USEC_PER_DAY },
- { "day", USEC_PER_DAY },
- { "d", USEC_PER_DAY },
- { "weeks", USEC_PER_WEEK },
- { "week", USEC_PER_WEEK },
- { "w", USEC_PER_WEEK },
- { "years", USEC_PER_YEAR },
- { "year", USEC_PER_YEAR },
- { "y", USEC_PER_YEAR },
- { "usec", 1ULL },
- { "us", 1ULL },
+ { "minute", USEC_PER_MINUTE },
+ { "min", USEC_PER_MINUTE },
+ { "months", USEC_PER_MONTH },
+ { "month", USEC_PER_MONTH },
+ { "M", USEC_PER_MONTH },
+ { "msec", USEC_PER_MSEC },
+ { "ms", USEC_PER_MSEC },
+ { "m", USEC_PER_MINUTE },
+ { "hours", USEC_PER_HOUR },
+ { "hour", USEC_PER_HOUR },
+ { "hr", USEC_PER_HOUR },
+ { "h", USEC_PER_HOUR },
+ { "days", USEC_PER_DAY },
+ { "day", USEC_PER_DAY },
+ { "d", USEC_PER_DAY },
+ { "weeks", USEC_PER_WEEK },
+ { "week", USEC_PER_WEEK },
+ { "w", USEC_PER_WEEK },
+ { "years", USEC_PER_YEAR },
+ { "year", USEC_PER_YEAR },
+ { "y", USEC_PER_YEAR },
+ { "usec", 1ULL },
+ { "us", 1ULL },
};
const char *p, *s;
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
index d3bcc795ae..67e4e8b218 100644
--- a/src/core/dbus-manager.c
+++ b/src/core/dbus-manager.c
@@ -655,7 +655,18 @@ static int transient_unit_from_message(
if (r < 0)
return r;
- if (u->load_state != UNIT_NOT_FOUND ||
+ /* Check if the unit already exists or is already referenced,
+ * in a number of different ways. Note that to cater for unit
+ * types such as slice, we are generally fine with units that
+ * are marked UNIT_LOADED even even though nothing was
+ * actually loaded, as those unit types don't require a file
+ * on disk to validly load. */
+
+ if (!IN_SET(u->load_state, UNIT_NOT_FOUND, UNIT_LOADED) ||
+ u->fragment_path ||
+ u->source_path ||
+ !strv_isempty(u->dropin_paths) ||
+ u->refs ||
set_size(u->dependencies[UNIT_REFERENCED_BY]) > 0)
return sd_bus_error_setf(error, BUS_ERROR_UNIT_EXISTS, "Unit %s already exists.", name);
@@ -1960,6 +1971,7 @@ const sd_bus_vtable bus_manager_vtable[] = {
SD_BUS_PROPERTY("DefaultLimitNICE", "t", bus_property_get_rlimit, offsetof(Manager, rlimit[RLIMIT_NICE]), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultLimitRTPRIO", "t", bus_property_get_rlimit, offsetof(Manager, rlimit[RLIMIT_RTPRIO]), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultLimitRTTIME", "t", bus_property_get_rlimit, offsetof(Manager, rlimit[RLIMIT_RTTIME]), SD_BUS_VTABLE_PROPERTY_CONST),
+ SD_BUS_PROPERTY("DefaultTasksMax", "t", NULL, offsetof(Manager, default_tasks_max), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("TimerSlackNSec", "t", property_get_timer_slack_nsec, 0, SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_METHOD("GetUnit", "s", "o", method_get_unit, SD_BUS_VTABLE_UNPRIVILEGED),
diff --git a/src/core/load-fragment-gperf.gperf.m4 b/src/core/load-fragment-gperf.gperf.m4
index 4c5376d601..799418033d 100644
--- a/src/core/load-fragment-gperf.gperf.m4
+++ b/src/core/load-fragment-gperf.gperf.m4
@@ -126,7 +126,7 @@ $1.BlockIODeviceWeight, config_parse_blockio_device_weight, 0,
$1.BlockIOReadBandwidth, config_parse_blockio_bandwidth, 0, offsetof($1, cgroup_context)
$1.BlockIOWriteBandwidth, config_parse_blockio_bandwidth, 0, offsetof($1, cgroup_context)
$1.TasksAccounting, config_parse_bool, 0, offsetof($1, cgroup_context.tasks_accounting)
-$1.TasksMax, config_parse_tasks_max, 0, offsetof($1, cgroup_context)
+$1.TasksMax, config_parse_tasks_max, 0, offsetof($1, cgroup_context.tasks_max)
$1.Delegate, config_parse_bool, 0, offsetof($1, cgroup_context.delegate)
$1.NetClass, config_parse_netclass, 0, offsetof($1, cgroup_context)'
)m4_dnl
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index 62cad0a0c0..5d013de2e8 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -2991,12 +2991,11 @@ int config_parse_tasks_max(
void *data,
void *userdata) {
- CGroupContext *c = data;
- uint64_t u;
+ uint64_t *tasks_max = data, u;
int r;
if (isempty(rvalue) || streq(rvalue, "infinity")) {
- c->tasks_max = (uint64_t) -1;
+ *tasks_max = (uint64_t) -1;
return 0;
}
@@ -3006,7 +3005,7 @@ int config_parse_tasks_max(
return 0;
}
- c->tasks_max = u;
+ *tasks_max = u;
return 0;
}
diff --git a/src/core/main.c b/src/core/main.c
index 33529c3e76..a09ce0f083 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -125,7 +125,8 @@ static FILE* arg_serialization = NULL;
static bool arg_default_cpu_accounting = false;
static bool arg_default_blockio_accounting = false;
static bool arg_default_memory_accounting = false;
-static bool arg_default_tasks_accounting = false;
+static bool arg_default_tasks_accounting = true;
+static uint64_t arg_default_tasks_max = UINT64_C(512);
static void pager_open_if_enabled(void) {
@@ -657,7 +658,7 @@ static int parse_config_file(void) {
{ "Manager", "DefaultStartLimitInterval", config_parse_sec, 0, &arg_default_start_limit_interval },
{ "Manager", "DefaultStartLimitBurst", config_parse_unsigned, 0, &arg_default_start_limit_burst },
{ "Manager", "DefaultEnvironment", config_parse_environ, 0, &arg_default_environment },
- { "Manager", "DefaultLimitCPU", config_parse_limit, 0, &arg_default_rlimit[RLIMIT_CPU] },
+ { "Manager", "DefaultLimitCPU", config_parse_sec_limit, 0, &arg_default_rlimit[RLIMIT_CPU] },
{ "Manager", "DefaultLimitFSIZE", config_parse_bytes_limit, 0, &arg_default_rlimit[RLIMIT_FSIZE] },
{ "Manager", "DefaultLimitDATA", config_parse_bytes_limit, 0, &arg_default_rlimit[RLIMIT_DATA] },
{ "Manager", "DefaultLimitSTACK", config_parse_bytes_limit, 0, &arg_default_rlimit[RLIMIT_STACK] },
@@ -672,11 +673,12 @@ static int parse_config_file(void) {
{ "Manager", "DefaultLimitMSGQUEUE", config_parse_bytes_limit, 0, &arg_default_rlimit[RLIMIT_MSGQUEUE] },
{ "Manager", "DefaultLimitNICE", config_parse_limit, 0, &arg_default_rlimit[RLIMIT_NICE] },
{ "Manager", "DefaultLimitRTPRIO", config_parse_limit, 0, &arg_default_rlimit[RLIMIT_RTPRIO] },
- { "Manager", "DefaultLimitRTTIME", config_parse_limit, 0, &arg_default_rlimit[RLIMIT_RTTIME] },
+ { "Manager", "DefaultLimitRTTIME", config_parse_usec_limit, 0, &arg_default_rlimit[RLIMIT_RTTIME] },
{ "Manager", "DefaultCPUAccounting", config_parse_bool, 0, &arg_default_cpu_accounting },
{ "Manager", "DefaultBlockIOAccounting", config_parse_bool, 0, &arg_default_blockio_accounting },
{ "Manager", "DefaultMemoryAccounting", config_parse_bool, 0, &arg_default_memory_accounting },
{ "Manager", "DefaultTasksAccounting", config_parse_bool, 0, &arg_default_tasks_accounting },
+ { "Manager", "DefaultTasksMax", config_parse_tasks_max, 0, &arg_default_tasks_max },
{}
};
@@ -712,6 +714,7 @@ static void manager_set_defaults(Manager *m) {
m->default_blockio_accounting = arg_default_blockio_accounting;
m->default_memory_accounting = arg_default_memory_accounting;
m->default_tasks_accounting = arg_default_tasks_accounting;
+ m->default_tasks_max = arg_default_tasks_max;
manager_set_default_rlimits(m, arg_default_rlimit);
manager_environment_add(m, NULL, arg_default_environment);
diff --git a/src/core/manager.c b/src/core/manager.c
index f695b8a66c..edff6758c5 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -577,6 +577,8 @@ int manager_new(ManagerRunningAs running_as, bool test_run, Manager **_m) {
m->running_as = running_as;
m->exit_code = _MANAGER_EXIT_CODE_INVALID;
m->default_timer_accuracy_usec = USEC_PER_MINUTE;
+ m->default_tasks_accounting = true;
+ m->default_tasks_max = UINT64_C(512);
/* Prepare log fields we can use for structured logging */
m->unit_log_field = unit_log_fields[running_as];
diff --git a/src/core/manager.h b/src/core/manager.h
index bc3f02f872..b5b258f909 100644
--- a/src/core/manager.h
+++ b/src/core/manager.h
@@ -260,6 +260,7 @@ struct Manager {
bool default_blockio_accounting;
bool default_tasks_accounting;
+ uint64_t default_tasks_max;
usec_t default_timer_accuracy_usec;
struct rlimit *rlimit[_RLIMIT_MAX];
diff --git a/src/core/scope.c b/src/core/scope.c
index 5f6527c155..1953af1f88 100644
--- a/src/core/scope.c
+++ b/src/core/scope.c
@@ -402,15 +402,10 @@ static bool scope_check_gc(Unit *u) {
/* Never clean up scopes that still have a process around,
* even if the scope is formally dead. */
- if (u->cgroup_path) {
- int r;
+ if (!u->cgroup_path)
+ return false;
- r = cg_is_empty_recursive(SYSTEMD_CGROUP_CONTROLLER, u->cgroup_path);
- if (r <= 0)
- return true;
- }
-
- return false;
+ return cg_is_empty_recursive(SYSTEMD_CGROUP_CONTROLLER, u->cgroup_path) <= 0;
}
static void scope_notify_cgroup_empty_event(Unit *u) {
@@ -577,6 +572,7 @@ const UnitVTable scope_vtable = {
.no_alias = true,
.no_instances = true,
+ .can_transient = true,
.init = scope_init,
.load = scope_load,
@@ -611,7 +607,5 @@ const UnitVTable scope_vtable = {
.bus_set_property = bus_scope_set_property,
.bus_commit_properties = bus_scope_commit_properties,
- .can_transient = true,
-
.enumerate = scope_enumerate,
};
diff --git a/src/core/slice.c b/src/core/slice.c
index 39dabae055..9c488f0fd7 100644
--- a/src/core/slice.c
+++ b/src/core/slice.c
@@ -305,6 +305,7 @@ const UnitVTable slice_vtable = {
.no_alias = true,
.no_instances = true,
+ .can_transient = true,
.load = slice_load,
diff --git a/src/core/system.conf b/src/core/system.conf
index 50668e12c4..e2ded27333 100644
--- a/src/core/system.conf
+++ b/src/core/system.conf
@@ -40,7 +40,8 @@
#DefaultCPUAccounting=no
#DefaultBlockIOAccounting=no
#DefaultMemoryAccounting=no
-#DefaultTasksAccounting=no
+#DefaultTasksAccounting=yes
+#DefaultTasksMax=512
#DefaultLimitCPU=
#DefaultLimitFSIZE=
#DefaultLimitDATA=
diff --git a/src/core/unit.c b/src/core/unit.c
index f553f24829..d199d87bf8 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -132,6 +132,9 @@ static void unit_init(Unit *u) {
cc->blockio_accounting = u->manager->default_blockio_accounting;
cc->memory_accounting = u->manager->default_memory_accounting;
cc->tasks_accounting = u->manager->default_tasks_accounting;
+
+ if (u->type != UNIT_SLICE)
+ cc->tasks_max = u->manager->default_tasks_max;
}
ec = unit_get_exec_context(u);
@@ -314,9 +317,6 @@ bool unit_check_gc(Unit *u) {
if (state != UNIT_INACTIVE)
return true;
- if (UNIT_VTABLE(u)->no_gc)
- return true;
-
if (u->no_gc)
return true;
diff --git a/src/core/unit.h b/src/core/unit.h
index 14e3072146..bcf41d2348 100644
--- a/src/core/unit.h
+++ b/src/core/unit.h
@@ -403,9 +403,6 @@ struct UnitVTable {
/* Instances make no sense for this type */
bool no_instances:1;
- /* Exclude from automatic gc */
- bool no_gc:1;
-
/* True if transient units of this type are OK */
bool can_transient:1;
};
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index 5cc90c6e24..7cc0044bab 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -2753,13 +2753,101 @@ int manager_send_changed(Manager *manager, const char *property, ...) {
l);
}
+int manager_start_slice(
+ Manager *manager,
+ const char *slice,
+ const char *description,
+ const char *after,
+ const char *after2,
+ uint64_t tasks_max,
+ sd_bus_error *error,
+ char **job) {
+
+ _cleanup_bus_message_unref_ sd_bus_message *m = NULL, *reply = NULL;
+ int r;
+
+ assert(manager);
+ assert(slice);
+
+ r = sd_bus_message_new_method_call(
+ manager->bus,
+ &m,
+ "org.freedesktop.systemd1",
+ "/org/freedesktop/systemd1",
+ "org.freedesktop.systemd1.Manager",
+ "StartTransientUnit");
+ if (r < 0)
+ return r;
+
+ r = sd_bus_message_append(m, "ss", strempty(slice), "fail");
+ if (r < 0)
+ return r;
+
+ r = sd_bus_message_open_container(m, 'a', "(sv)");
+ if (r < 0)
+ return r;
+
+ if (!isempty(description)) {
+ r = sd_bus_message_append(m, "(sv)", "Description", "s", description);
+ if (r < 0)
+ return r;
+ }
+
+ if (!isempty(after)) {
+ r = sd_bus_message_append(m, "(sv)", "After", "as", 1, after);
+ if (r < 0)
+ return r;
+ }
+
+ if (!isempty(after2)) {
+ r = sd_bus_message_append(m, "(sv)", "After", "as", 1, after2);
+ if (r < 0)
+ return r;
+ }
+
+ r = sd_bus_message_append(m, "(sv)", "TasksMax", "t", tasks_max);
+ if (r < 0)
+ return r;
+
+ r = sd_bus_message_close_container(m);
+ if (r < 0)
+ return r;
+
+ r = sd_bus_message_append(m, "a(sa(sv))", 0);
+ if (r < 0)
+ return r;
+
+ r = sd_bus_call(manager->bus, m, 0, error, &reply);
+ if (r < 0)
+ return r;
+
+ if (job) {
+ const char *j;
+ char *copy;
+
+ r = sd_bus_message_read(reply, "o", &j);
+ if (r < 0)
+ return r;
+
+ copy = strdup(j);
+ if (!copy)
+ return -ENOMEM;
+
+ *job = copy;
+ }
+
+ return 1;
+}
+
int manager_start_scope(
Manager *manager,
const char *scope,
pid_t pid,
const char *slice,
const char *description,
- const char *after, const char *after2,
+ const char *after,
+ const char *after2,
+ uint64_t tasks_max,
sd_bus_error *error,
char **job) {
@@ -2827,6 +2915,10 @@ int manager_start_scope(
if (r < 0)
return r;
+ r = sd_bus_message_append(m, "(sv)", "TasksMax", "t", tasks_max);
+ if (r < 0)
+ return r;
+
r = sd_bus_message_close_container(m);
if (r < 0)
return r;
diff --git a/src/login/logind-gperf.gperf b/src/login/logind-gperf.gperf
index 9218d098e0..8552c464cc 100644
--- a/src/login/logind-gperf.gperf
+++ b/src/login/logind-gperf.gperf
@@ -34,3 +34,4 @@ Login.IdleAction, config_parse_handle_action, 0, offsetof(Manag
Login.IdleActionSec, config_parse_sec, 0, offsetof(Manager, idle_action_usec)
Login.RuntimeDirectorySize, config_parse_tmpfs_size, 0, offsetof(Manager, runtime_dir_size)
Login.RemoveIPC, config_parse_bool, 0, offsetof(Manager, remove_ipc)
+Login.UserTasksMax, config_parse_uint64, 0, offsetof(Manager, user_tasks_max)
diff --git a/src/login/logind-session.c b/src/login/logind-session.c
index 1d561a6f8a..6c4ada29fb 100644
--- a/src/login/logind-session.c
+++ b/src/login/logind-session.c
@@ -513,25 +513,31 @@ static int session_start_scope(Session *s) {
assert(s);
assert(s->user);
- assert(s->user->slice);
if (!s->scope) {
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
- _cleanup_free_ char *description = NULL;
char *scope, *job = NULL;
-
- description = strjoin("Session ", s->id, " of user ", s->user->name, NULL);
- if (!description)
- return log_oom();
+ const char *description;
scope = strjoin("session-", s->id, ".scope", NULL);
if (!scope)
return log_oom();
- r = manager_start_scope(s->manager, scope, s->leader, s->user->slice, description, "systemd-logind.service", "systemd-user-sessions.service", &error, &job);
+ description = strjoina("Session ", s->id, " of user ", s->user->name, NULL);
+
+ r = manager_start_scope(
+ s->manager,
+ scope,
+ s->leader,
+ s->user->slice,
+ description,
+ "systemd-logind.service",
+ "systemd-user-sessions.service",
+ (uint64_t) -1, /* disable TasksMax= for the scope, rely on the slice setting for it */
+ &error,
+ &job);
if (r < 0) {
- log_error("Failed to start session scope %s: %s %s",
- scope, bus_error_message(&error, r), error.name);
+ log_error_errno(r, "Failed to start session scope %s: %s", scope, bus_error_message(&error, r));
free(scope);
return r;
} else {
@@ -543,7 +549,7 @@ static int session_start_scope(Session *s) {
}
if (s->scope)
- hashmap_put(s->manager->session_units, s->scope, s);
+ (void) hashmap_put(s->manager->session_units, s->scope, s);
return 0;
}
diff --git a/src/login/logind-user.c b/src/login/logind-user.c
index 56bc5a010c..7bdbe6583c 100644
--- a/src/login/logind-user.c
+++ b/src/login/logind-user.c
@@ -25,6 +25,7 @@
#include <unistd.h>
#include "alloc-util.h"
+#include "bus-common-errors.h"
#include "bus-error.h"
#include "bus-util.h"
#include "clean-ipc.h"
@@ -44,6 +45,7 @@
#include "rm-rf.h"
#include "smack-util.h"
#include "special.h"
+#include "stdio-util.h"
#include "string-table.h"
#include "unit-name.h"
#include "user-util.h"
@@ -392,34 +394,51 @@ fail:
}
static int user_start_slice(User *u) {
- char *job;
int r;
assert(u);
if (!u->slice) {
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
- char lu[DECIMAL_STR_MAX(uid_t) + 1], *slice;
- sprintf(lu, UID_FMT, u->uid);
+ char lu[DECIMAL_STR_MAX(uid_t) + 1], *slice, *job;
+ const char *description;
+
+ u->slice_job = mfree(u->slice_job);
+ xsprintf(lu, UID_FMT, u->uid);
r = slice_build_subslice(SPECIAL_USER_SLICE, lu, &slice);
if (r < 0)
- return r;
-
- r = manager_start_unit(u->manager, slice, &error, &job);
+ return log_error_errno(r, "Failed to build slice name: %m");
+
+ description = strjoina("User Slice of ", u->name);
+
+ r = manager_start_slice(
+ u->manager,
+ slice,
+ description,
+ "systemd-logind.service",
+ "systemd-user-sessions.service",
+ u->manager->user_tasks_max,
+ &error,
+ &job);
if (r < 0) {
- log_error("Failed to start user slice: %s", bus_error_message(&error, r));
- free(slice);
+
+ if (sd_bus_error_has_name(&error, BUS_ERROR_UNIT_EXISTS))
+ /* The slice already exists? If so, that's fine, let's just reuse it */
+ u->slice = slice;
+ else {
+ log_error_errno(r, "Failed to start user slice %s, ignoring: %s (%s)", slice, bus_error_message(&error, r), error.name);
+ free(slice);
+ /* we don't fail due to this, let's try to continue */
+ }
} else {
u->slice = slice;
-
- free(u->slice_job);
u->slice_job = job;
}
}
if (u->slice)
- hashmap_put(u->manager->user_units, u->slice, u);
+ (void) hashmap_put(u->manager->user_units, u->slice, u);
return 0;
}
@@ -433,16 +452,21 @@ static int user_start_service(User *u) {
if (!u->service) {
char lu[DECIMAL_STR_MAX(uid_t) + 1], *service;
- sprintf(lu, UID_FMT, u->uid);
+ xsprintf(lu, UID_FMT, u->uid);
r = unit_name_build("user", lu, ".service", &service);
if (r < 0)
return log_error_errno(r, "Failed to build service name: %m");
- r = manager_start_unit(u->manager, service, &error, &job);
+ r = manager_start_unit(
+ u->manager,
+ service,
+ &error,
+ &job);
if (r < 0) {
- log_error("Failed to start user service: %s", bus_error_message(&error, r));
+ log_error_errno(r, "Failed to start user service, ignoring: %s", bus_error_message(&error, r));
free(service);
+ /* we don't fail due to this, let's try to continue */
} else {
u->service = service;
@@ -452,7 +476,7 @@ static int user_start_service(User *u) {
}
if (u->service)
- hashmap_put(u->manager->user_units, u->service, u);
+ (void) hashmap_put(u->manager->user_units, u->service, u);
return 0;
}
diff --git a/src/login/logind.c b/src/login/logind.c
index be6bbe5b5c..7b41174c64 100644
--- a/src/login/logind.c
+++ b/src/login/logind.c
@@ -70,6 +70,7 @@ static Manager *manager_new(void) {
m->idle_action_not_before_usec = now(CLOCK_MONOTONIC);
m->runtime_dir_size = PAGE_ALIGN((size_t) (physical_memory() / 10)); /* 10% */
+ m->user_tasks_max = UINT64_C(4096);
m->devices = hashmap_new(&string_hash_ops);
m->seats = hashmap_new(&string_hash_ops);
diff --git a/src/login/logind.conf b/src/login/logind.conf
index 6df6f04c77..81f6695434 100644
--- a/src/login/logind.conf
+++ b/src/login/logind.conf
@@ -32,3 +32,4 @@
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes
+#UserTasksMax=4096
diff --git a/src/login/logind.h b/src/login/logind.h
index 44e05d8b01..f34544e64c 100644
--- a/src/login/logind.h
+++ b/src/login/logind.h
@@ -134,6 +134,7 @@ struct Manager {
sd_event_source *lid_switch_ignore_event_source;
size_t runtime_dir_size;
+ uint64_t user_tasks_max;
};
int manager_add_device(Manager *m, const char *sysfs, bool master, Device **_device);
@@ -171,7 +172,8 @@ int bus_manager_shutdown_or_sleep_now_or_later(Manager *m, const char *unit_name
int manager_send_changed(Manager *manager, const char *property, ...) _sentinel_;
-int manager_start_scope(Manager *manager, const char *scope, pid_t pid, const char *slice, const char *description, const char *after, const char *after2, sd_bus_error *error, char **job);
+int manager_start_slice(Manager *manager, const char *slice, const char *description, const char *after, const char *after2, uint64_t tasks_max, sd_bus_error *error, char **job);
+int manager_start_scope(Manager *manager, const char *scope, pid_t pid, const char *slice, const char *description, const char *after, const char *after2, uint64_t tasks_max, sd_bus_error *error, char **job);
int manager_start_unit(Manager *manager, const char *unit, sd_bus_error *error, char **job);
int manager_stop_unit(Manager *manager, const char *unit, sd_bus_error *error, char **job);
int manager_abandon_scope(Manager *manager, const char *scope, sd_bus_error *error);
diff --git a/src/nspawn/nspawn-register.c b/src/nspawn/nspawn-register.c
index 374f958c20..50871464c5 100644
--- a/src/nspawn/nspawn-register.c
+++ b/src/nspawn/nspawn-register.c
@@ -105,6 +105,10 @@ int register_machine(
return bus_log_create_error(r);
}
+ r = sd_bus_message_append(m, "(sv)", "TasksMax", "t", 8192);
+ if (r < 0)
+ return bus_log_create_error(r);
+
r = sd_bus_message_append(m, "(sv)", "DevicePolicy", "s", "strict");
if (r < 0)
return bus_log_create_error(r);
diff --git a/src/test/test-cgroup-mask.c b/src/test/test-cgroup-mask.c
index de6c421b82..85b0d607d6 100644
--- a/src/test/test-cgroup-mask.c
+++ b/src/test/test-cgroup-mask.c
@@ -40,6 +40,16 @@ static int test_cgroup_mask(void) {
puts("manager_new: Permission denied. Skipping test.");
return EXIT_TEST_SKIP;
}
+
+ /* Turn off all kinds of default accouning, so that we can
+ * verify the masks resulting of our configuration and nothing
+ * else. */
+ m->default_cpu_accounting =
+ m->default_memory_accounting =
+ m->default_blockio_accounting =
+ m->default_tasks_accounting = false;
+ m->default_tasks_max = (uint64_t) -1;
+
assert_se(r >= 0);
assert_se(manager_startup(m, serial, fdset) >= 0);
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index 74b6b91593..f9a759e223 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -1226,8 +1226,28 @@ static int create_item(Item *i) {
mkdir_parents_label(i->path, 0755);
if (IN_SET(i->type, CREATE_SUBVOLUME, CREATE_SUBVOLUME_INHERIT_QUOTA, CREATE_SUBVOLUME_NEW_QUOTA)) {
- RUN_WITH_UMASK((~i->mode) & 0777)
- r = btrfs_subvol_make(i->path);
+
+ if (btrfs_is_subvol(isempty(arg_root) ? "/" : arg_root) <= 0)
+
+ /* Don't create a subvolume unless the
+ * root directory is one, too. We do
+ * this under the assumption that if
+ * the root directory is just a plain
+ * directory (i.e. very light-weight),
+ * we shouldn't try to split it up
+ * into subvolumes (i.e. more
+ * heavy-weight). Thus, chroot()
+ * environments and suchlike will get
+ * a full brtfs subvolume set up below
+ * their tree only if they
+ * specifically set up a btrfs
+ * subvolume for the root dir too. */
+
+ r = -ENOTTY;
+ else {
+ RUN_WITH_UMASK((~i->mode) & 0777)
+ r = btrfs_subvol_make(i->path);
+ }
} else
r = 0;
diff --git a/units/systemd-nspawn@.service.in b/units/systemd-nspawn@.service.in
index 2e79adff44..eb10343ac6 100644
--- a/units/systemd-nspawn@.service.in
+++ b/units/systemd-nspawn@.service.in
@@ -20,6 +20,7 @@ RestartForceExitStatus=133
SuccessExitStatus=133
Slice=machine.slice
Delegate=yes
+TasksMax=8192
# Enforce a strict device policy, similar to the one nspawn configures
# when it allocates its own scope unit. Make sure to keep these