summaryrefslogtreecommitdiff
path: root/src/core/cgroup.c
Commit message (Collapse)AuthorAge
...
* systemd: fix memory leak in cgroup codeZbigniew Jędrzejewski-Szmek2013-11-09
| | | | If the unit already was in the hashmap, path would be leaked.
* Comment spelling fixes.David Strauss2013-11-06
|
* cgroup: run PID 1 in the root cgroupLennart Poettering2013-11-06
| | | | | | | | | | | This way cleaning up the cgroup tree on shutdown is a lot easier since we are in the root dir. Also PID 1 was previously artificially placed in system.slice, even though our rule actually was not to have processes in slices. The root slice otoh is magic anyway, so having PID 1 in there sounds less surprising. Of course, this means that PID is scheduled against the three top-level slices.
* list: make our list macros a bit easier to use by not requring type spec on ↵Lennart Poettering2013-10-14
| | | | | | | each invocation We can determine the list entry type via the typeof() gcc construct, and so we should to make the macros much shorter to use.
* cgroup: if we do a cgroup operation then do something on all supported ↵Lennart Poettering2013-09-25
| | | | | | | | | | | | | controllers Previously we did operations like attach, trim or migrate only on the controllers that were enabled for a specific unit. With this changes we will now do them for all supproted controllers, and fall back to all possible prefix paths if the specified paths do not exist. This fixes issues if a controller is being disabled for a unit where it was previously enabled, and makes sure that all processes stay as "far down" the tree as groups exist.
* cgroup: always enable memory.use_hierarchy= for all cgroups in the memory ↵Lennart Poettering2013-09-23
| | | | | | | | hierarchy The non-hierarchial mode contradicts the whole idea of a cgroup tree so let's not support this. In the future the kernel will only support the hierarchial logic anyway.
* cgroup: get rid of MemorySoftLimit=Lennart Poettering2013-09-17
| | | | | | | The cgroup attribute memory.soft_limit_in_bytes is unlikely to stay around in the kernel for good, so let's not expose it for now. We can readd something like it later when the kernel guys decided on a final API for this.
* cgroup: add missing equals for BlockIOWeightGao feng2013-09-16
|
* core/cgroup: first print then freeLukas Nykryn2013-09-13
|
* cgroup: fix incorrectly setting memory cgroupGao feng2013-09-13
| | | | | | | If the memory_limit of unit is -1, we should write "-1" to the file memory.limit_in_bytes. not the (unit64_t) -1. otherwise the memory.limit_in_bytes will be set to zero.
* cgroup: correct the log informationGao feng2013-09-13
| | | | it should be memory.soft_limit_in_bytes.
* cgroup: add the missing setting of variable's valueGao feng2013-09-13
| | | | | set the value of variable "r" to the return value of cg_set_attribute.
* Do not realloc strings, which are already in the hashmap as keysHarald Hoyer2013-08-28
| | | | | | This prevents corruption of the hashmap, because we would free() the keys in the hashmap, if the unit is already in there, with the same cgroup path.
* Revert "cgroup.c: check return value of unit_realize_cgroup_now()"Harald Hoyer2013-08-28
| | | | This reverts commit 1f11a0cdfe397cc404d61ee679fc12f58c0a885b.
* cgroup.c: check return value of unit_realize_cgroup_now()Harald Hoyer2013-08-23
| | | | do not recurse further, if unit_realize_cgroup_now() failed
* cgroup: split out per-device BlockIOWeight= setting into BlockIODeviceWeight=Lennart Poettering2013-07-11
| | | | | This way we can nicely map the configuration directive to properties and back, without requiring two different signatures for the same property.
* cgroup: don't ever try to destroy the cgroup of the root sliceLennart Poettering2013-07-11
| | | | | The root slice is after all the root cgroup, so don't attempt to delete it.
* cgroup: don't move systemd into systems.slice when running as --user instanceLennart Poettering2013-07-11
|
* cgroup: downgrade error message when we cannot remove a cgroup to debugLennart Poettering2013-07-10
| | | | | | Some units set KillMode=none to survive the initrd→rootfs transition. We cannot remove their cgroups, but that shouldn't really be considered an issue, so let's downgrade the error message.
* core: don't consider a unit's cgroup empty if only a subcgroup runs emptyLennart Poettering2013-07-02
|
* cgroup: implicitly add units to GC queue when their cgroups run emptyLennart Poettering2013-07-01
|
* cgroup: readd proper cgroup empty trackingLennart Poettering2013-07-01
|
* core: general cgroup reworkLennart Poettering2013-06-27
| | | | | | | | | | | | | | | | Replace the very generic cgroup hookup with a much simpler one. With this change only the high-level cgroup settings remain, the ability to set arbitrary cgroup attributes is removed, so is support for adding units to arbitrary cgroup controllers or setting arbitrary paths for them (especially paths that are different for the various controllers). This also introduces a new -.slice root slice, that is the parent of system.slice and friends. This enables easy admin configuration of root-level cgrouo properties. This replaces DeviceDeny= by DevicePolicy=, and implicitly adds in /dev/null, /dev/zero and friends if DeviceAllow= is used (unless this is turned off by DevicePolicy=).
* logind: add infrastructure to keep track of machines, and move to slicesLennart Poettering2013-06-20
| | | | | | | | | | | | | | | | | | | | - This changes all logind cgroup objects to use slice objects rather than fixed croup locations. - logind can now collect minimal information about running VMs/containers. As fixed cgroup locations can no longer be used we need an entity that keeps track of machine cgroups in whatever slice they might be located. Since logind already keeps track of users, sessions and seats this is a trivial addition. - nspawn will now register with logind and pass various bits of metadata along. A new option "--slice=" has been added to place the container in a specific slice. - loginctl gained commands to list, introspect and terminate machines. - user.slice and machine.slice will now be pulled in by logind.service, since only logind.service requires this slice.
* core: add new .slice unit type for partitioning systemsLennart Poettering2013-06-17
| | | | | | | | | | | | In order to prepare for the kernel cgroup rework, let's introduce a new unit type to systemd, the "slice". Slices can be arranged in a tree and are useful to partition resources freely and hierarchally by the user. Each service unit can now be assigned to one of these slices, and later on login users and machines may too. Slices translate pretty directly to the cgroup hierarchy, and the various objects can be assigned to any of the slices in the tree.
* nspawn: introduce the new /machine/ tree in the cgroup tree and move ↵Lennart Poettering2013-04-16
| | | | | | | | | | | | | | containers there Containers will now carry a label (normally derived from the root directory name, but configurable by the user), and the container's root cgroup is /machine/<label>. This label is called "machine name", and can cover both containers and VMs (as soon as libvirt also makes use of /machine/). libsystemd-login can be used to query the machine name from a process. This patch also includes numerous clean-ups for the cgroup code.
* core: always create /user and /machine top-level cgroup dirsLennart Poettering2013-04-15
| | | | | | | | | This allows clients to put inotify watches on these trees to watch for state changes, without having to wait until these dirs are created. This introduces the new top-level /machine cgroup dir as canonical location where OS containers and VMs shall be located (as discussed with the libvirt folks).
* cgroup: always keep access mode of 'tasks' and 'cgroup.procs' files in ↵Lennart Poettering2013-04-08
| | | | cgroup directories in sync
* cgroup: minor optimizationLennart Poettering2013-03-22
|
* core: add bus API and systemctl commands for altering cgroup parameters ↵Lennart Poettering2013-01-14
| | | | during runtime
* core: move ManagerRunningAs to sharedZbigniew Jędrzejewski-Szmek2012-09-18
| | | | | | | Note: I did s/MANAGER/SYSTEMD/ everywhere, even though it makes the patch quite verbose. Nevertheless, keeping MANAGER prefix in some places, and SYSTEMD prefix in others would just lead to confusion down the road. Better to rip off the band-aid now.
* log.h: new log_oom() -> int -ENOMEM, use itShawn Landden2012-07-26
| | | | | | also a number of minor fixups and bug fixes: spelling, oom errors that didn't print errors, not properly forwarding error codes, few more consistency issues, et cetera
* use "Out of memory." consistantly (or with "\n")Shawn Landden2012-07-25
| | | | | | | | glibc/glib both use "out of memory" consistantly so maybe we should consider that instead of this. Eliminates one string out of a number of binaries. Also fixes extra newline in udev/scsi_id
* util: rename join() to strjoin()Lennart Poettering2012-07-13
| | | | This is to match strappend() and the other string related functions.
* util: split-out path-util.[ch]Kay Sievers2012-05-08
|
* service: explicitly remove control/ subcgroup after each control commandLennart Poettering2012-05-03
| | | | | | | | The kernel will only notify us of cgroups running empty if no subcgroups exist anymore. Hence make sure we don't leave our own control/ subcgroup around longer than necessary. https://bugzilla.redhat.com/show_bug.cgi?id=818381
* logind: remove redundant entries from logind's default controller lists tooLennart Poettering2012-04-16
|
* manager: remove unavailable/redundant entries from default controllers listLennart Poettering2012-04-16
|
* cgroup: if a controller is not available don't try to create cgroups in its ↵Lennart Poettering2012-04-16
| | | | hierarchy
* service: place control command in subcgroup control/Lennart Poettering2012-04-13
| | | | | | | | | | | | | | | | | | Previously, we were brutally and onconditionally killing all processes in a service's cgroup before starting the service anew, in order to ensure that StartPre lines cannot be misused to spawn long-running processes. On logind-less systems this has the effect that restarting sshd necessarily calls all active ssh sessions, which is usually not desirable. With this patch control processes for a service are placed in a sub-cgroup called "control/". When starting a service anew we simply kill this cgroup, but not the main cgroup, in order to avoid killing any long-running non-control processes from previous runs. https://bugzilla.redhat.com/show_bug.cgi?id=805942
* relicense to LGPLv2.1 (with exceptions)Lennart Poettering2012-04-12
| | | | | | | | | | | | | | We finally got the OK from all contributors with non-trivial commits to relicense systemd from GPL2+ to LGPL2.1+. Some udev bits continue to be GPL2+ for now, but we are looking into relicensing them too, to allow free copy/paste of all code within systemd. The bits that used to be MIT continue to be MIT. The big benefit of the relicensing is that closed source code may now link against libsystemd-login.so and friends.
* move libsystemd_core.la sources into core/Kay Sievers2012-04-11