summaryrefslogtreecommitdiff
path: root/src/core
AgeCommit message (Collapse)Author
2013-06-20logind: add infrastructure to keep track of machines, and move to slicesLennart Poettering
- 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.
2013-06-19core/dbus: properly export cgroup properties on socketsZbigniew Jędrzejewski-Szmek
https://bugs.freedesktop.org/show_bug.cgi?id=65945
2013-06-18core: unref slice ref after useLennart Poettering
2013-06-18core: expose a "Slice" property on Unit objects on the busLennart Poettering
2013-06-17core: add new .slice unit type for partitioning systemsLennart Poettering
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.
2013-06-17mount: when learning about the root mount from mountinfo, don't add ↵Lennart Poettering
conflicting dep for umount.target That way systemd won't try to umount it at shutdown.
2013-06-17rpm: define a %_userunitdir macroLennart Poettering
2013-06-10Use stdint.h macros instead of casts to print uint64_t valuesZbigniew Jędrzejewski-Szmek
Casts are visually heavy, and can obscure unwanted truncations.
2013-06-09service: don't report alien child as alive when it's notRoss Lagerwall
When a sigchld is received from an alien child, main_pid is set to 0 then service_enter_running calls main_pid_good to check if the child is running. This incorrectly returned true because kill(main_pid, 0) would return >= 0. This fixes an error where a service would die and the cgroup would become empty but the service would still report as active (running).
2013-06-06service: execute ExecStopPost= commands when the watchdog timeout hitsLennart Poettering
We can assume that a service for which a watchdog timeout was triggered is unresponsive to a clean shutdown. However, it still makes sense to execute the post-stop cleanup commands that can be configured with ExecStopPost=. Hence, when the timeout is hit enter STOP_SIGKILL rather than FINAL_SIGKILL.
2013-06-06manager: Do not handle SIGKILL since we can notChengwei Yang
This is a minor fix because it's not a major issue, this fix just avoid to get EINVAL error from sigaction(2). There are two signals can not handled at user space, SIGKILL and SIGSTOP even we're PID 1, trying to handle these two signals will get EINVAL error. There are two kinds of systemd instance, running as system manager or user session manager, apparently, the latter is a general user space process which can not handle SIGKILL. The special pid 1 also can not do that refer to kernel/signal.c:do_sigaction(). However, pid 1 is unkillable because the kernel did attach SIGNAL_UNKILLABLE to it at system boot up, refer to init/main.c:start_kernel() --> rest_init() --> kernel_thread() --> kernel_init() --> init_post() current->signal->flags |= SIGNAL_UNKILLABLE
2013-06-02analyze: show unit file loading on plotThomas Hindoe Paaboel Andersen
This will add another color to the legend called "Loading unit files" Like the generators it will mark a part of the systemd bar indicating the time spent while loading unit files.
2013-06-02analyze: show generators on plotUmut Tezduyar
2013-05-30systemctl: suggest 'systemctl daemon-reload' without --systemZbigniew Jędrzejewski-Szmek
--system is default anyway, and some poor user might type 9 characters without needing to.
2013-05-30systemctl: add commands set-default and get-defaultVáclav Pavlín
systemctl set-default NAME links the default.target to the given unit, get-default prints out the path to the currently set default target.
2013-05-30core: read "debug" from kernel commandline and set log levelLukas Nykryn
2013-05-30core: use the same test as upstart for apparmorNirbheek Chauhan
Lennart: > Hmm, I just noticed this patch: > > https://code.launchpad.net/~mdeslaur/upstart/apparmor-support/+merge/164169 > > It contains a different check for AppArmor. Basically something like this: > > /sys/module/apparmor/parameters/enabled == 'Y' > > I'd prefer if we could change our code to do the same, given that > the Ubuntu guys are guys are upstream for apparmor. https://bugs.freedesktop.org/show_bug.cgi?id=63312
2013-05-30Fix CPUShares configuration optionEelco Dolstra
This fixes the error message "Unknown or unsupported cgroup attribute CPUShares".
2013-05-29systemd: record efi timestamps after /sys is mountedZachary Cook
This partially reverts commit c3a170f3, which moved efi_get_boot_timestamps too early in main(), before /sys is assured to be mounted Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64371 [tomegun: in particular /sys/firmware/efi/efivars needs to be mounted, which is not a problem if a systemd-initramfs containing the correct module is being used. But not everyone uses an initramfs...]
2013-05-21service: kill processes with SIGKILL on watchdog failureMichael Olbrich
Just calling service_enter_dead() does not kill any processes. As a result, the old process may still be running when the new one is started. After a watchdog failure the service is in an undefined state. Using the normal shutdown mechanism makes no sense. Instead all processes are just killed and the service can try to restart.
2013-05-20core: fix DBus property ExecMainExitTimestampMichal Schmidt
Possibly due to copy&paste error it was identical to ExecMainStartTimestamp.
2013-05-17Make it possible to disable smack separately from xattr supportKarol Lewandowski
Additionally, compile out rule loading if feature is disabled.
2013-05-11Add support for ConditionSecurity=imaAuke Kok
Just as with SMACK, we don't really know if a policy has been loaded or not, as the policy interface is write-only. Assume therefore that if ima is present in securityfs that it is enabled. Update the man page to reflect that "ima" is a valid option now as well.
2013-05-11Re-indent with spaces.Auke Kok
2013-05-09Start ctrl-alt-del.target irreversiblyEelco Dolstra
This makes ctrl-alt-del reboots more robust, just like "systemctl reboot".
2013-05-08condition, man: Add support for ConditionSecurity=smackKarol Lewandowski
According to Documentation/security/Smack.txt: In keeping with the intent of Smack, configuration data is minimal and not strictly required. The most important configuration step is mounting the smackfs pseudo filesystem. This means that checking the mount point should be enough.
2013-05-08Rearrange a few fields to reduce holesZbigniew Jędrzejewski-Szmek
2013-05-07hostname: only suppress setting of pretty hostname if it is non-equal to the ↵Lennart Poettering
static hostname and if the static hostname is set, too https://bugzilla.redhat.com/show_bug.cgi?id=957814
2013-05-07build-sys: support builds without EAs againLennart Poettering
2013-05-07kmod-setup: properly iterate through module tableLennart Poettering
Previously we skipped every second entry. This also cleans up much of the code and removes some dead code.
2013-05-06core: escape unit name from udevMUNEDA Takahiro
This patch escapes a unit name which was derived from udev. Please imagine following udev rule. ACTION=="online|offline", TAG+="systemd", ENV{SYSTEMD_WANTS}="muneda@%p.service" ACTION=="online|offline", TAG+="systemd", ENV{SYSTEMD_WANTS}="muneda@%r.service" ACTION=="online|offline", TAG+="systemd", ENV{SYSTEMD_WANTS}="muneda@%S.service" When unit name is derived from udev via udev_device_get_property_value(), the name may contains '/' if ENV{SYSTEMD_WANTS} has the udev options $devpath(%p), $root(%r), or $sys(%S). However, '/' is a invalid char for unit name so processing of this rule fails as Invalid argument with following message. Apr 22 13:21:37 localhost systemd[1]: Failed to load device unit: Invalid argument Apr 22 13:21:37 localhost systemd[1]: Failed to process udev device event: Invalid argument This patch escapes those invalid chars in a unit name. Tested with 202, and confirmed to apply cleanly on top of commit 195f8e36. Thanks, Takahiro
2013-05-06systemd-sleep: add support for freeze and standbyZbigniew Jędrzejewski-Szmek
A new config file /etc/systemd/sleep.conf is added. It is parsed by systemd-sleep and logind. The strings written to /sys/power/disk and /sys/power/state can be configured. This allows people to use different modes of suspend on systems with broken or special hardware. Configuration is shared between systemd-sleep and logind to enable logind to answer the question "can the system be put to sleep" as correctly as possible without actually invoking the action. If the user configured systemd-sleep to only use 'freeze', but current kernel does not support it, logind will properly report that the system cannot be put to sleep. https://bugs.freedesktop.org/show_bug.cgi?id=57793 https://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=7e73c5ae6e7991a6c01f6d096ff8afaef4458c36 http://lists.freedesktop.org/archives/systemd-devel/2013-February/009238.html SYSTEM_CONFIG_FILE and USER_CONFIG_FILE defines were removed since they were used in only a few places and with the addition of /etc/systemd/sleep.conf it becomes easier to just append the name of each file to the dir name.
2013-05-06core: unit_inactive_or_pending() should actually do as it claimsLennart Poettering
2013-05-06condition, man: Add support for ConditionSecurity=apparmorNirbheek Chauhan
Checking for the apparmor directory in securityfs means the apparmor module is loaded and enabled, and hence should suffice as a test. https://bugs.freedesktop.org/show_bug.cgi?id=63312
2013-05-03core: bump simultaneous bus connection limit to 512Lennart Poettering
2013-05-02Add __attribute__((const, pure, format)) in various placesZbigniew Jędrzejewski-Szmek
I'm assuming that it's fine if a _const_ or _pure_ function calls assert. It is assumed that the assert won't trigger, and even if it does, it can only trigger on the first call with a given set of parameters, and we don't care if the compiler moves the order of calls.
2013-05-01dbus-execute: fix introspectionRonny Chevalier
Add missing property and remove duplicate properties already in src/core/dbus-kill.h
2013-04-30cgroup: do not allow manipulating the cgroup path of units within the ↵Lennart Poettering
systemd:/system subtree
2013-04-30id128: when taking user input for a 128bit ID, validate syntaxLennart Poettering
Also, always accept both our simple hexdump syntax and UUID syntax.
2013-04-29man: clarify what Restart= meansZbigniew Jędrzejewski-Szmek
Related to https://bugzilla.redhat.com/show_bug.cgi?id=957135.
2013-04-26dbus-manager.c: log error, why switch-root is refusedHarald Hoyer
2013-04-25core: remove duplicate MESSAGE= from log messageMirco Tischler
This was needed with log_struct_unit() but log_notice_unit() adds it anyway.
2013-04-25Add some extra __attribute__ ((format)) sCristian Rodríguez
2013-04-25unit: rework stop pending logicLennart Poettering
When a trigger unit wants to know if a stop is queued for it, we should just check precisely that and do not check whether it is actually stopped already. This is because we use these checks usually from state change calls where the state variables are not updated yet. This change splits unit_pending_inactive() into two calls unit_inactive_or_pending() and unit_stop_pending(). The former checks state and pending jobs, the latter only pending jobs.
2013-04-25systemd: record the timestamps as early as possibleHarald Hoyer
The time for systemd initialization and selinux policy loading is accounted to the initrd or the kernel, which is wrong. Instead of: Startup finished in 5.559s (firmware) + 36ms (loader) + 665ms (kernel) + 975ms (initrd) + 1.410s (userspace) = 8.647s the more correct output is: Startup finished in 5.559s (firmware) + 36ms (loader) + 665ms (kernel) + 475ms (initrd) + 1.910s (userspace) = 8.647s
2013-04-25conf-parser: restrict .include usageLennart Poettering
Disallow recursive .include, and make it unavailable in anything but unit files.
2013-04-24cgroup: always validate cgroup controller namesLennart Poettering
Let's better be safe than sorry.
2013-04-24logind: don't busy loop if a job is still running but the delay timeout expiresLennart Poettering
2013-04-24Small cleanupZbigniew Jędrzejewski-Szmek
2013-04-24Add set_consume which always takes ownershipZbigniew Jędrzejewski-Szmek
Freeing in error path is the common pattern with set_put().