summaryrefslogtreecommitdiff
path: root/src/core
Commit message (Collapse)AuthorAge
...
* core: open up DefaultDependencies= property for transient unitsLennart Poettering2015-02-03
|
* core: busname_supported() should cache what it detectsJohannes Hölzl2015-02-03
| | | | Add the missing "static" to actually make this a cache.
* core: use some nice macros where appropriateLennart Poettering2015-02-03
|
* loopback-setup: simplify code a bitLennart Poettering2015-02-03
|
* loopback-setup: no need to redefine LOOPBACK_IFINDEX, we already have it in ↵Lennart Poettering2015-02-03
| | | | missing.h
* util: rework strappenda(), and rename it strjoina()Lennart Poettering2015-02-03
| | | | | | After all it is now much more like strjoin() than strappend(). At the same time, add support for NULL sentinels, even if they are normally not necessary.
* config_parse_set_status: put signals in the correct setMichael Olbrich2015-02-01
| | | | | This was broken when the code was rearranged in "1e2fd62d70ff core/load-fragment.c: correct argument sign and split up long lines"
* Add a snprinf wrapper which checks that the buffer was big enoughZbigniew Jędrzejewski-Szmek2015-02-01
| | | | | | | | | | If we scale our buffer to be wide enough for the format string, we should expect that the calculation was correct. char_array_0() invocations are removed, since snprintf nul-terminates the output in any case. A similar wrapper is used for strftime calls, but only in timedatectl.c.
* core/cgroup: fix embarrassing typoZbigniew Jędrzejewski-Szmek2015-01-31
| | | | https://github.com/docker/docker/issues/10280
* core: make setting the shutdown watchdog configuration via dbus workMaxim Mikityanskiy2015-01-30
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=88284
* Revert "core: make setting the shutdown watchdog configuration via dbus work"Kay Sievers2015-01-30
| | | | | | | | | | | | | | | | | | | | This reverts commit df6e44c4affced590b0d19c594d9301ffd436591. systemd --version segfaults. Starting program: /usr/lib/systemd/systemd --version Missing separate debuginfos, use: debuginfo-install systemd-216-16.fc21.x86_64 [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". systemd 218 +PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN Program received signal SIGSEGV, Segmentation fault. 0x000055555557c9be in main (argc=2, argv=0x7fffffffe4d8) at src/core/main.c:1832 1832 arg_shutdown_watchdog = m->shutdown_watchdog; (gdb) bt (gdb) bt full m = 0x0
* core: make setting the shutdown watchdog configuration via dbus workMaxim Mikityanskiy2015-01-29
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=88284
* core/mount: add dependencies to dynamically mounted mounts tooMartin Pitt2015-01-28
| | | | | | | | | | Add unit dependencies for dynamic (i. e. not from fstab) mounts. With that, mount units properly bind to their underlying device, and thus get automatically stopped/unmounted when the underlying device goes away. This cleans up stale mounts from unplugged devices. Thanks to Lennart Poettering for pointing out the fix!
* core: output unit status output strings to console, only if we actually are ↵Lennart Poettering2015-01-28
| | | | | | | | | changing unit state Unit _start() and _stop() implementations can fail with -EAGAIN to delay execution temporarily. Thus, we should not output status messages before invoking these calls, but after, and only when we know that the invocation actually made a change.
* manager: fix minor typoLennart Poettering2015-01-28
|
* manager: when we immediately reboot due to 7x C-A-D within 2s, mention this ↵Lennart Poettering2015-01-28
| | | | on the console too
* core: when the user hits Ctrl-Alt-Del more than 7x per 2s, reboot immediatelyLennart Poettering2015-01-28
| | | | | This should be useful for cases where clean rebooting doesn't work, and the user wants to hurry up the reboot.
* core: if two start jobs for the same swap device node are queued, only ↵Lennart Poettering2015-01-28
| | | | | | | | | | | | | | | | | | | | | dispatch one of them at a time If two start jobs for two seperate .swap device nodes are queued, which then turns out to be referring to the same device node, refuse dispatching more than one of them at the same time. This should solve an issue when the same swap partition is found via GPT auto-discovery and via /etc/fstab, where one uses a symlink path, and the other the raw devce node. So far we might have ended up invoking mkswap on the same node at the very same time with the two device node names. With this change only one mkswap should be executed at a time. THis mkswap should have immediate effect on the other swap unit, due to the state in /proc/swaps changing, and thus suppressing actual invocation of the second mkswap. http://lists.freedesktop.org/archives/systemd-devel/2015-January/027314.html
* swap: simplify a few things by making use of new LIST_FOREACH_OTHERS macroLennart Poettering2015-01-28
|
* swap: properly specify errno when loggingLennart Poettering2015-01-28
|
* core: explain why failing to set up the crash handler is not a real problemLennart Poettering2015-01-27
| | | | http://lists.freedesktop.org/archives/systemd-devel/2015-January/027428.html
* treewide: fix multiple typosTorstein Husebø2015-01-26
|
* mount-setup: Do not bother with /proc/bus/usbCristian Rodríguez2015-01-23
| | | | | | | Current systemd requires kernel >= 3.7 per the README file but CONFIG_USB_DEVICEFS disappeared from the kernel in upstream commit fb28d58b72aa9215b26f1d5478462af394a4d253 (kernel 3.5-rc1)
* core,shutdown: don't bother with unmounting any mounts below /sys, /proc, ↵Lennart Poettering2015-01-23
| | | | | | | | | | | /dev when shutting down After all, mounts below these directories are pretty much guaranteed to be virtual, and it's hence unnecessary to unmount them during shutdown. Moreover, in less-priviliged containers we might lack the rights to unmount them, hence don't even try. http://lists.freedesktop.org/archives/systemd-devel/2015-January/027113.html
* mount-setup: /selinux, /cgroup, /dev/cgroup are sooo old, don't bother with ↵Lennart Poettering2015-01-23
| | | | them anymore
* core: add a property that shows the current memory usage of a unitLennart Poettering2015-01-23
| | | | | This is exposed the memory.usage_in_bytes cgroup property on the bus, and makes "systemctl status" show it in its default output.
* importd: when listing transfers, show progress percentageLennart Poettering2015-01-23
| | | | | | | | With this change the pull protocol implementation processes will pass progress data to importd which then passes this information on via the bus. We use sd_notify() as generic transport for this communication, making importd listen to them, while matching the incoming messages to the right transfer.
* core: zero size notify messages are OKLennart Poettering2015-01-23
|
* Assorted format fixesZbigniew Jędrzejewski-Szmek2015-01-22
| | | | | Types used for pids and uids in various interfaces are unpredictable. Too bad.
* util: make http url validity checks more generic, and move them to util.cLennart Poettering2015-01-20
|
* cgroup: fix typoDaniel Mack2015-01-19
|
* core: write kdbus.attach_flags_mask only on real bootDavid Herrmann2015-01-18
| | | | | | The kernel module system is not namespaced, so no container should ever modify global options. Make sure we set the kdbus attach_flags_mask only on a real boot as PID1.
* bus: use EUID over UID and fix unix-credsDavid Herrmann2015-01-18
| | | | | | | | | | | | | | | | | | | | | Whenever a process performs an action on an object, the kernel uses the EUID of the process to do permission checks and to apply on any newly created objects. The UID of a process is only used if someone *ELSE* acts on the process. That is, the UID of a process defines who owns the process, the EUID defines what privileges are used by this process when performing an action. Process limits, on the other hand, are always applied to the real UID, not the effective UID. This is, because a process has a user object linked, which always corresponds to its UID. A process never has a user object linked for its EUID. Thus, accounting (and limits) is always done on the real UID. This commit fixes all sd-bus users to use the EUID when performing privilege checks and alike. Furthermore, it fixes unix-creds to be parsed as EUID, not UID (as the kernel always takes the EUID on UDS). Anyone using UID (eg., to do user-accounting) has to fall back to the EUID as UDS does not transmit the UID.
* remove unneeded libgen.h includesCristian Rodríguez2015-01-17
|
* core: Fix EACCES check for OOM adjustmentsMartin Pitt2015-01-13
| | | | Commit 3bd5c3 added a check for EACCES, but missed the minus sign.
* core/mount: remove "fail" againZbigniew Jędrzejewski-Szmek2015-01-12
| | | | | | | deb6120920 'man: there's actually no "fail" fstab option, but only "nofail" removed it from our documentation, which I missed. fstab(5) only mentions "auto", "noauto", and "nofail". Stick to those three.
* sd-bus: sync kdbus.h (API break)Daniel Mack2015-01-12
| | | | | Just a simple variable rename, and a dropped flag that sd-bus didn't make use of.
* core/mount: use isempty() to check for empty stringsDaniel Mack2015-01-12
| | | | | | | | | strempty() will return an empty string in case the input parameter is a NULL pointer. The correct test to check for an empty string is isempty(), so use that instead. This fixes a regression from commit 17a1c59 ("core/mount: filter out noauto,auto,nofail,fail options").
* core/load-fragment: avoid allocating 0 bytes when given an invalid commandZbigniew Jędrzejewski-Szmek2015-01-11
| | | | | With a command line like "@/something" we would allocate an array with 0 elements. Avoid that, and add a test too.
* core/mount: filter out noauto,auto,nofail,fail optionsZbigniew Jędrzejewski-Szmek2015-01-11
| | | | | | | | | | | | | | | | | We passed the full option string from fstab to /bin/mount. It would in turn pass the full option string to its helper, if it needed to invoke one. Some helpers would ignore things like "nofail", but others would be confused. We could try to get all helpers to ignore those "meta-options", but it seems better to simply filter them out. In our model, /bin/mount simply has no business in knowing whether the mount was configured as fail or nofail, auto or noauto, in the fstab. If systemd tells invokes a command to mount something, and it fails, it should always return an error. It seems cleaner to filter out the option, since then there's no doubt how the command should behave. https://bugzilla.redhat.com/show_bug.cgi?id=1177823
* Add new function to filter fstab optionsZbigniew Jędrzejewski-Szmek2015-01-11
| | | | | | | | | | | | | | | | | | | | This fixes parsing of options in shared/generator.c. Existing code had some issues: - it would treate whitespace and semicolons as seperators. fstab(5) is pretty clear that only commas matter. And the syntax does not allow for spaces to be inserted in the field in fstab. Whitespace might be escaped, but then it should not seperate options. Treat whitespace and semicolons as any other character. - it assumed that x-systemd.device-timeout would always be followed by "=". But this is not guaranteed, hasmntopt will return this option even if there's no value. Uninitialized memory could be read. - some error paths would log, and inconsistently, some would just return an error code. Filtering is split out to a separate function and tests are added. Similar code paths in other places are adjusted to use the new function.
* Implement masking and overriding of generatorsZbigniew Jędrzejewski-Szmek2015-01-11
| | | | | | | | | | | | | | | | | | | | | | Sometimes it is necessary to stop a generator from running. Either because of a bug, or for testing, or some other reason. The only way to do that would be to rename or chmod the generator binary, which is inconvenient and does not survive upgrades. Allow masking and overriding generators similarly to units and other configuration files. For the systemd instance, masking would be more common, rather than overriding generators. For the user instances, it may also be useful for users to have generators in $XDG_CONFIG_HOME to augment or override system-wide generators. Directories are searched according to the usual scheme (/usr/lib, /usr/local/lib, /run, /etc), and files with the same name in higher priority directories override files with the same name in lower priority directories. Empty files and links to /dev/null mask a given name. https://bugs.freedesktop.org/show_bug.cgi?id=87230
* Simplify execute_directory()Zbigniew Jędrzejewski-Szmek2015-01-11
| | | | | | | | | Remove the optional sepearate opening of the directory, it would be just too complicated with the change to multiple directories. Move the middle of execute_directory() to a seperate function to make it easier to grok.
* core: modernize execution code a bitLennart Poettering2015-01-09
| | | | | | | | | | | | Among other things, avoid log_struct() unless we really need it. Also, use "r" as variable to store function errors in, instead of "err". "r" is pretty much what we use everywhere else, hence using the same here make sense. FInally, in the child, when we want to log, make sure to open the logging framework first, since it is explicitly closed in preparation for the exec().
* core: check both EPERM and EACCES for OOM adjustmentsLennart Poettering2015-01-08
|
* core: make EPERM errors when applying OOM adjustment for forked processes ↵Lennart Poettering2015-01-08
| | | | | | non-fatal This should be useful for user namespaces.
* service: automatically create After= dependency from services to their ↵Lennart Poettering2015-01-07
| | | | .busname units, if BusName= is set
* conf-parse: don't accept invalid bus names as BusName= arguments in service ↵Lennart Poettering2015-01-07
| | | | units
* core: implement serialization/deserialization of fd store elementsLennart Poettering2015-01-07
|
* tree-wide: remove unnecessary LOG_PRIZbigniew Jędrzejewski-Szmek2015-01-06
| | | | | LOG_DEBUG is already a log level, there is no need to use LOG_PRI which is for filtering out the facility.