summaryrefslogtreecommitdiff
path: root/src/core/manager.c
AgeCommit message (Collapse)Author
2014-12-11core: correct spacing near eol in code commentsTorstein Husebø
2014-12-10sd-bus: move common errors src/shared/bus-errors.h → ↵Lennart Poettering
src/libsystemd/sd-bus/bus-common-errors.h Stuff in src/shared/ should not use stuff from src/libsystemd/ really.
2014-12-02manager: log deserialization errors only at LOG_DEBUG levelLennart Poettering
During upgrades and when transitioning between different systemd versions in initrd and on the host we have to expect that some serialization fields are unknown or parse incorrectly. This shouldn't really be considered an error, hence downgrade the log messages about it to debug. This way we can still trace it, but it doesn't confuse users. This kinda reverts 46849c3f.
2014-12-02core: OOM really shouldn't be considered a deserialization parse failureLennart Poettering
2014-11-28mount: monitor for utab changes with inotifyChris Leech
Parsing the mount table with libmount races against the mount command, which will handle the actual mounting before updating utab. This means the poll event on /proc/self/mountinfo can kick of a reparse in systemd before the utab information is available. This change adds in an additional event source using inotify to watch for changes to utab. It only watches for IN_MOVED_TO events, matching libmount behavior of always overwriting this file using rename(2). This does add a second pass through the mount table parsing when utab is updated.
2014-11-28treewide: another round of simplificationsMichal Schmidt
Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications".
2014-11-28treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt
If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
2014-11-28core: fix return value in error path after sd_event_add_io() failureMichal Schmidt
sd_event_add_io() does not set errno, it returns negative errno. Noticed during log_*_errno conversions.
2014-11-28treewide: more log_*_errno + return simplificationsMichal Schmidt
2014-11-28treewide: simplify log_*_errno(r,...) immediately followed by "return r"Michal Schmidt
2014-11-28treewide: more log_*_errno() conversions, multiline callsMichal Schmidt
Basically: find . -name '*.[ch]' | while read f; do perl -i.mmm -e \ 'local $/; local $_=<>; s/log_(debug|info|notice|warning|error|emergency)\("([^"]*)%s"([^;]*),\s*strerror\(-?([->a-zA-Z_]+)\)\);/log_\1_errno(\4, "\2%m"\3);/gms;print;' \ $f; done Plus manual indentation fixups.
2014-11-28treewide: no need to negate errno for log_*_errno()Michal Schmidt
It corrrectly handles both positive and negative errno values.
2014-11-28treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt
As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
2014-11-28core: only override kdbus attach mask when running as PID 1Lennart Poettering
2014-11-28log: fix order of log_unit_struct() to match other logging callsLennart Poettering
Also, while we are at it, introduce some syntactic sugar for creating ERRNO= and MESSAGE= structured logging fields.
2014-11-27kdbus: set kernel attach mask before creating the first busLennart Poettering
2014-11-27log: rearrange log function namingLennart Poettering
- Rename log_meta() → log_internal(), to follow naming scheme of most other log functions that are usually invoked through macros, but never directly. - Rename log_info_object() to log_object_info(), simply because the object should be before any other parameters, to follow OO-style programming style.
2014-11-26manager: print fatal errors on the console tooZbigniew Jędrzejewski-Szmek
When booting in quiet mode, fatal messages would not be shown at all to the user. https://bugzilla.redhat.com/show_bug.cgi?id=1155468
2014-11-23manager: let manager_free() handle NULLsZbigniew Jędrzejewski-Szmek
This makes the calling code a bit simpler.
2014-11-23dbus: return non-zero return value in the case that prefix won't matchLukas Nykryn
strv_extend returns 0 in the case of success which means that else if (bus_track_deserialize_item(&m->deserialized_subscribed, l) == 0) log_warning("Unknown serialization item '%s'", l); will be printed when value is added correctly.
2014-11-13sd-bus: sync with kdbus upstream (ABI break)Daniel Mack
kdbus has seen a larger update than expected lately, most notably with kdbusfs, a file system to expose the kdbus control files: * Each time a file system of this type is mounted, a new kdbus domain is created. * The layout inside each mount point is the same as before, except that domains are not hierarchically nested anymore. * Domains are therefore also unnamed now. * Unmounting a kdbusfs will automatically also detroy the associated domain. * Hence, the action of creating a kdbus domain is now as privileged as mounting a filesystem. * This way, we can get around creating dev nodes for everything, which is last but not least something that is not limited by 20-bit minor numbers. The kdbus specific bits in nspawn have all been dropped now, as nspawn can rely on the container OS to set up its own kdbus domain, simply by mounting a new instance. A new set of mounts has been added to mount things *after* the kernel modules have been loaded. For now, only kdbus is in this set, which is invoked with mount_setup_late().
2014-11-13manager: allow test run to catch SIGCHLD eventsRonny Chevalier
Otherwise we cannot know when a service exited
2014-11-08core: remove unused macro GC_QUEUE_USEC_MAXRonny Chevalier
It is unused since cf1265e188e876dda906dca0029248a06dc80c33
2014-11-07core: unify how we create the notify and private dbus socketLennart Poettering
Use the same robust logic of mkdir + unlink of any existing AF_UNIX socket, ignoring the return value, right before bind().
2014-11-07manager: cast mkdir() result to (void) to make sure coverity is quietLennart Poettering
Also simplify the code a bit by moving mkdir to the common path.
2014-11-05manager: Ensure user's systemd runtime directory exists.Colin Guthrie
This mirrors code in dbus.c when creating the private socket and avoids error messages like: systemd[1353]: bind(/run/user/603/systemd/notify) failed: No such file or directory systemd[1353]: Failed to fully start up daemon: No such file or directory
2014-11-04audit: improve the audit messages we generateLennart Poettering
always pass along comm, as documented by audit. Always set the correct comm value.
2014-11-02manager: do not print timing when running in test modeZbigniew Jędrzejewski-Szmek
2014-10-30Convert the rest to sd_bus_errnomapZbigniew Jędrzejewski-Szmek
I tried to preserve most errno values, but in some cases they were inconsistent (different errno values for the same error name) or just mismatched.
2014-10-27manager: print warning on console before rebootZbigniew Jędrzejewski-Szmek
It will be printed even if a prompt is blocking other messages.
2014-10-27manager: convert ephemeral to enumZbigniew Jędrzejewski-Szmek
In preparation for subsequent changes.
2014-10-27manager: do not print anything while passwords are being queriedZbigniew Jędrzejewski-Szmek
https://bugs.freedesktop.org/show_bug.cgi?id=73942
2014-10-28core: remove system start timeout logic againLennart Poettering
The system start timeout as previously implemented would get confused by long-running services that are included in the initial system startup transaction for example by being cron-job-like long-running services triggered immediately at boot. Such long-running jobs would be subject to the default 15min timeout, esily triggering it. Hence, remove this again. In a subsequent commit, introduce per-target job timeouts instead, that allow us to control these timeouts more finegrained.
2014-10-24manager: Linux on hppa has fewer rtsigs, hence avoid using the higher ones thereLennart Poettering
https://bugs.freedesktop.org/show_bug.cgi?id=84931
2014-10-21util: avoid duplication of TIME_T_MAXRonny Chevalier
2014-10-17systemd: try harder to bind to notify socketZbigniew Jędrzejewski-Szmek
Without the socket open we are going to crash and burn. If for whatever reason we fail during deserialization we will fail when trying to open the socket. In this case it is better to unlink the old socket and maybe lose some messages, than to continue without the notification socket. Of course this situation should not happen, but we should handle it as gracefully as possible anyway. https://bugzilla.redhat.com/show_bug.cgi?id=1099299
2014-10-17systemd: log deserialization errors as warningsZbigniew Jędrzejewski-Szmek
If we failed to parse something that we wrote ourselves, things are seriously off. This is also likely to lead to problems futher on.
2014-09-16core: fix resource leak in manager_environment_addAndreas Henriksson
Second error path must free the (potentially) allocated memory in the first code chunk before returning. Found by coverity. Fixes: CID#1237750
2014-09-15hashmap: introduce hash_ops to make struct Hashmap smallerMichal Schmidt
It is redundant to store 'hash' and 'compare' function pointers in struct Hashmap separately. The functions always comprise a pair. Store a single pointer to struct hash_ops instead. systemd keeps hundreds of hashmaps, so this saves a little bit of memory.
2014-09-11manager: use correct cleanup functionThomas Hindoe Paaboel Andersen
Close the dir instead of attempt to free it. Introduced in 874310b7b68c4c0d36ff07397db30a959bb7dae5 Found with coverity. Fixes: CID#996368
2014-08-22core: split up "starting" manager state into "initializing" and "starting"Lennart Poettering
We'll stay in "initializing" until basic.target has reached, at which point we will enter "starting". This is preparation so that we can change the startip timeout to only apply to the first phase of startup, not the full procedure.
2014-08-22core: introduce "poweroff" as new failure action typesLennart Poettering
Also, change the default action on a system start-up timeout to powering off.
2014-08-22core: print 'startup finished' messages even if we log to consoleLennart Poettering
2014-08-22core: add support for a configurable system-wide start-up timeoutLennart Poettering
When this system-wide start-up timeout is hit we execute one of the failure actions already implemented for services that fail. This should not only be useful on embedded devices, but also on laptops which have the power-button reachable when the lid is closed. This devices, when in a backpack might get powered on by accident due to the easily reachable power button. We want to make sure that the system turns itself off if it starts up due this after a while. When the system manages to fully start-up logind will suspend the machine by default if the lid is closed. However, in some cases we don't even get as far as logind, and the boot hangs much earlier, for example because we ask for a LUKS password that nobody ever enters. Yeah, this is a real-life problem on my Yoga 13, which has one of those easily accessible power buttons, even if the device is closed.
2014-08-21notify: send STOPPING=1 from our daemonsLennart Poettering
2014-08-21manager: don#t dispatch sd_notify() messages and SIGCHLD multiple times to ↵Lennart Poettering
the same units
2014-08-21manager: reuse sockaddr_union instead of redefining our own version of itLennart Poettering
2014-08-11log: never ever log to syslog from PID 1, log to the journal againLennart Poettering
We don't support journal-less systems anyway, so let's avoid the confusion.
2014-08-03tty-ask-password-agent: modernizationZbigniew Jędrzejewski-Szmek
2014-07-29time-util: add and use USEC/NSEC_INFINIYKay Sievers