summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-09-18detect-virt: do not try to read all of /proc/cpuinfoZbigniew Jędrzejewski-Szmek1-10/+28
Quoting https://github.com/systemd/systemd/issues/10074: > detect_vm_uml() reads /proc/cpuinfo with read_full_file() > read_full_file() has a file max limit size of READ_FULL_BYTES_MAX=(4U*1024U*1024U) > Unfortunately, the size of my /proc/cpuinfo is bigger, approximately: > echo $(( 4* $(cat /proc/cpuinfo | wc -c))) > 9918072 > This causes read_full_file() to fail and the Condition test fallout. Let's just read line by line until we find an intersting line. This also helps if not running under UML, because we avoid reading as much data.
2018-09-18verbs: reset optind (#10116)Yu Watanabe1-2/+4
optind may be used in each verb, e.g., udevadm. So, let's initialize optind before calling verbs. Without this, e.g., udevadm -d hwdb --update causes error in parsing arguments.
2018-09-18core: fix the check if CONFIG_CGROUP_BPF is onAlexander Filippov1-8/+8
Since the commit torvalds/linux@fdb5c4531c1e0e50e609df83f736b6f3a02896e2 the syscall BPF_PROG_ATTACH return EBADF when CONFIG_CGROUP_BPF is turned off and as result the bpf_firewall_supported() returns the incorrect value. This commmit replaces the syscall BPF_PROG_ATTACH with BPF_PROG_DETACH which is still work as expected. Resolves openbmc/linux#159 See also systemd/systemd#7054 Signed-off-by: Alexander Filippov <a.filippov@yadro.com>
2018-09-18Merge pull request #10114 from yuwata/namespace-logsZbigniew Jędrzejewski-Szmek2-26/+37
namespace: log message cleanups
2018-09-18core/execute: do not use the negative errno when setup_namespace() returns ↵Yu Watanabe1-6/+10
-ENOANO Without this, log shows meaningless error message 'No anode', e.g., === Failed to unshare the mount namespace: Operation not permitted foo.service: Failed to set up mount namespacing: No anode foo.service: Failed at step NAMESPACE spawning /usr/bin/test: No anode === Follow-up for 1beab8b0d0ff2d7d1436b52d4a0c3d56dc908962.
2018-09-18core/namespace: add more log messagesYu Watanabe1-20/+27
2018-09-18doc: Fix link to CONTRIBUTING.md (#10109)Jon Ringle1-1/+1
2018-09-16tests: make UBSan print full backtracesEvgeny Vereshchagin1-2/+3
This should make it easier to get backtraces that can be pasted into issues like https://github.com/systemd/systemd/issues/10096.
2018-09-16sd-device: use qsort_safe() (#10099)Yu Watanabe1-2/+2
The number of found devices may be zero. So, let's use qsort_safe(). Follow-up for 0a1665890cec06032a17c16206e9f519ca88446e. Fixes #10096.
2018-09-15Merge pull request #9928 from yuwata/libudev-cleanupsZbigniew Jędrzejewski-Szmek15-726/+619
libudev: coding style updates
2018-09-15Merge pull request #9958 from yuwata/sd-device-enum-setZbigniew Jędrzejewski-Szmek12-145/+113
sd-device: make sd_device_enumerator_get_*_next() not destroy the list
2018-09-15Merge pull request #10070 from keszybz/test-reportingYu Watanabe93-434/+430
Test reporting improvements
2018-09-15Merge pull request #10089 from yuwata/fix-oss-fuzz-10350Evgeny Vereshchagin2-2/+2
bus-util: use _printf_ attribute Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10350.
2018-09-15test-catalog: drop unused variableYu Watanabe1-1/+1
Follow-up for 49cdae63d168b2fe0e19f9f090b90d79de3c39bb.
2018-09-15bus-util: use _printf_ attributeYu Watanabe1-1/+1
Follow-up for eda193578effbc3cee0f6d56ade52434778737c9. Fixes oss-fuzz#10350.
2018-09-14socket-util: attempt SO_RCVBUFFORCE/SO_SNDBUFFORCE only if ↵Franck Bui1-4/+4
SO_RCVBUF/SO_SNDBUF fails Both SO_SNDBUFFORCE and SO_RCVBUFFORCE requires capability 'net_admin'. If this capability is not granted to the service the first attempt to increase the recv/snd buffers (via sd_notify()) with SO_RCVBUFFORCE/SO_SNDBUFFORCE will fail, even if the requested size is lower than the limit enforced by the kernel. If apparmor is used, the DENIED logs for net_admin will show up. These log entries are seen as red warning light, because they could indicate that a program has been hacked and tries to compromise the system. It would be nicer if they can be avoided without giving services (relying on sd_notify) net_admin capability or dropping DENIED logs for all such services via their apparmor profile. I'm not sure if sd_notify really needs to forcibly increase the buffer sizes, but at least if the requested size is below the kernel limit, the capability (hence the log entries) should be avoided. Hence let's first ask politely for increasing the buffers and only if it fails then ignore the kernel limit if we have sufficient privileges.
2018-09-14Merge pull request #9920 from yuwata/udev-cleanup-4Zbigniew Jędrzejewski-Szmek39-1903/+1192
udev: drop unused udev structs and use verbs in udevadm
2018-09-14tests: add a helper function to skip with errnoZbigniew Jędrzejewski-Szmek10-41/+30
2018-09-14tests: use a helper function to parse environment and open loggingZbigniew Jędrzejewski-Szmek85-169/+153
The advantages are that we save a few lines, and that we can override logging using environment variables in more test executables.
2018-09-14test-condition: make function return voidZbigniew Jędrzejewski-Szmek1-4/+2
We don't look at the result anyway.
2018-09-14tests: add helper to unify skipping a test and exitingZbigniew Jędrzejewski-Szmek34-178/+128
2018-09-14man: fix typo (#10084)Harshit Jain1-3/+3
fixes #10083
2018-09-14user-runtime-dir@.service: don't stop on runlevel switch (#10079)Alan Jenkins1-0/+1
Followup to commit 13cf422e04b7 ("user@.service: don't kill user manager at runlevel switch") I think there's a general rule that units with `StopWhenUnneeded=yes` need `IgnoreOnIsolate=yes`... But it doesn't apply to `suspend.target` and friends. `printer.target` and friends break on isolate even if we apply the rule[1]. That just leaves `graphical-session.target`, which is a user service. "isolate" is *mostly* a weird attempt to emulate runlevels, so I decided not to worry about it for user services. [1] https://github.com/systemd/systemd/issues/6505#issuecomment-320644819
2018-09-13replace https://github.com/systemd/systemd/blob/master/doc/* with ↵killermoehre6-15/+15
https://github.com/systemd/systemd/blob/master/docs/* to point to proper documentation
2018-09-13user@.service: don't kill user manager at runlevel switchThomas Blume1-0/+1
Loggin in as root user and then switching the runlevel results in a stop of the user manager, even though the user ist still logged in. That leaves a broken user session. Adding "IgnoreOnIsolate=true" to user@.service fixes this.
2018-09-13test: unset $XDG_{CONFIG,DATA}_DIRSYu Watanabe1-0/+2
When $XDG_DATA_DIRS is unset, then, the default value '/usr/local/share:/usr/share' is used. When $XDG_DATA_DIRS contain the default paths but the order is inverted: '/usr/share:/usr/local/share', then test-path-lookup fails. Fixes #10002.
2018-09-13meson: drop some unneeded parensZbigniew Jędrzejewski-Szmek1-6/+6
2018-09-13meson: always allow compilation of tests binariesZbigniew Jędrzejewski-Szmek1-10/+8
2018-09-13NEWS: remove repeated "slightly"Zbigniew Jędrzejewski-Szmek1-4/+3
2018-09-13meson: do not build tests by default when '-Dtests=false'Yu Watanabe3-7/+13
[zj: it is still possible to build tests explicitly by calling ninja -C build test-name. This way we have full flexibility.]
2018-09-13test: log when skipping tests in more casesYu Watanabe15-19/+50
Follow-up for the previous commit.
2018-09-13test: when skipping tests, always print somethingZbigniew Jędrzejewski-Szmek3-12/+21
It is quite confusing if the test "fails" without printing anything at all. A typo in an 'if' statement is also fixed.
2018-09-13meson: disable _all_ tests when -Dtests=falseZbigniew Jędrzejewski-Szmek5-38/+66
Back in 08318a2c5acb3d0e4243c36461e69a3e45482441, value "false" was enabled for '-Dtests=', but various tests were not conditionalized properly. So even with -Dtests=false -Dslow-tests=false we'd run 120 tests. Let's make this consistent.
2018-09-13meson: disable "slow tests" too when tests are generally disabledZbigniew Jędrzejewski-Szmek1-4/+5
We would have a strange situation where after setting -Dslow-tests=true -Dtests=false we'd get mostly the slow tests (plus some other ones which I'll fix in subsequent commit). Let's simplify things by making -Dtests=false just disable those tests too.
2018-09-13test-barrier: just make this a slow testZbigniew Jędrzejewski-Szmek1-10/+8
test-barrier was using a custom mechanism to skip itself. Let's just follow the normal scheme.
2018-09-13tests: centralize check for slow testsZbigniew Jędrzejewski-Szmek5-23/+28
2018-09-12update TODOLennart Poettering1-0/+11
2018-09-12nspawn: use copy-static if systemd-resolved is up and image is writableafg1-6/+1
2018-09-12Merge pull request #10061 from xnox/fix-logindless-scheduled-shutdownLennart Poettering1-8/+10
Fix logindless scheduled shutdown
2018-09-12Merge pull request #10060 from yuwata/property-take-valueLennart Poettering6-146/+168
bus-util: make --property= optionaly take value
2018-09-12test: use ${builddir}/systemd-runtest.env for $SYSTEMD_CATALOG_DIRFilipe Brandenburger5-16/+21
This makes it so that tests no longer need to know the absolute paths to the source and build dirs, instead using the systemd-runtest.env file to get these paths when running from the build tree. Confirmed that test-catalog works on `ninja test`, when called standalone and also when the environment file is not present, in which case it will use the installed location under /usr/lib/systemd/catalog. The location can now also be overridden for this test by setting the $SYSTEMD_CATALOG_DIR environment variable.
2018-09-12test: use ${builddir}/systemd-runtest.env to set $SYSTEMD_TEST_DATAFilipe Brandenburger2-36/+41
This simplifies get_testdata_dir() to simply checking for an environment variable, with an additional function to locate a systemd-runtest.env file in the same directory as the test binary and reading environment variable assignments from that file if it exists. This makes it possible to: - Run `ninja test` from the build dir and have it use ${srcdir}/test for test unit definitions. - Run a test directly, such as `build/test-execute` and have it locate them correctly. - Run installed tests (from systemd-tests package) and locate the test units in the installed location (/usr/lib/systemd/tests/testdata), in which case the absence of the systemd-runtest.env file will have get_testdata_dir() use the installed location hardcoded into the binaries. Explicit setting of $SYSTEMD_TEST_DATA still overrides the contents of systemd-runtest.env.
2018-09-12test: remove support for suffix in get_testdata_dir()Filipe Brandenburger12-18/+40
Instead, use path_join() in callers wherever needed.
2018-09-12Set theme jekyll-theme-slateZbigniew Jędrzejewski-Szmek1-0/+1
2018-09-12bash-completion: systemctl: re-implement __filter_units_by_properties()Yu Watanabe1-49/+58
This also unifies __filter_units_by_property() and __filter_units_by_properties(), and makes completion for 'restart', 'reload' or 'stop' show more candidates.
2018-09-12bus-util: make --property= optionally take valueYu Watanabe5-97/+110
2018-09-11Merge pull request #10046 from yuwata/fix-10045Michael Biebl5-13/+41
test: use installed catalogs when test-catalog is not located at build dir
2018-09-11systemctl: correctly proceed to immediate shutdown if scheduling failsDimitri John Ledkov1-2/+4
Actually check the return code from logind_schedule_shutdown() and proceed to immediate shutdown if that fails. Negative return codes can be returned if systemctl is compiled without logind support, or if logind otherwise failed (either too old, disabled/masked, or it is incomplete systemd-shim/systemd-service implementation).
2018-09-11sd-device,libudev: make an argument for *_set_sysattr_value() constYu Watanabe5-6/+4
2018-09-11libudev-monitor: use assert_return() in many placesYu Watanabe1-14/+13