summaryrefslogtreecommitdiff
path: root/src/core/manager.c
Commit message (Collapse)AuthorAge
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-23
| | | | | | This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
* include <poll.h> instead of <sys/poll.h>Thomas Hindoe Paaboel Andersen2015-02-12
| | | | | | include-what-you-use automatically does this and it makes finding unnecessary harder to spot. The only content of poll.h is a include of sys/poll.h so should be harmless.
* 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.
* 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.
* 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.
* 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.
* 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: add new logic for services to store file descriptors in PID 1Lennart Poettering2015-01-06
| | | | | | | | | | | | | | With this change it is possible to send file descriptors to PID 1, via sd_pid_notify_with_fds() which PID 1 will store individually for each service, and pass via the usual fd passing logic on next invocation. This is useful for enable daemon reload schemes where daemons serialize their state to /run, push their fds into PID 1 and terminate, restoring their state on next start from the data in /run and passed in from PID 1. The fds are kept by PID 1 as long as no POLLHUP or POLLERR is seen on them, and the service they belong to are either not dead or failed, or have a job queued.
* core: rework counting of running jobsLennart Poettering2015-01-05
| | | | | | | | | | | | | Let's unify the code that counts the running jobs a bit, in order to make sure we are less likely to miss one. This is related to this bug: https://bugs.freedesktop.org/show_bug.cgi?id=87349 However, it probably won't fix it fully, and I cannot reproduce the issue. The change also adds an explicit assert change when the counter is off.
* util: rename ignore_file() to hidden_file()Lennart Poettering2014-12-19
| | | | | hidden_file() is a bit more precise, since dot files usually shouldn't be ignored, but certainly be considered hidden.
* unit: handle nicely of certain unit types are not supported on specific systemsLennart Poettering2014-12-15
| | | | | | | | | | | | Containers do not really support .device, .automount or .swap units; Systems compiled without support for swap do not support .swap units; Systems without kdbus do not support .busname units. With this change attempts to start a unsupported unit types will result in an immediate "unsupported" job result, which is a lot more descriptive then before. Also, attempts to start device units in containers will now immediately fail instead of causing jobs to be enqueued that never go away.
* core: correct spacing near eol in code commentsTorstein Husebø2014-12-11
|
* sd-bus: move common errors src/shared/bus-errors.h → ↵Lennart Poettering2014-12-10
| | | | | | src/libsystemd/sd-bus/bus-common-errors.h Stuff in src/shared/ should not use stuff from src/libsystemd/ really.
* manager: log deserialization errors only at LOG_DEBUG levelLennart Poettering2014-12-02
| | | | | | | | | | | 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.
* core: OOM really shouldn't be considered a deserialization parse failureLennart Poettering2014-12-02
|
* mount: monitor for utab changes with inotifyChris Leech2014-11-28
| | | | | | | | | | | | | | 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.
* treewide: another round of simplificationsMichal Schmidt2014-11-28
| | | | | Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications".
* treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt2014-11-28
| | | | | | | | | | | 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.
* core: fix return value in error path after sd_event_add_io() failureMichal Schmidt2014-11-28
| | | | | | sd_event_add_io() does not set errno, it returns negative errno. Noticed during log_*_errno conversions.
* treewide: more log_*_errno + return simplificationsMichal Schmidt2014-11-28
|
* treewide: simplify log_*_errno(r,...) immediately followed by "return r"Michal Schmidt2014-11-28
|
* treewide: more log_*_errno() conversions, multiline callsMichal Schmidt2014-11-28
| | | | | | | | | | | | 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.
* treewide: no need to negate errno for log_*_errno()Michal Schmidt2014-11-28
| | | | It corrrectly handles both positive and negative errno values.
* treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt2014-11-28
| | | | | | | | | | | | | 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().
* core: only override kdbus attach mask when running as PID 1Lennart Poettering2014-11-28
|
* log: fix order of log_unit_struct() to match other logging callsLennart Poettering2014-11-28
| | | | | Also, while we are at it, introduce some syntactic sugar for creating ERRNO= and MESSAGE= structured logging fields.
* kdbus: set kernel attach mask before creating the first busLennart Poettering2014-11-27
|
* log: rearrange log function namingLennart Poettering2014-11-27
| | | | | | | | | | - 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.
* manager: print fatal errors on the console tooZbigniew Jędrzejewski-Szmek2014-11-26
| | | | | | 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
* manager: let manager_free() handle NULLsZbigniew Jędrzejewski-Szmek2014-11-23
| | | | This makes the calling code a bit simpler.
* dbus: return non-zero return value in the case that prefix won't matchLukas Nykryn2014-11-23
| | | | | | | 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.
* sd-bus: sync with kdbus upstream (ABI break)Daniel Mack2014-11-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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().
* manager: allow test run to catch SIGCHLD eventsRonny Chevalier2014-11-13
| | | | Otherwise we cannot know when a service exited
* core: remove unused macro GC_QUEUE_USEC_MAXRonny Chevalier2014-11-08
| | | | It is unused since cf1265e188e876dda906dca0029248a06dc80c33
* core: unify how we create the notify and private dbus socketLennart Poettering2014-11-07
| | | | | Use the same robust logic of mkdir + unlink of any existing AF_UNIX socket, ignoring the return value, right before bind().
* manager: cast mkdir() result to (void) to make sure coverity is quietLennart Poettering2014-11-07
| | | | Also simplify the code a bit by moving mkdir to the common path.
* manager: Ensure user's systemd runtime directory exists.Colin Guthrie2014-11-05
| | | | | | | | 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
* audit: improve the audit messages we generateLennart Poettering2014-11-04
| | | | | always pass along comm, as documented by audit. Always set the correct comm value.
* manager: do not print timing when running in test modeZbigniew Jędrzejewski-Szmek2014-11-02
|
* Convert the rest to sd_bus_errnomapZbigniew Jędrzejewski-Szmek2014-10-30
| | | | | | 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.
* manager: print warning on console before rebootZbigniew Jędrzejewski-Szmek2014-10-27
| | | | It will be printed even if a prompt is blocking other messages.
* manager: convert ephemeral to enumZbigniew Jędrzejewski-Szmek2014-10-27
| | | | In preparation for subsequent changes.
* manager: do not print anything while passwords are being queriedZbigniew Jędrzejewski-Szmek2014-10-27
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=73942
* core: remove system start timeout logic againLennart Poettering2014-10-28
| | | | | | | | | | | | 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.
* manager: Linux on hppa has fewer rtsigs, hence avoid using the higher ones thereLennart Poettering2014-10-24
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=84931