summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* cgls: --machine= expects an argument, indicate that in log messagesLennart Poettering2017-02-021-1/+1
| | | | | We gnerally suffix file settings and cmdline options that expect ags with "=" to indicate that. Do so here, too.
* time-util: add overflow checking to monotonic timestamp specificationsLennart Poettering2017-02-021-0/+2
|
* time-util: when formatting usec_t as raw integers use PRIu64Lennart Poettering2017-02-021-2/+2
| | | | After all, usec_t is defined as uint64_t, and not as unsigned long long.
* time-util: when converting to time_t do something useful in 2038Lennart Poettering2017-02-021-2/+4
| | | | | | On systems where time_t is 32bit we should invalidate the timeval/timespec instead of proceeding with a potentially overflown value.
* time-util: refuse formatting/parsing times that we can't storeLennart Poettering2017-02-026-3/+65
| | | | | | | | | | | usec_t is always 64bit, which means it can cover quite a number of years. However, 4 digit year display and glibc limitations around time_t limit what we can actually parse and format. Let's make this explicit, so that we never end up formatting dates we can#t parse and vice versa. Note that this is really just about formatting/parsing. Internal calculations with times outside of the formattable range are not affected.
* time: time_t is signed, and mktime() is happy to return negative timeLennart Poettering2017-02-022-9/+8
| | | | | | | | | | Passing a year such as 1960 to mktime() will result in a negative return value. This is quite confusing, as the man page claims that on failure the call will return -1... Given that our own usec_t type is unsigned, and we can't express times before 1970 hence, let's consider all negative times returned by mktime() as invalid, regardless if just -1, or anything else negative.
* nspawn: shown exec() command is misleadingLennart Poettering2017-02-021-6/+7
| | | | | | | | There's no point in updating exec_target for each binary we try to execute, if we override it right-away anyway... Let's just do this once, and include all binaries we try each time. Follow-up for 1a68e1e543fd8f899503bec00585a16ada296ef7.
* Merge pull request #5204 from keszybz/masked-warning-cleanupLennart Poettering2017-02-023-12/+15
|\ | | | | Cleanup of error code mismatch for masked units
| * core/transaction: also downgrade warning for masked units wanted by followed ↵Zbigniew Jędrzejewski-Szmek2017-02-011-1/+4
| | | | | | | | | | | | | | | | | | units The warning "Cannot add dependency job, ignoring" was downgraded to info in one place, but not in the other. C.f. #5179.
| * Consistently use ERFKILL for masked unitsZbigniew Jędrzejewski-Szmek2017-02-012-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 76ec966f0e33685f833 changed the code from ESHUTDOWN to ERFKILL, but missed one spot in bus-common-errors.c. Fix that. The code in transaction.c was checking for ERFKILL, but I'm not sure if this mismatch had any effect, i.e. if there were any code paths in which the wrong code actually made difference. Also add comments when ESHUTDOWN is used in the journal code, so it's easy to distinguish those cases when grepping. Standarize on the same capitalization. (There's also a bunch of uses in sd-bus.c, but that's clearly different.)
* | Merge pull request #5202 from keszybz/cgls-unitsLennart Poettering2017-02-027-170/+222
|\ \ | | | | | | systemd-cgls --unit --user-unit
| * | cgls: allow --unit, --user-unit to take optional argumentZbigniew Jędrzejewski-Szmek2017-02-011-14/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following are all equivalent: --unit foo.service bar.service --unit=foo.service bar.service --unit=foo.service --unit=bar.service foo.service bar.service --unit Similarly for --user-unit. The only case that doesn't work well is when --unit and --user-unit are mixed: --unit=foo.service --user-unit=bar.service We'll treat both names as user units. I think this is OK.
| * | cgls: add --user-unit to show user unitsZbigniew Jędrzejewski-Szmek2017-02-012-15/+37
| | |
| * | cgls: add --unit to show unitsZbigniew Jędrzejewski-Szmek2017-02-012-8/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | $ systemd-cgls -u systemd-journald.service machine.slice I opted for a "global" switch, instead of modifying the behaviour of just one argument. It seem to be a more useful setting, since usually one will want to query one or more units, and not mix unit names with paths. Closes #5156.
| * | shared/cgroup-show: extract funtion to query unit cgroup pathZbigniew Jędrzejewski-Szmek2017-02-015-60/+43
| | | | | | | | | | | | …and use it where possible.
| * | cgtop: use common function to query cgroup rootZbigniew Jędrzejewski-Szmek2017-02-014-95/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | show_cgroup_get_root_and_warn is renamed to show_cgroup_get_path_and_warn because it now optionally allows querying a non-root path. This removes duplicated code and teaches cgtop to combine -M with a root prefix: $ systemd-cgtop -M myprecious /system.slice ...
| * | cgls: make function to query cgroup root publicZbigniew Jędrzejewski-Szmek2017-02-013-46/+61
| | | | | | | | | | | | No functional change.
* | | Merge pull request #5203 from poettering/dotdotZbigniew Jędrzejewski-Szmek2017-02-0114-22/+52
|\ \ \ | | | | | | | | trivial unification of checking for "." and ".." when iterating through directories...
| * | | hexdecoct: use typesafe new() instead of malloc()Lennart Poettering2017-02-021-2/+2
| | | |
| * | | fs-util: unify code we use to check if dirent's d_name is "." or ".."Lennart Poettering2017-02-0212-20/+43
| | | | | | | | | | | | | | | | | | | | We use different idioms at different places. Let's replace this is the one true new idiom, that is even a bit faster...
| * | | update TODOLennart Poettering2017-02-011-0/+7
| |/ /
* | | Merge pull request #5151 from keszybz/journal-flagsLennart Poettering2017-02-022-26/+45
|\ \ \ | | | | | | | | More information about unsupported journal file flags
| * | | journal-file, journalctl: provide better hint about unsupported featuresZbigniew Jędrzejewski-Szmek2017-01-242-5/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1416201 $ journalctl -b Journal file /var/log/journal/ad18f69b80264b52bb3b766240742383/system@0005467d92e23784-a6571c8b69d09124.journal~ uses an unsupported feature, ignoring file. Use SYSTEMD_LOG_LEVEL=debug journalctl --file=/var/log/journal/ad18f69b80264b52bb3b766240742383/system@0005467d92e23784-a6571c8b69d09124.journal~ to see the details. -- No entries -- $ journalctl --file=/var/log/journal/ad18f69b80264b52bb3b766240742383/system@0005467d92e23784-a6571c8b69d09124.journal~ Journal file /var/log/journal/ad18f69b80264b52bb3b766240742383/system@0005467d92e23784-a6571c8b69d09124.journal~ uses incompatible flag lz4-compressed disabled at compilation time. Failed to open journal file /var/log/journal/ad18f69b80264b52bb3b766240742383/system@0005467d92e23784-a6571c8b69d09124.journal~: Protocol not supported mmap cache statistics: 0 hit, 1 miss Failed to open files: Protocol not supported
| * | | journal-file: factor out helper functionZbigniew Jędrzejewski-Szmek2017-01-241-25/+26
| | | | | | | | | | | | | | | | In preparation for later changes.
* | | | man: fix spelling error parth -> pathBrandon Philips2017-02-021-1/+1
| | | |
* | | | systemctl: restore --failed (#5198)Zbigniew Jędrzejewski-Szmek2017-02-024-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'systemctl --failed' is an extremely common operation and it's nice to have a shortcut for it. Revert "man: don't document systemctl --failed" and add the option back to systemctl's help and shell completion scripts. This reverts commit 036359ba8d0aba7db7eac75d10073a849a033fd1.
* | | | system-update-generator: warn if the command line blocks updates (#5173)Zbigniew Jędrzejewski-Szmek2017-02-011-1/+24
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | If "3", "5", "systemd.unit=", or similar are present on the kernel command line, the system will not enter into offline update. This behaviour is in line with the general logic that configuration on the kernel command line has higher priority than the configuration on disk, but is rather surprising. Emit a warning to help users diagnose the situation. https://bugzilla.redhat.com/show_bug.cgi?id=1405439#c4
* | | Merge pull request #5191 from keszybz/tweaksZbigniew Jędrzejewski-Szmek2017-02-019-57/+73
|\ \ \
| * | | cryptsetup: do not return uninitialized value on errorZbigniew Jędrzejewski-Szmek2017-01-311-3/+1
| | | | | | | | | | | | | | | | CID #1368416.
| * | | shared/cgroup-show: use (void)Zbigniew Jędrzejewski-Szmek2017-01-311-1/+1
| | | | | | | | | | | | | | | | CID #1368243.
| * | | journal-file: check asprintf return value in the usual fashionZbigniew Jędrzejewski-Szmek2017-01-311-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is unlikely to fail, but we cannot rely on asprintf return value on failure, so let's just be correct here. CID #1368236.
| * | | core/timer: use (void)Zbigniew Jędrzejewski-Szmek2017-01-311-1/+1
| | | | | | | | | | | | | | | | CID #1368234.
| * | | core/execute.c: check asprintf return value in the usual fashionZbigniew Jędrzejewski-Szmek2017-01-311-16/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is unlikely to fail, but we cannot rely on asprintf return value on failure, so let's just be correct here. CID #1368227.
| * | | core/execute: reformat exec_context_named_iofds() for legibilityZbigniew Jędrzejewski-Szmek2017-01-311-5/+19
| | | |
| * | | pid1: rewrite check in ignore_proc() to not check condition twiceZbigniew Jędrzejewski-Szmek2017-01-311-16/+13
| | | | | | | | | | | | | | | | It's harmless, but it seems nicer to evaluate a condition just a single time.
| * | | boot: fix two typosZbigniew Jędrzejewski-Szmek2017-01-312-2/+2
| | | |
| * | | logind: trivial simplificationZbigniew Jędrzejewski-Szmek2017-01-311-7/+3
| | | | | | | | | | | | | | | | free_and_strdup() handles NULL arg, so make use of that.
* | | | Revert "Trivial typo fixes and code refactorings (#5191)"Zbigniew Jędrzejewski-Szmek2017-02-019-73/+57
| | | | | | | | | | | | | | | | | | | | | | | | Let's do a merge to preserve all the commit messages. This reverts commit 785d345145bbd06c8f1c75c6a0b119c4e8f411db.
* | | | Trivial typo fixes and code refactorings (#5191)Zbigniew Jędrzejewski-Szmek2017-02-019-57/+73
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * logind: trivial simplification free_and_strdup() handles NULL arg, so make use of that. * boot: fix two typos * pid1: rewrite check in ignore_proc() to not check condition twice It's harmless, but it seems nicer to evaluate a condition just a single time. * core/execute: reformat exec_context_named_iofds() for legibility * core/execute.c: check asprintf return value in the usual fashion This is unlikely to fail, but we cannot rely on asprintf return value on failure, so let's just be correct here. CID #1368227. * core/timer: use (void) CID #1368234. * journal-file: check asprintf return value in the usual fashion This is unlikely to fail, but we cannot rely on asprintf return value on failure, so let's just be correct here. CID #1368236. * shared/cgroup-show: use (void) CID #1368243. * cryptsetup: do not return uninitialized value on error CID #1368416.
* | | nspawn: Print attempted execv() path on failure (#5199)Philip Withnall2017-02-011-6/+11
| | | | | | | | | | | | | | | | | | The failure message is typically currently: execv() failed: No such file or directory which is not very useful because it doesn’t tell you which file or directory it was trying to exec.
* | | Merge pull request #5166 from keszybz/gcc7Evgeny Vereshchagin2017-02-0115-22/+49
|\ \ \ | | | | | | | | Fixes for gcc 7 and new µhttpd & glibc warnings
| * | | nss-util: silence warning about deprecated RES_USE_INET6Zbigniew Jędrzejewski-Szmek2017-01-311-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/nss-resolve/nss-resolve.c: In function ‘_nss_resolve_gethostbyname_r’: src/nss-resolve/nss-resolve.c:680:13: warning: RES_USE_INET6 is deprecated NSS_GETHOSTBYNAME_FALLBACKS(resolve); ^~~~~~~~~~~~~~~~~~~~~~~~~ In glibc bz #19582, RES_USE_INET6 was deprecated. This might make sense for clients, but they didn't take into account nss module implementations which *must* continue to support the option. glibc internally defines DEPRECATED_RES_USE_INET6 which can be used without emitting a warning, but it's not exported publicly. Let's do the same, and just copy the definition to our header.
| * | | MurmurHash: all /* fall through */ commentsZbigniew Jędrzejewski-Szmek2017-01-311-3/+3
| | | |
| * | | journal/lookup3: silence gcc 7 implicit-fallthrough warningZbigniew Jędrzejewski-Szmek2017-01-311-0/+4
| | | | | | | | | | | | | | | | | | | | This file doesn't include any of our headers, so just use the pragma without defining it in macros.h
| * | | tree-wide: adjust fall through comments so that gcc is happyZbigniew Jędrzejewski-Szmek2017-01-318-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc 7 adds -Wimplicit-fallthrough=3 to -Wextra. There are a few ways we could deal with that. After we take into account the need to stay compatible with older versions of the compiler (and other compilers), I don't think adding __attribute__((fallthrough)), even as a macro, is worth the trouble. It sticks out too much, a comment is just as good. But gcc has some very specific requiremnts how the comment should look. Adjust it the specific form that it likes. I don't think the extra stuff we had in those comments was adding much value. (Note: the documentation seems to be wrong, and seems to describe a different pattern from the one that is actually used. I guess either the docs or the code will have to change before gcc 7 is finalized.)
| * | | nspawn: fix clobbering of selinux context argZbigniew Jędrzejewski-Szmek2017-01-311-2/+1
| | | | | | | | | | | | | | | | First bug fixed by gcc 7. Yikes.
| * | | pid1: remove duplicate const attributeZbigniew Jędrzejewski-Szmek2017-01-311-1/+1
| | | | | | | | | | | | | | | | gcc 7 started warning about this.
| * | | microhttpd-util: silence warnings about deprecated optionsZbigniew Jędrzejewski-Szmek2017-01-313-9/+20
| | | |
* | | | Merge pull request #5146 from ssahani/ifname-aliasZbigniew Jędrzejewski-Szmek2017-01-313-5/+4
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | networkd: Allow ':' in label This reverts a341dfe563 and takes a slightly different approach: anything is allowed in network interface labels, but network interface names are verified as before (i.e. amongst other things, no colons are allowed there).
| * | | | networkd: Allow ':' in labelSusant Sahani2017-01-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | IFA_LABEL does not need much of a validation except the length that is IFNAMSIZ as seen from kernel code.