Commit Graph

30384 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 0c2826c60c core: in --user mode, report READY=1 as soon as basic.target is reached (#7102)
When a user logs in, systemd-pam will wait for the user manager instance to
report readiness. We don't need to wait for all the jobs to finish, it
is enough if the basic startup is done and the user manager is responsive.

systemd --user will now send out a READY=1 notification when either of two
conditions becomes true:
- basic.target/start job is gone,
- the initial transaction is done.

Also fixes #2863.
2017-10-24 14:48:54 +02:00
Lennart Poettering e0237035a0 Merge pull request #7123 from keszybz/date-formatting
Fix for time stamp formatting in timedatectl
2017-10-24 12:24:09 +02:00
myrkr 1898e5f9a3 nspawn: Fix calculation of capabilities for configuration file (#7087)
The current code shifting an integer 1 failed for capabilities like
CAP_MAC_ADMIN (numerical value 33). This caused issues when specifying
them in the nspawn configuration file. Using an uint64_t 1 instead.

The similar code for processing the --capability command line option
was already correctly working.
2017-10-24 09:56:40 +02:00
Zbigniew Jędrzejewski-Szmek fc5ffacdab man: update the description of interval limiting (#7128)
Fixes #7125.
2017-10-24 09:41:52 +02:00
Lennart Poettering b88d48c2ca Merge pull request #7148 from keszybz/dynamic-user-use-gid
Use gid for static dynamic users
2017-10-24 09:38:01 +02:00
Mantas Mikulėnas 195b943d4e NEWS: start adding 236 (#7159) 2017-10-23 22:56:01 +02:00
Lennart Poettering d3aa0a1c42 Merge pull request #6948 from pfl/radv_emit_dns
Add EmitDNS= and EmitDomains= network file configuration options
2017-10-23 18:39:07 +02:00
Zbigniew Jędrzejewski-Szmek c2983a7fdd core/dynamic-user: use gid from pwnam if a static user was found
Fixes #7133.

v2:
- update based on review
2017-10-23 16:09:20 +02:00
Peter Hutterer de13433b2f hwdb: invert the USB touchpad integration assumption (#7161)
The vast majority of touchpads are internal, so let's assume that any USB
touchpad is internal by default (exception: bluetooth) and manually mark the
ones that are external. That's a lot more future-proof than having to mark all
internal touchpads that use USB as internal - that number is only going to
increase.

Related to #7068
2017-10-23 10:20:16 +02:00
Michael Biebl 02fa054dc4 modprobe.d: fix directory of modprobe configuration file (#7149)
kmod upstream uses /lib/modprobe.d which means we need to use rootprefix
instead of prefix for installing the modprobe configuration file as
otherwise split-usr systems are broken.

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=879191
2017-10-21 08:32:50 +02:00
Zbigniew Jędrzejewski-Szmek 362d90b7f2 core/dynamic-user: use _cleanup_ in dynamic user locking
This makes the code a bit easier to read.
2017-10-20 13:39:07 +02:00
Patrik Flykt 6852c0f6b0 sd-radv: Allocate space also for DNSSL iov option (#7144)
The iov array needs to hold five entries in addition to the number
of prefixes.
2017-10-20 10:59:15 +02:00
Zbigniew Jędrzejewski-Szmek dd202fa492 Merge pull request #7132 from splantefeve/fr-translation
Update French translation
2017-10-19 08:29:37 +02:00
Sylvain Plantefève 629be9c9d1 po: update french translation 2017-10-19 00:26:52 +02:00
Sylvain Plantefève b5ff403d14 catalog: update french translation 2017-10-19 00:26:27 +02:00
Zbigniew Jędrzejewski-Szmek 74a79c657e man: describe how machine-id should be initialized (#7051) 2017-10-19 00:47:34 +08:00
Zbigniew Jędrzejewski-Szmek 14ce0c25c2 timedatectl: stop using xstrftime
When using strftime in arbitrary locales, we cannot really say how big the
buffer should be. Let's make the buffer "large", which will work fine pretty
much always, and just print n/a if the timestamp does not fit. strftime returns
0 if the buffer is too small and a NUL-terminated string otherwise, so we
can drop the size specifications in string formatting.

$ export LANG=fa_IR.UTF-8
$ date
چهارشنبه ۱۸ اكتبر ۱۷، ساعت ۱۰:۵۴:۲۴ (+0330)
$ timedatectl
Assertion 'xstrftime: a[] must be big enough' failed at ../src/timedate/timedatectl.c:105, function print_status_info(). Aborting.

now:

$ timedatectl
        Local time: چهارشنبه 2017-10-18 16:29:40 CEST
    Universal time: چهارشنبه 2017-10-18 14:29:40 UTC
          RTC time: چهارشنبه 2017-10-18 14:29:40
…

https://bugzilla.redhat.com/show_bug.cgi?id=1503452
2017-10-18 16:30:37 +02:00
Lennart Poettering b5487fa0b6 Merge pull request #7078 from keszybz/cryptsetup-netdev-fixes
Cryptsetup _netdev fixes
2017-10-18 21:15:29 +08:00
Zbigniew Jędrzejewski-Szmek a0e030f53b units: make remote-cryptsetup.target also after cryptsetup-pre.target
This way people can order units before cryptsetup-pre.target and
have them run before any cryptsetup-related stuff.
2017-10-18 15:14:46 +02:00
Susant Sahani 28464ae0e2 networkd: don't stop the dhcp server if it's not configured. (#7083)
we call sd_dhcp_server_stop even if it's not configured when link is
down resulting unwanted logs.
```
Oct 10 13:41:07 nena systemd-networkd[126]: eth0: Lost carrier
Oct 10 13:41:07 nena systemd-networkd[126]: DHCP CLIENT (0x560f2dc5): STOPPED
Oct 10 13:41:07 nena systemd-networkd[126]: eth0: DHCP lease lost
Oct 10 13:41:07 nena systemd-networkd[126]: NDISC: Stopping IPv6 Router Solicitation client
Oct 10 13:41:07 nena systemd-networkd[126]: Assertion 'server' failed at ../src/libsystemd-network/sd-dhcp-server.c:256, function sd_dhcp_server_stop(). Ignoring.
```

fixes #7047
2017-10-18 12:38:56 +02:00
Zbigniew Jędrzejewski-Szmek b996f7e41a tests: rename test-time to test-time-util
It's for testing time-util.c so rename it to make things more
obvious.
2017-10-18 11:27:23 +02:00
Susant Sahani 702c979fef networkd: Consider linkLocalAddressing state while configuring ndisc. (#7012)
If linkLocalAddressing is disabled in for the interface still then
we look for ndisc configured or not in link_check_ready.

Link local is used automatic address configuration and neighbor discovery protocol.
If link local is disabled we should not configure ndisc.

Fixes #2713, #6441, #5841.
2017-10-18 11:12:59 +02:00
Lubomir Rintel 19a44dfe45 core: fragments of masked units ought not be considered for NeedDaemonReload (#7060)
The units that are not loaded don't have dropin_paths set. This
currently results in units that have fragments to always have
NeedDaemonReload=true when masked:

  $ find {/usr/lib,/run/user/8086}/systemd/user/meh.service* |xargs ls -ld
  lrwxrwxrwx. 1 lkundrak lkundrak    9 Oct 11 11:19 /run/user/8086/systemd/user/meh.service -> /dev/null
  -rw-rw-r--. 1 root     root       49 Oct 11 10:16 /usr/lib/systemd/user/meh.service
  drwxrwxr-x. 2 root     root     4096 Oct 11 10:50 /usr/lib/systemd/user/meh.service.d
  -rw-rw-r--. 1 root     root      666 Oct 11 10:50 /usr/lib/systemd/user/meh.service.d/override.conf
  $ systemctl --user daemon-reload
  $ busctl --user get-property org.freedesktop.systemd1 \
        /org/freedesktop/systemd1/unit/meh_2eservice \
        org.freedesktop.systemd1.Unit NeedDaemonReload
  b true
2017-10-18 08:38:50 +02:00
Zbigniew Jędrzejewski-Szmek 895265ad7d Merge pull request #7059 from yuwata/dynamic-user-7013
dynamic-user: permit the case static uid and gid are different
2017-10-18 08:37:12 +02:00
Yu Watanabe c85f1346c0 man: add explanation about target's DefaultDependencies= (#7120)
Closes #7113.
2017-10-18 08:30:35 +02:00
Yu Watanabe 3bd493dc93 man: comment a requirement about the static user or group when DynamicUser=yes 2017-10-18 15:30:00 +09:00
John Lin 4b4a972d2e man: mention /run in systemd.generator document (#7121) 2017-10-18 08:29:19 +02:00
Susant Sahani 6acbbdd4da networkd: Don't stop networkd if CONFIG_FIB_RULES=n in kernel (#7030)
If FIB Rules are not supported by the kernel then networkd fails to
start as it retuns error=-EOPNOTSUPP.
In this case just ignore and let start networkd.

```
sendto(5, {{len=28, type=RTM_GETRULE, flags=NLM_F_REQUEST|NLM_F_ACK|NLM_F_DUMP, seq=8, pid=0}, {family=AF_UNSPEC, dst_len=0, src_len=0, tos=0, table=RT_TABLE_UNSPEC, action=FR_ACT_TO_TBL, flags=0}}, 28, 0, {sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, 16) = 28
recvmsg(5, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=128->12, msg_iov=[{iov_base=NULL, iov_len=0}], msg_iovlen=1, msg_control=[{cmsg_len=20, cmsg_level=SOL_NETLINK, cmsg_type=0x3}], msg_controllen=24, msg_flags=MSG_TRUNC}, MSG_PEEK|MSG_TRUNC) = 48
recvmsg(5, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=128->12, msg_iov=[{iov_base={{len=48, type=NLMSG_ERROR, flags=0, seq=8, pid=8856}, {error=-EOPNOTSUPP, msg={{len=28, type=RTM_GETRULE, flags=NLM_F_REQUEST|NLM_F_ACK|NLM_F_DUMP, seq=8, pid=0}, {family=AF_UNSPEC, dst_len=0, src_len=0, tos=0, table=RT_TABLE_UNSPEC, action=FR_ACT_TO_TBL, flags=0}}}}, iov_len=7416}], msg_iovlen=1, msg_control=[{cmsg_len=20, cmsg_level=SOL_NETLINK, cmsg_type=0x3}], msg_controllen=24, msg_flags=0}, MSG_TRUNC) = 48
```

```
Oct 08 10:22:24 naomi systemd[1]: Starting Network Service...
Oct 08 10:22:24 naomi systemd-networkd[983]: Could not enumerate rules: Operation not supported
Oct 08 10:22:24 naomi systemd[1]: systemd-networkd.service: Main process exited, code=exited, status=1/FAILURE
```

Fixes #7027
2017-10-18 08:25:57 +02:00
Yu Watanabe e2b0cc3415 core: fix invalid error message
The error message corresponds to EILSEQ is "Invalid or incomplete
multibyte or wide character", and is not suitable in this case.
So, let's show a custom error message when the function
dynamic_creds_realize() returns -EILSEQ.
2017-10-18 08:57:59 +09:00
Zbigniew Jędrzejewski-Szmek 288c26165e man: add a note about _netdev usage 2017-10-17 19:15:58 +02:00
Zbigniew Jędrzejewski-Szmek a0dd209763 units: replace remote-cryptsetup-pre.target with remote-fs-pre.target
remote-cryptsetup-pre.target was designed as an active unit (that pulls in
network-online.target), the opposite of remote-fs-pre.target (a passive unit,
with individual provider services ordering itself before it and pulling it in,
for example iscsi.service and nfs-client.target).

To make remote-cryptsetup-pre.target really work, those services should be
ordered before it too. But this would require updates to all those services,
not just changes from systemd side.

But the requirements for remote-fs-pre.target and remote-cryptset-pre.target
are fairly similar (e.g. iscsi devices can certainly be used for both), so
let's reuse remote-fs-pre.target also for remote cryptsetup units. This loses
a bit of flexibility, but does away with the requirement for various provider
services to know about remote-cryptsetup-pre.target.
2017-10-17 19:15:58 +02:00
Zbigniew Jędrzejewski-Szmek be21bf856b test-path: fix inverted return value (#7050)
It must be <0 to indicate failure.

Fixes #7050.
2017-10-17 17:49:48 +02:00
Mantas Mikulėnas cfe134e312 modprobe.d: expand drop-in to handle dummy0 as well (#7099) 2017-10-16 17:17:47 +02:00
Michal Sekletar fab35afabf mount: make sure we unmount tmpfs mounts before we deactivate swaps (#7076)
In the past we introduced this property just for tmp.mount. However on
todays systems usually there are many more tmpfs mounts. Most notably
mounts backing XDG_RUNTIME_DIR for each user.

Let's generalize what we already have for tmp.mount and implement the
ordering After=swap.target for all tmpfs based mounts.
2017-10-16 16:15:05 +02:00
Zbigniew Jędrzejewski-Szmek 0051ca1f63 Merge pull request #7061 from lkundrak/lr/serialized-environment
Environment serialization/deserialization inconsistently validates the variables
2017-10-15 12:47:30 +02:00
Boucman 92f34a9c47 Display the systemctl status in green if state is "running" (#7094) 2017-10-15 12:22:47 +02:00
Zbigniew Jędrzejewski-Szmek a524f12457 Merge pull request #7062 from yuwata/test-bind-paths
test: add test for BindPaths= and BindReadOnlyPaths=
2017-10-13 10:19:55 +02:00
John Lin 7cca1437d6 gitignore: ignore output file of mkid (#7081)
mkid is from https://www.gnu.org/software/idutils/
2017-10-13 10:17:43 +02:00
Christian Hesse 1dc92a06e2 man: update changes about gateway -> _gateway (#7085)
Commit 5248e7e1f1
(resolved,nss-myhostname: use _gateway for the gateway) changed how the
gateway is resolved. Reflect the change in documentation.

Close #7084.
2017-10-13 16:10:26 +09:00
Zbigniew Jędrzejewski-Szmek 8f462b074e units: add [Install] section to remote-cryptsetup.target
This makes this target the same as remote-fs.target in this regard. In practice
it probably doesn't make that much difference, because all encrypted devices
that are part of remote-fs.target (marked with _netdev) will be used for mount
points, so they will be pulled in anyway individually, but with this change any
such device will be configured, even if it is not pulled by any other unit.
2017-10-13 08:03:16 +02:00
Lubomir Rintel 4e93d369b9 systemctl: clarify --global, --root and --runtime options (#7071)
They're not only for enabling.
2017-10-12 08:14:25 +02:00
Vito Caputo ed05452014 shared: add vectorized parse_field() (#7056)
By vectorizing parse_field() the chain of parse_field() calls in
output_short() can be replaced with a single call receiving a description
of the desired fields and their targets.

While at it, eliminate the repeated strlen() calls performed on constant
field names by making parse_field() receive the field length, and storing
it in the ParseFieldVec at compile time.

Also sort the output_short() fields so the short ones are tried first, for
a minor efficiency gain.

In addition to making the code less repetitive, gcc in my tests now inlines
the parse_fieldv() call in output_short().
2017-10-12 08:14:07 +02:00
Yu Watanabe 709dbeac14 core: cleanup for enforce_groups() (#7064)
SupplementaryGroups= is preprocessed in get_supplementary_groups().
So, it is not necessary to input ExecContext to enforce_groups().
2017-10-12 08:10:25 +02:00
Yu Watanabe 038a373651 test-execute: always use /bin/sh 2017-10-12 13:26:39 +09:00
Yu Watanabe d053b72bdd test: add test for BindPaths= and BindReadOnlyPaths=
Follow-up for a8cabc612b.
2017-10-12 13:25:06 +09:00
John Lin 35d379b2e8 systemctl: supress enable/disable messages when -q is given (#7067)
Fixes: #7036
2017-10-11 20:22:51 +02:00
Lennart Poettering 523578aa6d basic: split unit-name.[ch] into two (#7065)
It always bothered me a bit that unit-name.[ch] contains so many
definitions that aren't really have much to do with unit nameing, for
example all the unit state definitions.

With this patch unit-name.[ch] is split into two: the file now contains
only the unit naming related operations, and everything else is split
out into a new set of files unit-def.[ch]. That's mostly unit state
stuff as well as dbus path and interface name operations.

No functional changes. This just moves code around.

(Note as both .c files include each other's headers this doesn't make
the build simpler or anything. All it does is make the C files a bit
shorter, and medicate my pretend OCD)
2017-10-11 20:21:28 +02:00
Lubomir Rintel c7d797bbdf basic/env-util: don't relax unesaping of serialized environment strings
We wrote them ourselves -- they shouldn't contain invalid sequences.
2017-10-11 15:05:38 +02:00
Lubomir Rintel ea43bdd1d7 basic/env-util: drop the validation when deserializing environment
The environment variables we've serialized can quite possibly contain
characters outside the set allowed by env_assignment_is_valid(). In
fact, my environment seems to contain a couple of these:

  * TERMCAP set by screen contains a '\x7f' character
  * BASH_FUNC_module%% variable has a '%' character in name

Strict check of environment variables name and value certainly makes sense for
unit files, but not so much for deserialization of values we already had
in our environment.
2017-10-11 15:01:32 +02:00
Florian Klink da172fa9ea test-dhcp-client: fix typos in comment (#7052) 2017-10-11 14:45:48 +02:00