summaryrefslogtreecommitdiff
path: root/src/core
AgeCommit message (Collapse)Author
2015-11-10core: accept time units for time-based resource limitsLennart Poettering
Let's make sure "LimitCPU=30min" can be parsed properly, following the usual logic how we parse time values. Similar for LimitRTTIME=. While we are at it, extend a bit on the man page section about resource limits. Fixes: #1772
2015-11-10core: when parsing resource limits, be more careful with types and corner casesLennart Poettering
Let's not convert RLIM_INFINITY to "unsigned long long" and then back to rlim_t, but let's leave it in the right type right-away. Parse resource limits as 64 bit in all cases, as according to the man page that's what libc does anyway. Make sure setting a resource limit to (uint64_t) -1 results in a parsing error, and isn't implicitly converted to RLIM_INFINITY.
2015-11-10core: simplify parsing of capability bounding set settingsLennart Poettering
Let's generate a simple error, and that's it. Let's not try to be smart and record the last word that failed. Also, let's make sure we don't compare numeric values with 0 by relying on C's downgrade-to-bool feature, as suggested in CODING_STYLE.
2015-11-10defs: rework CONF_DIRS_NULSTR() macroLennart Poettering
The macro is generically useful for putting together search paths, hence let's make it truly generic, by dropping the implicit ".d" appending it does, and leave that to the caller. Also rename it from CONF_DIRS_NULSTR() to CONF_PATHS_NULSTR(), since it's not strictly about dirs that way, but any kind of file system path. Also, mark CONF_DIR_SPLIT_USR() as internal macro by renaming it to _CONF_PATHS_SPLIT_USR() so that the leading underscore indicates that it's internal.
2015-11-09Merge pull request #1820 from michich/errno-v2Daniel Mack
[v2] treewide: treatment of errno and other cleanups
2015-11-09Merge pull request #1799 from jengelh/docLennart Poettering
doc: typo and ortho fixes
2015-11-09Merge pull request #1807 from michich/boot-timerLennart Poettering
core/timer: in containers OnBootSec should count from container startup
2015-11-09Merge pull request #1794 from karelzak/size_limitLennart Poettering
core: support IEC suffixes for RLIMIT stuff
2015-11-07core/timer: in containers OnBootSec should count from container startupMichal Schmidt
In Fedora dnf-makecache.timer specifies OnBootSec=10min, but it fired during boot in systemd-nspawn, because the clock ticks since the host's boot. Fix it by treating OnBootSec the same as OnStartupSec when running in a container.
2015-11-07core: remove unused variableThomas Hindoe Paaboel Andersen
unused since 7b2313f5
2015-11-06doc: correct punctuation and improve typography in documentationJan Engelhardt
2015-11-06core: support IEC suffixes for RLIMIT stuffKarel Zak
Let's make things more user-friendly and support for example LimitAS=16G rather than force users to always use LimitAS=16106127360. The change is relevant for options: [Default]Limit{FSIZE,DATA,STACK,CORE,RSS,AS,MEMLOCK,MSGQUEUE} The patch introduces config_parse_bytes_limit(), it's the same as config_parse_limit() but uses parse_size() tu support the suffixes. Addresses: https://github.com/systemd/systemd/issues/1772
2015-11-05treewide: use the negative error codes returned by our functionsMichal Schmidt
Our functions return negative error codes. Do not rely on errno being set after calling our own functions.
2015-11-04core: still make progress when throttling the manager loopVito Caputo
Don't simply continue after sleeping, it potentially puts us in a state of spinning doing nothing slowly, if the ratelimit_test() keeps detecting the need for limiting. Observed in vms after the host had been suspended for a while, on resume systemd entered a loop of making zero progress spamming the console with: [431942.850090] systemd[1]: Looping too fast. Throttling execution a little. I see no reason to have a continue here, the intention should be to throttle execution, not circumvent it altogether.
2015-11-04Merge pull request #1761 from ssahani/wordLennart Poettering
core: parse socket port to extract_first_word
2015-11-04core: fix typoTorstein Husebø
2015-11-04core: small fixes to parse_namespaceEvgeny Vereshchagin
* don't hide ENOMEM * log r instead of 0
2015-11-03core: parse socket port to extract_first_wordSusant Sahani
2015-11-03Merge pull request #1744 from evverx/fix-debug-generatorLennart Poettering
debug-generator: respect kernel parameters for default unit setting
2015-11-03core: use runlevel_to_target for /proc/cmdline parsingEvgeny Vereshchagin
2015-11-03Merge pull request #1754 from martinpitt/masterDaniel Mack
core: drop check for /etc/mtab
2015-11-02core: expose number of file descriptors in fd store on the busLennart Poettering
For each service expose how many file descriptors there are currently in the fd store. (Also, fix the exporting of the fdstore limit, given that the field is just an "unsigned" but we exported it as "uint32_t". Not that there way any effective difference, but let's make this clean...)
2015-11-02core: bump net.unix.max_dgram_qlen really early during bootLennart Poettering
Only that way it actually has an effect on all our sockets, including $NOTIFY_SOCKET.
2015-11-02Merge pull request #1690 from evverx/run-runtime-directoryLennart Poettering
systemd-run can launch units with RuntimeDirectory
2015-11-02core: drop check for /etc/mtabMartin Pitt
util-linux 2.27.1 now entirely stops looking at /etc/mtab, so we don't need to verify /etc/mtab during early boot any more. Later on, tmpfiles.d/etc.conf will fix /etc/mtab anyway, so there's not even a point in warning about it. Drop test_mtab() and bump the util-linux dependency to >= 2.17.1. Fixes #1495
2015-11-02Merge pull request #1722 from evverx/port-cap-bounding-set-to-extract-first-wordDaniel Mack
Port capabiliy bounding set parsing to extract_first_word
2015-11-02core: be more verbose when NameOwnerChanged subscriptions failDaniel Mack
2015-11-02core: service: fix error messageDaniel Mack
The directive is called FileDescriptorStoreMax=, not FDStoreMax=.
2015-10-31sd-daemon: increase sd_notify() socket buffer sizeLennart Poettering
Let's make sure we don't start blocking on sd_notify() earlier than necessary, let's bump the socket buffer sizes to 8M. We already do something similar for our logging socket buffers, hence apply a similar bump here.
2015-10-31core: bail our earlier when doing auditLennart Poettering
Let's make sure we don't even try to create the audit socket
2015-10-31core,nspawn: minor coding style fixesLennart Poettering
2015-10-31core: constify a few thingsLennart Poettering
2015-10-31core: set_unit_path overwrites SYSTEMD_UNIT_PATHEvgeny Vereshchagin
2015-10-30core: port config_parse_bounding_set to extract_first_wordEvgeny Vereshchagin
2015-10-29core: fix capability bounding set parsingEvgeny Vereshchagin
bug: CapabilityBoundingSet= doesn't reset all caps
2015-10-28core: fix priority ordering in notify-handlingDavid Herrmann
Currently, we dispatch NOTIFY messages in a tight loop. Regardless how much data is incoming, we always dispatch everything that is queued. This, however, completely breaks priority event-handling of sd-event. When dispatching one NOTIFY event, another completely different event might fire, or might be queued by the NOTIFY handling. However, this event will not get dispatched until all other further NOTIFY messages are handled. Those might even arrive _after_ the other event fired, and as such completely break priority ordering of sd-event (which several code paths rely on). Break this by never dispatching multiple messages. Just return after each message that was read and let sd-event handle everything else. (The patch looks scarier that it is. It basically just drops the for(;;) loop and re-indents the loop-content.)
2015-10-27Merge pull request #1698 from poettering/pid-is-unwaited-fixTom Gundersen
fixup for previous pr
2015-10-27service: exiting early is nicer than deeply-indented code blocksLennart Poettering
2015-10-27core: all unit types that watch control PIDs should use the same logicLennart Poettering
When coldplugging the unit state, make sure to follow the same basic logic for all unit types: always verify whether the control PID is still a waitable process before proceeding.
2015-10-27core: don't pass uninitialzed PIDs to pid_is_unwaited()Lennart Poettering
Since 5fd9b2c5467b0a42ccdabc7eb8e516d512609a8e passing a pid of 0 to pid_is_unwaited() and pid_is_live() is considered as a request on the current process, similar how the other calls in process-util.c handle a PID of 0. This broke service.c, which passes a 0 PID and expects it to be considered an unwaited process. This fix make sure we can boot again.
2015-10-27Merge pull request #1695 from evverx/fix-cap-bounding-mergingLennart Poettering
core: fix CapabilityBoundingSet merging
2015-10-27util-lib: move inotify-related definitions to fs-util.[ch]Lennart Poettering
2015-10-27automount: move generically userful call repeat_mount() into mount-util.[ch]Lennart Poettering
2015-10-27process-util: move a couple of process-related calls overLennart Poettering
2015-10-27process-util: rename get_parent_of_pid() → get_process_ppid()Lennart Poettering
In order to match the other get_process_xyz() calls.
2015-10-27mount-util: move fstype_is_network() and name_to_handle_at() definitions overLennart Poettering
2015-10-27util-lib: split out allocation calls into alloc-util.[ch]Lennart Poettering
2015-10-27util-lib: split out globbing related calls into glob-util.[ch]Lennart Poettering
2015-10-27util-lib: split out printf() helpers to stdio-util.hLennart Poettering
2015-10-27io-util.h: move iovec stuff from macro.h to io-util.hLennart Poettering