Commit graph

32498 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 3cca71c456
Merge pull request #8323 from xyproto/ok_color
Make the color of the status OK configurable at build-time
2018-03-02 13:00:07 +01:00
Michael Vogt 1825c909ff sysusers: support u username -:300 style syntax (#8325)
This PR implements the first part of RFE #8046. I.e. this allows to
write:
```
u username -:300
```
Where the uid is chosen automatically but the gid is fixed.
2018-03-02 12:56:44 +01:00
Zbigniew Jędrzejewski-Szmek 283def70cf
Merge pull request #8332 from poettering/logind-open-if-needed
logind device resume fix
2018-03-02 12:56:04 +01:00
Lennart Poettering 39f305a901 mount-setup: change bpf mount mode to 0700 (#8334)
After discussing with the kernel folks, we agreed to default to 0700 for
this. Better safe than sorry.
2018-03-02 12:55:24 +01:00
Zbigniew Jędrzejewski-Szmek 48449f41b4
Merge pull request #8303 from yuwata/fix-8276
test: use synthesize_nobody() in test-execute
2018-03-02 12:53:11 +01:00
Lennart Poettering c54819ca80 systemctl: document telinit/init matching a bit (#8339)
See: #8305
2018-03-02 12:51:57 +01:00
futpib ae934a7325 hwdb: add accelerometer mount matrix for Asus TP300LD (#8327) 2018-03-02 12:11:28 +01:00
Lennart Poettering 2589472712
Merge pull request #8237 from sourcejedi/timer_suspend
core: let OnCalendar= timer units expire during suspend (#8231)
2018-03-02 12:11:06 +01:00
Lennart Poettering 340aff15f8 logind: fix typo in comment 2018-03-02 11:56:15 +01:00
Lennart Poettering 4d3900f1b7 logind: open device if needed
Fixes: #8291
2018-03-02 11:55:51 +01:00
Lennart Poettering 4804600b6a logind: cast away return value we don't care about 2018-03-02 11:55:33 +01:00
Lennart Poettering a3ddf73c0e logind: voidify a function we never check the return value of 2018-03-02 11:55:16 +01:00
Zbigniew Jędrzejewski-Szmek 47920c4a26
Merge pull request #8316 from yuwata/fix-8315
sysusers: do not create duplicated groups when create users
2018-03-02 11:32:25 +01:00
Zbigniew Jędrzejewski-Szmek 3ab74d0a43
Merge pull request #8330 from filbranden/masked1
Detect masked unit with drop-ins
2018-03-02 11:24:31 +01:00
Zbigniew Jędrzejewski-Szmek f7c5427c28 meson: use dashes in colour names 2018-03-02 09:09:29 +01:00
Alexander F Rødseth 96164a3936 Add build-time option to change the color of the "OK" status text 2018-03-02 09:00:44 +01:00
Alexander F Rødseth 6d1d8f66e0 Organize the ANSI codes and add missing colors
For consistency.
2018-03-02 08:58:02 +01:00
Yu Watanabe 69b0740785 test-execute: add tests with user/group daemon
The nobody user/group may not synthesized by systemd.
To run tests the functionalities in such situation, this adds tests
by user/group by daemon, as it is expected to exists all environments.
2018-03-02 16:42:53 +09:00
Filipe Brandenburger 67348e791d test: masked unit with drop-ins 2018-03-01 21:14:13 -08:00
Filipe Brandenburger 9639b1752c install: detect masked unit with drop-ins
Before this fix, a unit with drop-ins will not be reported as masked by
`systemctl is-enabled` or `systemctl list-unit-files`.
2018-03-01 21:11:35 -08:00
Yu Watanabe d4f0412de4 sysusers: do not implicitly create group by 'm' if 'u' with the same name exists
The commit e2c2060f7b makes 'm' lines
disturb 'u' lines.
This fixes the disturbance.
2018-03-02 07:38:28 +09:00
Yu Watanabe fb5dfbc2d8 test: add a test for sysusers
The test cases for sysusers did not cover the situation reported in
issue #8315. Let's add one more test case.
2018-03-02 07:12:40 +09:00
Yu Watanabe b5327d0a65 sysusers: do not create duplicated groups when create users
The commit e2c2060f7b introduces
the issue #8315.

Fixes #8315.
2018-03-02 07:12:38 +09:00
Zbigniew Jędrzejewski-Szmek 671f0f8de0 Remove /sbin from paths if split-bin is false (#8324)
Follow-up for 157baa87e4.
2018-03-01 21:48:36 +01:00
Lennart Poettering 7df4b832d0
Merge pull request #8319 from keszybz/yet-another-symlink-installation-tweak
meson: fix symlink creation when sbin is symlink to bin
2018-03-01 15:06:02 +01:00
Lennart Poettering 3896a17bdc
Merge pull request #8293 from dobyrch/master
tree-wide: fix inconsistencies in option parsing
2018-03-01 15:03:19 +01:00
Lennart Poettering 94c047203b
Merge pull request #8322 from keszybz/doc-tweak
man: document that link-ed files must be on /
2018-03-01 14:58:12 +01:00
Douglas Christman 6c1a6df375 udevadm: prevent segfault in blkid builtin when offset not specified
"--offset" takes an optional argument; if none is specified,
stroull() will attempt to parse a NULL pointer. For example:

$ udevadm test-builtin 'blkid --offset' /sys/dev/block/8:1

Update "--offset" to require an argument; also verify that the
offset is not negative.
2018-03-01 21:50:38 +08:00
Douglas Christman 3a6a6889e1 analyze: fix typo in error message 2018-03-01 21:50:38 +08:00
Douglas Christman 63547675a4 test-libudev: make "-m" equivalent to "--monitor"
"-m" is specified as a short form of "--monitor" in the option struct,
but not included in getopt_long's optstring.  Update the optstring
to be consistent with the option struct.
2018-03-01 21:50:38 +08:00
Douglas Christman 68da321f66 systemctl: remove redundant option parsing code
"-f" used to be overloaded to mean both "--force" and "--follow";
aae9a96d removed "--follow", leaving behind some duplicate code.
2018-03-01 21:50:38 +08:00
Douglas Christman 2de6b06b27 journalctl: make journalctl -g work as documented
Add "g" to optstring so both "--grep" and "-g" work with journalctl
2018-03-01 21:50:38 +08:00
Zbigniew Jędrzejewski-Szmek 2f3828e5c6 man: document that link-ed files must be on /
Fixes #8307.
2018-03-01 13:11:00 +01:00
Zbigniew Jędrzejewski-Szmek 157baa87e4 meson: support both separate and merged sbin-bin directories
Follow-up for ba7f4ae617.

By default, we detect if the real root has a separate /usr/sbin directory, but
this can be overrides with -Dsplit-bin=true|false. The check assumes that
/usr/sbin is split if it is not a symlink, so it'll return a false negative
with some more complicated setups. But that's OK, in those cases this should be
configured explicitly.

This will copy the structure of the directories in the root file system to
$DESTDIR. If a directory is a directory in $DESTDIR but a symlink in the root
file system, this script will fail. This means that it's not possible to reuse
a $DESTDIR from between ba7f4ae61 and this patch.
2018-03-01 12:27:33 +01:00
Zbigniew Jędrzejewski-Szmek 2675413e39 meson: autodetect split-usr
Also move the status from "features" to the paths section. This is more of an
anti-feature.
2018-03-01 12:23:00 +01:00
Lennart Poettering 16a4f265e4 procfs-util: drop unnecessary zero initializations (#8321)
Follow-up for #8149.
2018-03-01 11:27:06 +01:00
Lennart Poettering 902c8502ad
Merge pull request #8149 from poettering/fake-root-cgroup
Properly synthesize CPU+memory accounting data for the root cgroup
2018-03-01 11:10:24 +01:00
Franck Bui acc8059129 units: delegate "memory" instead of "cpu" by default for user instances (#8320)
CPU accounting has a too bad impact on performance to be enabled by
default. Therefore we should not delegate "cpu" for now.

OTOH since commit e0c46a7364, memory accounting
has been turned on for all units by default so it makes sense to delegate this
controller by default.
2018-03-01 10:58:03 +01:00
Lennart Poettering fba03e3ab4
Merge pull request #8318 from keszybz/doc-tweak
A small man page update
2018-03-01 10:44:17 +01:00
Yu Watanabe d2f95a223f test-execute: add a test for the case that NOBODY_GROUP_NAME is nogroup 2018-03-01 18:31:26 +09:00
Yu Watanabe 57c2efa0c3 test-execute: check nobody user and group are configured correctly
Several tests request nobody user or group. If they are badly
configured, then tests may fail.

This makes test-execute check nobody user and group are configured
correctly before running such tests.

Fixes #8276.
2018-03-01 18:29:28 +09:00
Zbigniew Jędrzejewski-Szmek 9177fa9f2b basic/cgroup-util: simplify cg_get_keyed_attribute(), add test
I didn't like the nested loop where we'd count what we have acquired already,
since we should always know that.
2018-03-01 09:34:33 +01:00
Zbigniew Jędrzejewski-Szmek ee4e9a1090 gitignore .pot file
It is created by "ninja systemd-pot", and we don't want to include it
in git.
2018-03-01 08:05:27 +01:00
Lennart Poettering 649a5ffba8
Merge pull request #8171 from poettering/sd-bus-queue-limit
try not to overload pid1's bus message write queue
2018-02-28 18:15:40 +01:00
Alan Jenkins 13f512d324 core: don't freeze OnCalendar= timer units when the clock goes back a lot
E.g. if you have a monthly event and you set the computer clock back one
year, we can allow the next 12 monthly events to happen naturally.  In fact
we already do this when you start a Persistent=yes timer, we just need to
apply the same logic when it's running and we notice the system clock
being set backwards.
2018-02-28 17:00:07 +00:00
Alan Jenkins 9ea9faff78 core: let OnCalendar= timer units expire during suspend (#8231)
On timejumps, including suspend, timer_time_change() calls for a
re-calculation of the next elapse.  Sadly I'm not quite sure what the
intended effect of this was!  Because it was not managing to fire
OnCalendar= timers which fired during the suspend... unless the timer had
already fired once before.

Reported, entirely correctly as far as I can see, on stackexchange:
https://unix.stackexchange.com/questions/351829/systemd-timer-that-expired-while-suspended

 /* If we know the last time this was
  * triggered, schedule the job based relative
- * to that. If we don't just start from
- * now. */
+ * to that. If we don't, just start from
+ * the activation time. */

The same code is called for both the initial calculation and this
re-calculation.  If we're _not_ already active, then this is before the
activation time has been recorded in the unit, so just use the current
time as before.  The new code is mechanically adapted from the same
logic for `OnActiveSec=` (case TIMER_ACTIVE in the code which follows).

Tested with `date --set`.

Motivations:

* Rotate monitoring data from Atop into files which are named per-day.
  Fedora currently implements this with a cron job that runs at midnight,
  but that didn't handle suspend correctly either.

* unbound-anchor.timer on Fedora, is used to update DNSSEC "root trust
  anchor" daily, before the TTL expires.  It uses OnCalendar=daily
  AccuracySec=24h.  Which is a bit suspect because the TTL is 2 days, but I
  think it has the right general idea.

  None of the other timer settings are correct, because they would not
  account for time spent in suspend.  Unless you set WakeSystem
  (this feature is currently undocumented).

* So in general, we can expect to see people using OnCalendar= for the same
  cases as cron.daily and cron.monthly.  Which use anacron to keep track of
  jobs which should be run even if the system was down at the time.

  Timers which are configured to run more frequently than that, are
  unlikely to mind if they get run slightly more often that the writer
  realized, relative to the amount of time the system was really running.

* From the user report above: "I only want to use remind to show a desktop
  notification, it seems excessive to wake up the computer for that. Also,
  I would like to get the reminder first thing in the morning, so the
  OnActiveSec doesn't help with that."
2018-02-28 16:12:22 +00:00
Alan Jenkins 60933bb89b core: timer_enter_waiting(): refactor base local variable
We have two variables `b` and `base`.  `b` is declared within limited
scope; `base` is declared at the top of the function.  However `base`
is actually only used within a scope which is exclusive of `b`.  Clarify
by moving `base` inside the limited scope as well.

(Also `base` doesn't need initializing any more than `b` does.  The
declaration of `base` is now immediately followed by a case analysis of
`v->base`, which serves almost exclusively to determine the value of
`base`).
2018-02-28 15:07:30 +00:00
Zbigniew Jędrzejewski-Szmek 34fd5f69dd man: shorten/reword a bit in sd_bus_get_n_queued_read
In particular:
- drop "when it is non-zero" to avoid implying that it can be called if the
  queue is not empty.
- "has been created" sounds like something happened in parallel,
  but what we really mean is that *this* particular object *was* created in a
  certain way.
2018-02-28 10:54:37 +01:00
Lennart Poettering 8c89cb5a50
Merge pull request #8283 from poettering/nspawn-user-fix
some trivial nspawn related fixes
2018-02-28 10:37:01 +01:00
Franck Bui f8adf25d65 rules: skip btrfs check if devices are not ready in 64-btrfs.rules (#8304)
If any devices are marked with 'SYSTEMD_READY=0' then we shouldn't run any
btrfs check on them.

Indeed there's no point in running "btrfs ready" on devices that already have
SYSTEMD_READY=0 set. Most probably such devices are members of a higher layer
aggregate device such as dm-multipath or software RAID. Doing IO on them wastes
time at best, and may cause delays, timeouts, or even hangs at worst (think
active-passive multipath or degraded RAID, for example).

It was initially reported at:
https://bugzilla.opensuse.org/show_bug.cgi?id=872929
2018-02-28 10:36:06 +01:00