summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* Simplify the meaning of %sZbigniew Jędrzejewski-Szmek2013-03-26
| | | | | | | | | | | | | | | | | | | The rules governing %s where just too complicated. First of all, looking at $SHELL is dangerous. For systemd --system, it usually wouldn't be set. But it could be set if the admin first started a debug shell, let's say /sbin/sash, and then launched systemd from it. This shouldn't influence how daemons are started later on, so is better ignored. Similar reasoning holds for session mode. Some shells set $SHELL, while other set it only when it wasn't set previously (e.g. zsh). This results in fragility that is better avoided by ignoring $SHELL totally. With $SHELL out of the way, simplify things by saying that %s==/bin/sh for root, and the configured shell otherwise. get_shell() is the only caller, so it can be inlined. Fixes one issue seen with 'make check'.
* units: automatically order all mount units after network.targetLennart Poettering2013-03-27
| | | | | | | | | | | | Previously it was necessary to pull in remote-fs-pre.target to order the mount units against network.target since the ordering was done transitively via remote-fs-pre.target. As network implementations shouldn't need to know about the specific use-case of network mounts we instead now simply order network.target against all mounts too. This should make it unnecessary for network managing services to import remote-fs-pre.target explicitly, as network.target will now suffice.
* readahead: cleanupsAuke Kok2013-03-26
| | | | | - check for OOM - no need to use floats and round()
* readahead: chunk on spinning mediaAuke Kok2013-03-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Readahead has all sorts of bad side effects depending on your storage media. On rotating disks, it may be degrading startup performance if enough requests are queued spanning linearly over all blocks early at boot, and mount, blkid and friends want to insert reads to the start of these block devices after. The end result is that on spinning disks with ext3/4 that udev and mounts take a very long time, and nothing really happens until readahead is completely finished. This has the net effect that the CPU is almost entirely idle for the entire period that readahead is working. We could have finished starting up quite a lot of services in this time if we were smarter at how we do readahead. This patch sorts all requests into 2 second "chunks" and sub-sorts each chunk by block. This adds a single cross-drive seek per "chunk" but has the benefit that we will have a lot of the blocks we need early on in the boot sequence loaded into memory faster. For a comparison of how before/after bootcharts look (ext4 on a mobile 5400rpm 250GB drive) please look at: http://foo-projects.org/~sofar/blocked-tests/ There are bootcharts in the "before" and "after" folders where you should be able to see that many low-level services finish 5-7 seconds earlier with the patch applied (after).
* cryptsetup: when prompting for password use GPT partition labelLennart Poettering2013-03-26
| | | | | If there's a GPT partition label set for a LUKS partition, then it's nicer to show that than the model number, when asking for a passphrase.
* fstab-generator: drop x-initrd.rootfs mount optionHarald Hoyer2013-03-26
| | | | | | | | | | | x-initrd.mount now has different meanings, if fstab-generator is called in the initramfs. initrd:/etc/fstab and x-initrd.mount defines mounts for the initrd-root-fs.target initrd:/sysroot/etc/fstab and x-initrd.mount defines mounts for the initrd-fs.target
* fstab-generator: degrade the message about missing "root=" to log_debugHarald Hoyer2013-03-26
| | | | | Some installation media (fedora at least) does not have and need a "root=" argument on the kernel command line.
* Drop src/login/uaccess.c, dead codeMartin Pitt2013-03-26
| | | | This moved to src/udev/udev-builtin-uaccess.c a while ago.
* bus: fix missing variable initializationLennart Poettering2013-03-26
|
* modules-load: there's really no point in mentioning that a certain modules ↵Lennart Poettering2013-03-26
| | | | | | | is already loaded After all, this runs in parallel to udev, so there's quite a chance it already is....
* build-sys: make gcc shut upLennart Poettering2013-03-26
|
* bus: when we are talking to a bus, SCM_CREDS/SCM_SECLABEL are not very usefulLennart Poettering2013-03-26
|
* bus: automatically generate minimal introspection data to find installed objectsLennart Poettering2013-03-26
|
* bus: rename send_hello flag to bus_cientLennart Poettering2013-03-26
| | | | | This way we can hide more than just the hello logic behind this flag, for example, later on automatic match management.
* cryptsetup-generator: let's be a bit more efficient with strv_extend()Lennart Poettering2013-03-25
|
* cryptsetup-generator: add a missing OOM checkLennart Poettering2013-03-25
|
* units: introduce remote-fs-setup.target to pull in dependencies from remote ↵Lennart Poettering2013-03-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | mounts This introduces remote-fs-setup.target independently of remote-fs-pre.target. The former is only for pulling things in, the latter only for ordering. The new semantics: remote-fs-setup.target: is pulled in automatically by all remote mounts. Shall be used to pull in other units that want to run when at least one remote mount is set up. Is not ordered against the actual mount units, in order to allow activation of its dependencies even 'a posteriori', i.e. when a mount is established outside of systemd and is only picked up by it. remote-fs-pre.target: needs to be pulled in automatically by the implementing service, is otherwise not part of the initial transaction. This is ordered before all remote mount units. A service that wants to be pulled in and run before all remote mounts should hence have: a) WantedBy=remote-fs-setup.target -- so that it is pulled in b) Wants=remote-fs-pre.target + Before=remote-fs-pre.target -- so that it is ordered before the mount point, normally.
* units: introduce new timers.target and paths.target to hook timer/path units ↵Lennart Poettering2013-03-25
| | | | into for boot
* fstab-generator: add missing strempty() callsMantas Mikulėnas2013-03-25
|
* fstab-generator: fix minor memory leak on error pathLennart Poettering2013-03-25
|
* fstab-generator: add missing OOM checkLennart Poettering2013-03-25
|
* fstab-generator: rename x-initrd-rootfs.mount to x-initrd.rootfsLennart Poettering2013-03-25
| | | | | | This changes the fstab mount option x-initrd-rootfs.mount to x-initrd.rootfs, in order to only use a single namespace "x-initrd." for all mount options of the initrd.
* journal: Add sync timer to journal serverOleksii Shevchuk2013-03-25
| | | | | | | | Add option to force journal sync with fsync. Default timeout is 5min. Interval configured via SyncIntervalSec option at journal.conf. Synced journal files will be marked as OFFLINE. Manual sync can be performed via sending SIGUSR1.
* core: ensure LSB Provides are handled correctlyFrederic Crozat2013-03-25
| | | | | | | | | | | | | | | | | | | | | Let's say you have two initscripts, A and B: A contains in its LSB header: Required-Start: C and B contains in its LSB header: Provides: C When systemd is parsing /etc/rc.d/, depending on the file order, you can end up with either: - B is parsed first. An unit "C.service" will be "created" and will be added as additional name to B.service, with unit_add_name. No bug. - A is parsed first. An unit "C.service" is created for the "Required-Start" dependency (it will have no file attached, since nothing provides this dependency yet). Then B is parsed and when trying to handle "Provides: C", unit_add_name is called but will fail, because "C.service" already exists in manager->units. Therefore, a merge should occur for that case.
* udevd.c: set udev children_max according to CPU countHarald Hoyer2013-03-25
| | | | Setting children_max according to RAM leads to too much concurrent I/O.
* timer: downgrade time change message to debugMichal Schmidt2013-03-25
| | | | | | | | The manager already prints "Time has been changed" at level info. It seems too verbose to print the time change message additionally for every waiting timer unit. Downgrade the per-unit message to debug.
* bus: split socket related code into bus-socket.[ch], to prepare for kdbus ↵Lennart Poettering2013-03-25
| | | | backend
* bus: implement 'unixexec:' protocolLennart Poettering2013-03-25
|
* bus: make optional whether unix socket passing is negotiated and whether ↵Lennart Poettering2013-03-25
| | | | | | | | hello is sent This alos gets rid of explicit sd_open_fd() and sd_open_address() constructors in favour of sd_new() + sd_new_start() where the negotiation parameters may be set it in between.
* bus: properly handle termination of connectionsLennart Poettering2013-03-25
|
* bus: implement support for FD passingLennart Poettering2013-03-25
|
* service: no need to drop rc. prefix anymoreMiklos Vajna2013-03-24
| | | | | This reverts commit f5c88ec1330b61787441156de7d764a140774bd2. It is no longer necessary, and adds unnecessary magic.
* journald: remove unconditional log_*() use in the main loopKay Sievers2013-03-23
| | | | | | | | | | | Setting MaxRetentionSec= caused the kernel log to overflow and the journal daemon to enter an endless loop. Logging from the journald main loop gets directed to /dev/kmsg, which wakes up journald again. We skip the import of this message by checking for our own PID, but this still causes the main loop to never go to sleep again because we never stopped logging from there.
* uaccess: remove needless usb_id call from udev rulesKay Sievers2013-03-23
|
* conf-parser: when we parse a string list, always fill in somethingLennart Poettering2013-03-23
| | | | | | | | Some code really wants to know whether there was a string list parsed, so don't take the shortcut here, and always allocate a string list, even if it is an empty one. https://bugs.freedesktop.org/show_bug.cgi?id=62558
* journal: don't access j->files after useLennart Poettering2013-03-23
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=62605
* udevadm: place const in the right placeZbigniew Jędrzejewski-Szmek2013-03-22
| | | | Otherwise clang at least thinks that both consts apply to char.
* bus: don't free an unallocated varZbigniew Jędrzejewski-Szmek2013-03-22
| | | | Also remove unused variable.
* bus: move attribute to end of structure, so it is not ignoredZbigniew Jędrzejewski-Szmek2013-03-22
| | | | | src/libsystemd-bus/bus-message.h:41:1: warning: attribute 'packed' is ignored, place it after "struct" to apply attribute to type declaration [-Wignored-attributes]
* unit: never retroactively start requisitesLennart Poettering2013-03-23
| | | | | | | Requesites are not supposed to be auto-started afterall, they are just checks, so don't try to be smarter here than appropriate. Based on a patch from Michal Schmidt.
* add --with-telinit=PATH configure optionCristian Rodríguez2013-03-23
| | | | | | | | Distributions that never shipped upstart do not have "telinit" in /lib/upstart/.. Defaults to /lib/upstart/telinit so there is no change for systems existing installs.
* journalctl: various fixes to the access check logicLennart Poettering2013-03-23
| | | | | | | | | | | | | | - Reword messages a bit - Correct check whether EACCES is in the set of errors - Don't complain if no journal files are found - allocate Set object for errors lazily since in the best case we don't need it at all. - don't consider it an error if /run/log/journal doesn't exist (because that's the usual case actually, if storage is enabled)
* dbus: Do send out "replies" to signalsColin Walters2013-03-22
| | | | | | | | | | | Some parts of systemd (at least the DBus activation codepath) "reply" to signals, which of course have the no-reply flag set. We will be defensive here and still send out a reply if we're passed a signal. Regression introduced by: c6a818c82035da91e Reported-by: Mantas Mikulėnas <grawity@gmail.com> Tested-by: Mantas Mikulėnas <grawity@gmail.com>
* exec: Assigning the empty string to CapabilityBoundSet= should drop all capsLennart Poettering2013-03-22
| | | | | | | | | | Previously, it would set all caps, but it should drop them all, anything else makes little sense. Also, document that this works as it does, and what to do in order to assign all caps to the bounding set. https://bugzilla.redhat.com/show_bug.cgi?id=914705
* timedated: extra overflow safety check when doing relative time changesLennart Poettering2013-03-22
| | | | | | | | | Ensure clients don't overflow usec_t when doing relative time changes. This is mostly just paranoia and protection against accidents, after all clients are already authenticated, and they can se the time to any value they wish anyway, but better be safe than sorry. https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1152187/comments/14
* timedatectl: show CanNTP fieldLennart Poettering2013-03-22
|
* udev: no need to output OOM, if we call log_oom() anywayLennart Poettering2013-03-22
|
* main: minor simplificationLennart Poettering2013-03-22
|
* udev/collect: avoid initalizing memory twiceZbigniew Jędrzejewski-Szmek2013-03-22
|
* util: workaround two gcc warningsZbigniew Jędrzejewski-Szmek2013-03-22
| | | | | | gcc does not know that errno cannot be negative, and warns about unitialized variables later on. Kill the warnings by returning -errno only after checking that errno is positive.