summaryrefslogtreecommitdiff
path: root/src/core
AgeCommit message (Collapse)Author
2014-05-21logind: don't apply RemoveIPC= to system usersLennart Poettering
We shouldn't destroy IPC objects of system users on logout. http://lists.freedesktop.org/archives/systemd-devel/2014-April/018373.html This introduces SYSTEM_UID_MAX defined to the maximum UID of system users. This value is determined compile-time, either as configure switch or from /etc/login.defs. (We don't read that file at runtime, since this is really a choice for a system builder, not the end user.) While we are at it we then also update journald to use SYSTEM_UID_MAX when we decide whether to split out log data for a specific client.
2014-05-19core: Filter by state behind the D-Bus API, not in the systemctl client.David Strauss
2014-05-19fix spelling of privilegeNis Martensen
2014-05-16core: let selinux_setup() load policy more than onceWill Woods
When you switch-root into a new root that has SELinux policy, you're supposed to to run selinux_init_load_policy() to set up SELinux and load policy. Normally this gets handled by selinux_setup(). But if SELinux was already initialized, selinux_setup() skips loading policy and returns 0. So if you load policy normally, and then you switch-root to a new root that has new policy, selinux_setup() never loads the new policy. What gives? As far as I can tell, this check is an artifact of how selinux_setup() worked when it was first written (see commit c4dcdb9 / systemd v12): * when systemd starts, run selinux_setup() * if selinux_setup() loads policy OK, restart systemd So the "if policy already loaded, skip load and return 0" check was there to prevent an infinite re-exec loop. Modern systemd only calls selinux_setup() on initial load and after switch-root, and selinux_setup() no longer restarts systemd, so we don't need that check to guard against the infinite loop anymore. So: this patch removes the "return 0", thus allowing selinux_setup() to actually perform SELinux setup after switch-root. We still want to check to see if SELinux is initialized, because if selinux_init_load_policy() fails *but* SELinux is initialized that means we still have (old) policy active. So we don't need to halt if enforce=1.
2014-05-16core: make sure to serialize jobs for all unitsLennart Poettering
Previously we wouldn't serialize jobs for units that themselves have nothing to serialize. http://lists.freedesktop.org/archives/systemd-devel/2014-May/019051.html
2014-05-15selinux: fix build for non-selinux systemsLennart Poettering
2014-05-15core: close socket fds asynchronouslyZbigniew Jędrzejewski-Szmek
http://lists.freedesktop.org/archives/systemd-devel/2014-April/018928.html
2014-05-15Make sure that keys are properly removed from hashmapZbigniew Jędrzejewski-Szmek
This is a speculative fix for https://bugzilla.redhat.com/show_bug.cgi?id=1088865. Even though I cannot find a code path that where this would be an issue, for consistency, if we assume that cgroup_path might have been set before we got to unit_deserialize, we should make sure that the unit is removed from the hashmap before we free the key. This seems to be the only place where the key could be prematurely freed, leading to hashmap corruption.
2014-05-15Remove unnecessary casts in printfsZbigniew Jędrzejewski-Szmek
No functional change expected :)
2014-05-15Make systemctl --root look for files in the proper placesZbigniew Jędrzejewski-Szmek
Running systemctl enable/disable/set-default/... with the --root option under strace reveals that it accessed various files and directories in the main fs, and not underneath the specified root. This can lead to correct results only when the layout and configuration in the container are identical, which often is not the case. Fix this by adding the specified root to all file access operations. This patch does not handle some corner cases: symlinks which point outside of the specified root might be interpreted differently than they would be by the kernel if the specified root was the real root. But systemctl does not create such symlinks by itself, and I think this is enough of a corner case not to be worth the additional complexity of reimplementing link chasing in systemd. Also, simplify the code in a few places and remove an hypothetical memory leak on error.
2014-05-15sd-bus: introduce sd_bus_slot objects encapsulating callbacks or vtables ↵Lennart Poettering
attached to a bus connection This makes callback behaviour more like sd-event or sd-resolve, and creates proper object for unregistering callbacks. Taking the refernce to the slot is optional. If not taken life time of the slot will be bound to the underlying bus object (or in the case of an async call until the reply has been recieved).
2014-05-14core: no need to pass bus object to selinux access check calls anymoreLennart Poettering
2014-05-14core: sysvcompat - avoid repeated function callTom Gundersen
2014-05-14core: sysvcompat - $network should be equivalent to network-online, rather ↵Tom Gundersen
than network target Most likely the facility needed is actual connectivity, rather than whether or not the network managment daemon is running. We also need to explicitly pull in the network-online.target, as it is not active by default. This means {systemd-networkd,NetworkManager}-wait-online.service, can be enabled by default as part of network-online.target, and only delay boot when some service actively pulls it in. See: <https://bugzilla.gnome.org/show_bug.cgi?id=728965> Cc: Pavel Šimerda <psimerda@redhat.com> Cc: Michal Sekletar <msekleta@redhat.com>
2014-05-12job: always add waiting jobs to run queue during coldplugMichael Marineau
commit 20a83d7bf was not equivalent to the original bug fix proposed by Michal Sekletar <msekleta@redhat.com>. The committed version only added the job to the run queue if the job had a timeout, which most jobs do not have. Just re-ordering the code gets us the intended functionality
2014-05-08core: check the right variable for failed open()Łukasz Stelmach
2014-05-07doc: corrections to words and formsJan Engelhardt
This patch exchange words which are inappropriate for a situation, deletes duplicated words, and adds particles where needed.
2014-05-06load-fragment: minor cleanupLennart Poettering
2014-05-05build-sys: move async.[ch] to src/sharedLennart Poettering
So that we can use it at multiple places.
2014-05-05core: require cgroups filesystem to be availableKay Sievers
We should no longer pretend that we can run in any sensible way without the kernel supporting us with cgroups functionality.
2014-05-02async: add asynchronous close() callLennart Poettering
2014-04-28machine-id: only look into KVM uuid when we are not running in aLennart Poettering
container
2014-04-26job: add waiting jobs to run queue in unit_coldplugBrandon Philips
When we have job installed and added to run queue for service which is still in dead state and systemd initiates reload then after reload we never add deserialized job to the run queue again. This is caused by check in service_coldplug() where we check if deserialized state is something else than dead state, which is not the case thus we never call service_set_state() and finally unit_notify() where we would have added job to the run queue. Thanks to Michal Sekletar <msekleta@redhat.com> for the original patch.
2014-04-26core: reindent {selinux, ima, smack}-setup.cWill Woods
7-space indentation is just too weird to leave alone. Make it 8 spaces, as per CODING_STYLE. No other changes.
2014-04-25core: expose CFS CPU time quota as high-level unit propertiesLennart Poettering
2014-04-25core: make sure we always write changed cgroup attributes to the cgroupfsLennart Poettering
2014-04-24service: rename StartLimitAction enum to FailureActionMichael Olbrich
It's used for the FailureAction property as well.
2014-04-24service: add FailureAction= optionMichael Olbrich
It has the same possible values as StartLimitAction= and is executed immediately if a service fails.
2014-04-21service: add support for reboot argument when triggered by StartLimitAction=Michael Olbrich
When rebooting with systemctl, an optional argument can be passed to the reboot system call. This makes it possible the specify the argument in a service file and use it when the service triggers a restart. This is useful to distinguish between manual reboots and reboots caused by failing services.
2014-04-19Handle Unix domain socket connections from outside our namespace v2Zbigniew Jędrzejewski-Szmek
This is a second attempt at 9754d56, reverted in 2f20a8e, because I lost a 'break;' when moving chunks around.
2014-04-19Revert "Handle Unix domain socket connections from outside our namespace"Kay Sievers
This reverts commit 9754d56e9b21bfe89fc18f47987d6bef491b8521. It causes a crash in PID1: Apr 19 13:49:32 lon systemd[1]: Code should not be reached 'Unhandled socket type.' at src/core/socket.c:684, function instance_from_socket(). Aborting. Apr 19 13:49:32 lon systemd[1]: Caught <ABRT>, dumped core as pid 336. Apr 19 13:49:32 lon systemd[1]: Freezing execution.
2014-04-17core: minor typo fixAli H. Caliskan
2014-04-16Handle Unix domain socket connections from outside our namespaceEelco Dolstra
NixOS uses Unix domain sockets for certain host <-> container interaction; i.e. the host connects to a socket visible in the container's directory tree, where the container uses a .socket unit to spawn the handler program on demand. This worked in systemd 203, but in 212 fails with "foo.socket failed to queue service startup job (Maybe the service file is missing or not a template unit?): No data available". The reason is that getpeercred() now returns ENODATA if it can't get the PID of the client, which happens in this case because the client is not in the same PID namespace. Since getpeercred() is only used to generate the instance name, this patch simply handles ENODATA by creating an instance name "<nr>-unknown". [zj: reorder clauses and remove (unsigned long) casts.]
2014-04-12core: Make sure a stamp file exists for all Persistent=true timersThomas Bächler
If a persistent timer has no stamp file yet, it behaves just like a normal timer until it runs for the first time. If the system is always shut down while the timer is supposed to run, a stamp file is never created and Peristent=true has no effect. This patch fixes this by creating a stamp file with the current time when the timer is first started.
2014-04-06reduce the amount of messages logged to /dev/kmsg when "debug" is specifiedKay Sievers
2014-03-26core: do not read system boot timestamps in systemd --user modeKay Sievers
Before: $ systemd-analyze --user Startup finished in 2.810s (firmware) + 48ms (loader) + 122ms (userspace) = 122ms After: $ systemd-analyze --user Startup finished in 122ms (userspace) = 122ms
2014-03-24core: don't try to relabel mounts before we loaded the policyLennart Poettering
2014-03-24core: remove tcpwrap supportLennart Poettering
tcpwrap is legacy code, that is barely maintained upstream. It's APIs are awful, and the feature set it exposes (such as DNS and IDENT access control) questionnable. We should not support this natively in systemd. Hence, let's remove the code. If people want to continue making use of this, they can do so by plugging in "tcpd" for the processes they start. With that scheme things are as well or badly supported as they were from traditional inetd, hence no functionality is really lost.
2014-03-24service: don't take chkconfig priority into accountLennart Poettering
Given that native services do not carry a sysv priority anyway it is pointless reading them from chkconfig headers, and pretend they'd work. So let's drop this.
2014-03-24core: add a setting to globally control the default for timer unit accuracyLennart Poettering
2014-03-24timer: support timers that can resume the system from suspendLennart Poettering
2014-03-24systemctl: show last trigger time in "systemctl list-timers"Lennart Poettering
2014-03-24util: replace close_pipe() with new safe_close_pair()Lennart Poettering
safe_close_pair() is more like safe_close(), except that it handles pairs of fds, and doesn't make and misleading allusion, as it works similarly well for socketpairs() as for pipe()s...
2014-03-24sd-event: rework API to support CLOCK_REALTIME_ALARM and ↵Lennart Poettering
CLOCK_BOOTTIME_ALARM, too
2014-03-21timer: add timer persistance (aka anacron-like behaviour)Lennart Poettering
2014-03-20unit: turn off mount propagation for udevdLennart Poettering
Keep mounts done by udev rules private to udevd. Also, document how MountFlags= may be used for this.
2014-03-19core: move notify sockets to /run and $XDG_RUNTIME_DIRLennart Poettering
A service with PrivateNetwork= cannot access abstract namespace sockets of the host anymore, hence let's better not use abstract namespace sockets for this, since we want to make sure that PrivateNetwork= is useful and doesn't break sd_notify().
2014-03-19core: make sure we can combine DevicePolicy=closed with PrivateDevices=yesLennart Poettering
if PrivateDevices=yes is used we need to make sure we can still create /dev/null and so on.
2014-03-19core: rework context initialization/destruction logicLennart Poettering
Let's automatically initialize the kill, exec and cgroup contexts of the various unit types when the object is constructed, instead of invididually in type-specific code. Also, when PrivateDevices= is set, set DevicePolicy= to closed.
2014-03-19core: when PrivateTmp= is set for a unit, make sure to order it after /tmp ↵Lennart Poettering
and /var/tmp are mounted