summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2016-02-09core: change internal error code for masked units from EBADR to ESHUTDOWNLennart Poettering
This commit changes the mapping of the BUS_ERROR_UNIT_MASKED error to ESHUTDOWN. This error is used whenever the transaction engine is asked to operate on a masked unit. ESHUTDOWN is what is used for the similar case when the unit file enable/disable logic hits a masked unit file, hence is a natural candidate to be used here too. Background: before this patch both "job type not applicable" and "unit masked" where mapped to EBADR, which transaction_add_job_and_dependencies() then checked for. It actually wanted to check exclusively for the former error condition, not the latter but due to the same mapping this failed to work. This patch semi-undoes an accidental change made in caffa4ef700fdd0eadd6c0b2ef9925611672a1bc, however restores the error number to ESHUTDOWN instead of the original ENOSYS (for the reasons indicated above). To make this easier to grok for the future, I added comments to explaining which error conditions are checked for. Fixes: #2315
2016-02-09Merge pull request #2561 from msekletar/virtio-blk-by-pathLennart Poettering
path_id: reintroduce by-path links for virtio block devices
2016-02-09path_id: reintroduce by-path links for virtio block devicesMichal Sekletar
Enumeration of virtio buses is global and hence non-deterministic. However, we are guaranteed there is never going to be more than one virtio bus per parent PCI device. While populating ID_PATH we simply skip virtio part of the syspath and we extend the path using the sysname of the parent PCI device. With this patch udev creates following by-path links for virtio-blk device /dev/vda which contains two partitions. ls -l /dev/disk/by-path/ total 0 lrwxrwxrwx 1 root root 9 Feb 9 10:47 virtio-pci-0000:00:05.0 -> ../../vda lrwxrwxrwx 1 root root 10 Feb 9 10:47 virtio-pci-0000:00:05.0-part1 -> ../../vda1 lrwxrwxrwx 1 root root 10 Feb 9 10:47 virtio-pci-0000:00:05.0-part2 -> ../../vda2 See: http://lists.linuxfoundation.org/pipermail/virtualization/2015-August/030328.html Fixes #2501
2016-02-09journal: Drop monotonicity check when appending to journal fileKlearchos Chaloulos
Remove the check that triggers rotation of the journal file when the arriving log entry had a monotonic timestamp smaller that the previous log entry. This check causes unnecessary rotations when journal-remote was receiving from multiple senders, therefore monotonicity can not be guaranteed. Also, it does not offer any useful functionality for systemd-journald.
2016-02-09Merge pull request #2542 from 0xAX/get_ts_deltaLennart Poettering
time-util: cleanups
2016-02-08Merge pull request #2547 from 0xAX/generalize-format-timestamp-internalLennart Poettering
time-util: merge format_timestamp_internal() and format_timestamp_int…
2016-02-09time-util: introduce usec_sub()Alexander Kuleshov
The dual_timestamp_from_realtime(), dual_timestamp_from_monotonic() and dual_timestamp_from_boottime_or_monotonic() shares the same code for comparison given ts with delta. Let's move it to the separate inline function to prevent code duplication.
2016-02-09time-util: merge format_timestamp_internal() and format_timestamp_internal_us()Alexander Kuleshov
The time_util.c provides format_timestamp_internal() and format_timestamp_internal_us() functions for a timestamp formating. Both functions are very similar and differ only in formats handling. We can add additional boolean parameter to the format_timestamp_internal() function which will represent is a format for us timestamp or not. This allows us to get rid of format_timestamp_internal_us() that is prevent code duplication. We can remove format_timestamp_internal_us() safely, because it is static and has no users outside of the time_util.c. New fourth parameter will be passed inside of the format_timestamp(), format_timestamp_us() and etc, functions, but the public API is not changed.
2016-02-08Merge pull request #2533 from keszybz/read-only-seedLennart Poettering
random-seed: provide nicer error message when unable to open file
2016-02-07Merge pull request #2546 from torstehu/fix-typo3Zbigniew Jędrzejewski-Szmek
treewide: fix typos and spacing
2016-02-07Merge pull request #2536 from vcaputo/journal-misc-cleanupsZbigniew Jędrzejewski-Szmek
journal: miscellaneous cleanups
2016-02-07treewide: fix typos and spacingTorstein Husebø
2016-02-06random-seed: provide nicer error message when unable to open fileZbigniew Jędrzejewski-Szmek
If /var is read-only, and the seed file does not exist, we would print a misleading error message for ENOENT. Print both messages instead, to make it easy to diagonose. Also, treat the cases of missing seed file the same as empty seed file and exit successfully. Initialize the return code properly. Fixes https://github.com/systemd/systemd/issues/2530, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=813599.
2016-02-06Merge pull request #2525 from chaloulo/journal-remote-microhttp-max-memory-usageLennart Poettering
journal-remote: decrease microhttpd memory limit
2016-02-06Merge pull request #2540 from 0xAX/use-dual-timestamp-get-in-timeutilLennart Poettering
time-util: use dual_timestamp_get()
2016-02-06time-util: use dual_timestamp_get()Alexander Kuleshov
The time-util.c provides dual_timestamp_get() function for getting realtime and monotonic timestamps. Let's use it instead of direct realtime/monotonic calculation.
2016-02-06journal: add missing space to switch statementVito Caputo
2016-02-06Merge pull request #2138 from stefwalter/journal-combineLennart Poettering
Combine journal catalog entries with the same id
2016-02-05journal: remove template from open_journal argsVito Caputo
None of the callers take advantage of this parameter, it's always NULL, this is just a private helper function to simplify the call sites so drop the template parameter altogether. If a caller emerges later who needs it, it can be restored.
2016-02-05journal: Add test for merging journal entriesStef Walter
2016-02-05journal: Refactor test-catalog importing testsStef Walter
One function per test. Remove shared state between tests.
2016-02-05journal: Combine journal catalog entries with the same idStef Walter
Instead of discarding duplicate catalog entries, we now combine them. This allows software or admins to add or override catalog headers, or add additional text to the catalog message.
2016-02-05journal: move mmap() ENOMEM loop to functionVito Caputo
Introduces mmap_try_harder()
2016-02-05journal: add asserts on f->(data|field)_hash_tableVito Caputo
Functions dereferencing these members should assert their non-NULL state.
2016-02-05journal: add asserts for f->headerVito Caputo
Just some additional asserts in functions dereferencing f->header.
2016-02-05journal: move window initialization to window_addVito Caputo
2016-02-04journal-remote: decrease microhttpd memory limitKlearchos Chaloulos
Set the MHD_OPTION_CONNECTION_MEMORY_LIMIT to 128KB. The precious value was DATA_SIZE_MAX, which was defined as 1024*1024*768. This caused journal-remote to allocate 756MB for each journal-upload connection, thus exhausting the available memory.
2016-02-04resolved: correctly store interface index of RRs in cacheLennart Poettering
Fixes: #2361
2016-02-04resolved: properly turn off DNSSEC for LLMNR/mDNS scopesLennart Poettering
2016-02-04core: rework job_get_timeout() to use usec_t and handle USEC_INFINITY time ↵Lennart Poettering
events correctly
2016-02-04resolved: don't follow CNAMEs originating from DNS on LLMNRLennart Poettering
Fixes: #2514
2016-02-03core: move service_unwatch_control_pid() call into service_enter_running()Lennart Poettering
When we enter the running state we should forget about any control processes, in all cases, and not just when hit a reload timeout...
2016-02-03journal: fix boolean handling in MMapCacheLennart Poettering
Let's use bitfields for our booleans, and don't try to apply binary OR or addition on them, because that's weird and we should instead use logical OR only.
2016-02-03core: log about path_is_mount_point() errorsLennart Poettering
We really shouldn't fail silently, but print a log message about these errors. Also make sure to attach error codes to all log messages where that makes sense. (While we are at it, add a couple of (void) casts to functions where we knowingly ignore return values.)
2016-02-03core: when a service's ExecStartPre= times out, skip ExecStop=Lennart Poettering
This makes sure we never run two control processes at the same time, we cannot keep track off. This introduces a slight change of behaviour but cleans up the definition of ExecStop= and ExecStopPost=. The former is now invoked only if the service managed to start-up correctly. The latter is called even if start-up failed half-way. Thus, ExecStopPost= may be used as clean-up step for both successful and failed start-up attempts, but ExecStop='s purpose is clearly defined as being responsible for shutting down the service and nothing else. The precise behaviour of this was not documented yet. This commit adds the necessary docs. Fixes: #1254
2016-02-03util: add check that makes sure time_t and TIME_T_MAX work the way we assume ↵Lennart Poettering
they do
2016-02-03gpt-auto: handle errors from blkid more correctlyLennart Poettering
Let's make sure we don't choke if blkid_probe_lookup_value() returns a NULL string. Also, make sur we propagate the correct error when blkid_probe_lookup_value() fails.
2016-02-03nspawn: make sure --help fits it 79chLennart Poettering
2016-02-03nspawn: optionally run a stub init process as PID 1Lennart Poettering
This adds a new switch --as-pid2, which allows running commands as PID 2, while a stub init process is run as PID 1. This is useful in order to run arbitrary commands in a container, as PID1's semantics are different from all other processes regarding reaping of unknown children or signal handling.
2016-02-03resolved: apply epoch to system time from PID 1Lennart Poettering
For use in timesyncd we already defined a compile-time "epoch" value, which is based on the mtime of the NEWS file, and specifies a point in time we know lies in the past at runtime. timesyncd uses this to filter out nonsensical timestamp file data, and bump the system clock to a time that is after the build time of systemd. This patch adds similar bumping code to earliest PID 1 initialization, so that the system never continues operation with a clock that is in the 1970ies or even 1930s.
2016-02-03nspawn: add new --chdir= switchLennart Poettering
Fixes: #2192
2016-02-03Merge pull request #2509 from bengal/dhcp-nak-delay-v4Tom Gundersen
dhcp: delay restarts after NAKs (v4)
2016-02-03Merge pull request #2508 from fishilico/selinux-logindLennart Poettering
Load SELinux labelling systemd in systemd-logind
2016-02-03Merge pull request #2512 from 0xAX/mount-setupLennart Poettering
mount-setup: introduce mount_points_setup
2016-02-03Merge pull request #2522 from 0xAX/check-early-mountLennart Poettering
manager: print fatal error if early mount failed
2016-02-03Merge pull request #2519 from msekletar/journalctl-device-log-current-boot-v2Lennart Poettering
journalctl: add match for the current boot when called with devpath (v2)
2016-02-03Merge pull request #2453 from poettering/journalctl-fTom Gundersen
journalctl --fields logic
2016-02-03journalctl: add match for the current boot when called with devpathMichal Sekletar
2016-02-03Merge pull request #2507 from evverx/fix-q-on-tmpfsLennart Poettering
tmpfiles: don't skip path_set_perms on error
2016-02-03manager: print fatal error if early mount failedAlexander Kuleshov
The mount_setup_early() can fail and if it will occur, there is no sense to make selinux setup and etc.