Commit graph

28318 commits

Author SHA1 Message Date
Dan Streetman 1b43e24602 network: attach sd-event in link_load() when creating link dhcp_client or ipv4ll
Commit 08c588d18b moved attachment of the
sd-event into creation of the dhcp_client or ipv4ll in dhcp4_configure()
or ipv4ll_configure(), but these can also be created in link_load(),
so that creation needs to also perform sd-event attachment.

Without this, dhcp_client or ipv4ll created in link_load() will not have
an ->event and will fail assertion, causing networkd to fail, e.g.:

Assertion 'client->event' failed at src/libsystemd-network/sd-dhcp-client.c:1283, function client_start_delayed(). Ignoring.
ens2: Could not acquire DHCPv4 lease: Invalid argument
ens2: Failed
2020-03-24 17:49:08 +01:00
Susant Sahani 12ef8fb6f1 networkctl: Add more bridge properties 2020-03-24 10:08:48 +01:00
Zbigniew Jędrzejewski-Szmek 2e7d6d1d32
Merge pull request #15185 from ssahani/fix-sip-copy-paste
network: DHCP lease load SIP copy paste error
2020-03-24 10:03:57 +01:00
pelzvieh 137d448751 davfs is a network file system 2020-03-24 10:01:25 +01:00
Arusekk 71180f8e57 Fall back to kexec when no kexec binary exists
This may be not a popular setup, but in case kexec resides somewhere different
than the default location for KEXEC (`/usr/sbin/kexec`), don't just reboot and
try doing `reboot(RB_KEXEC)` instead, just like what `kexec -e` normally does.
2020-03-24 09:50:11 +01:00
Vito Caputo d4a3494e65 swap: check p->what for NULL
Commit 61f9cf4e4c introduced swap_get_parameters(s) but only
checked its return for NULL and not its ->what.

Fixes https://github.com/systemd/systemd/issues/15070
2020-03-23 08:30:32 +01:00
Susant Sahani 1f807af6de networkctl: Add support to display SIP servers
```
❯ build/networkctl status veth99                                                                                                                                                           ─╯
● 17: veth99
                     Link File: /usr/lib/systemd/network/99-default.link
                  Network File: /usr/lib/systemd/network/veth99.network
                          Type: ether
                         State: routable (configured)
                        Driver: veth
                    HW Address: 1e:04:f8:b8:2f:d4
                           MTU: 1500 (min: 68, max: 65535)
                         QDisc: noqueue
  IPv6 Address Generation Mode: eui64
          Queue Length (Tx/Rx): 1/1
              Auto negotiation: no
                         Speed: 10Gbps
                        Duplex: full
                          Port: tp
                       Address: 192.168.5.35 (DHCP4)
                                fe80::1c04:f8ff:feb8:2fd4
                       Gateway: 192.168.5.1
                           DNS: 192.168.5.1
                           NTP: 192.168.5.1
                           SIP: 192.168.5.4
                                192.168.5.5
                     Time Zone: Europe/Berlin

Mar 21 23:26:32 Zeus systemd-networkd[671]: veth99: Link DOWN
Mar 21 23:26:32 Zeus systemd-networkd[671]: veth99: Lost carrier
Mar 22 10:25:35 Zeus systemd-networkd[671]: veth99: Link UP
Mar 22 10:25:35 Zeus systemd-networkd[671]: veth99: Gained carrier
Mar 22 10:25:36 Zeus systemd-networkd[671]: veth99: Gained IPv6LL
Mar 22 10:29:02 Zeus systemd-networkd[671]: veth99: Link DOWN
Mar 22 10:29:02 Zeus systemd-networkd[671]: veth99: Lost carrier
Mar 22 10:29:13 Zeus systemd-networkd[671]: veth99: Link UP
Mar 22 10:29:13 Zeus systemd-networkd[671]: veth99: Gained carrier
Mar 22 10:29:14 Zeus systemd-networkd[671]: veth99: Gained IPv6LL

```
2020-03-22 15:59:05 +01:00
Susant Sahani eb46288cca sd-network: Provice APIs to access SIP servers given by DHCP4 server 2020-03-22 10:39:23 +01:00
Susant Sahani be1af90585 network: DHCP lease load SIP copy paste error 2020-03-21 18:34:46 +01:00
Arnaud Ferraris 19bb87fbfa login: allow non-console sessions to change vt
When starting a wayland session through a systemd service for a non-root
user, the compositor (based on wlroots) is denied the authorization to
change vt.
Once the user logs in, either through a local console or via ssh, the
compositor can work properly.

This is related to the login polkit policy:
- `allow_inactive` has value `auth_admin_keep`, denying any non-root
  user session the authorization to change vt
- `allow_active` has value `yes`, which explains why the vt change
  becomes possible once the user logs in through another channel

By changing the `allow_inactive` value to `yes`, any user session setup
in a service file can switch vt, allowing wayland sessions for non-root
users.
2020-03-19 09:29:23 +01:00
Franck Bui b39648ed47 logind: log a more accurate error when we failed at session creation
We used to log the following error:

  "Start job for unit user-1000.slice failed with 'canceled'"

which can be really misleading if the actual job failed at *stopping* a unit.

Indeed "Start" was hard coded but it was wrong since we can also fail with stop
jobs which are enqueued when a session is stopped.
2020-03-19 09:22:43 +01:00
Zbigniew Jędrzejewski-Szmek 677ceb0c2f
Merge pull request #15153 from keszybz/man-bus-address
Add two man pages for sd-bus
2020-03-19 09:11:14 +01:00
David Wood 7354900ddd network: Fix split in SendOption= on client and server
When specifying `DHCPv4.SendOption=`, it is used by systemd-networkd to
set the value of that option within the DHCP request that is sent out.
This differs to setting `DHCPServer.SendOption=`, which will place all
the options together as suboptions into the vendor-specific information
(code 43) option.

This commit adds two new config options, `DHCPv4.SendVendorOption=` and
`DHCPServer.SendVendorOption=`. These both have the behaviour of the old
`DHCPServer.SendOption=` flag, and set the value of the suboption in the
vendor-specific information option.

The behaviour of `DHCPServer.SendOption=` is then changed to reflect
that of `DHCPv4.SendOption=`. It will set the value of the corresponding
option in the DHCP request.
2020-03-19 09:08:40 +01:00
Susant Sahani d69b62de44 networkctl: Add support to display IPv6 addrgenmode 2020-03-19 08:57:59 +01:00
Christian Göttsche 194fe32296 selinux: delay mac_selinux_enforcing call after SELinux was determined to be enabled
Calling `mac_selinux_enforcing()`, which calls `security_getenforce()`, on a SELinux disabled system causes the following error message to be printed:
    Failed to get SELinux enforced status: No such file or directory

Fixes: 257188f80c ("selinux: cache enforced status and treat retrieve failure as enforced mode")
Supersedes: #15145
2020-03-19 08:56:30 +01:00
Zbigniew Jędrzejewski-Szmek cc3d85eb97 sd-bus: mark sd_bus_try_close() as deprecated
codesearch.debian.net shows no uses (except for the definition in systemd and
elogind).

$ cat > test.c

int main() {
  sd_bus_try_close(NULL);
  return 0;
}
$ gcc -Isrc/systemd -Wall -o testbus test.c -lsystemd
test.c: In function ‘main’:
test.c:4:3: warning: ‘sd_bus_try_close’ is deprecated [-Wdeprecated-declarations]
    4 |   sd_bus_try_close(NULL);
      |   ^~~~~~~~~~~~~~~~
In file included from test.c:1:
src/systemd/sd-bus.h:180:5: note: declared here
  180 | int sd_bus_try_close(sd_bus *bus) _sd_deprecated_; /* deprecated */
      |     ^~~~~~~~~~~~~~~~
2020-03-18 19:57:44 +01:00
Zbigniew Jędrzejewski-Szmek 99cde098f8 bus: drop dead code for kdbus support
sd_bus_try_close() always returns -EOPNOTSUPP if bus is a valid object.
It nevers returns -EBUSY. So we'd always go into the "fallback" path.
2020-03-18 19:57:44 +01:00
Zbigniew Jędrzejewski-Szmek d3d5ff4bc2 sd-bus: make bus_set_address_user always go through sd_bus_set_address
This way all the checks are done, and we don't leak a pointer if
bus_set_address_user() is called twice.
2020-03-18 19:57:43 +01:00
Susant Sahani b1d6fe7055 networkctl: Add support to display bond 2020-03-18 16:12:07 +01:00
Zbigniew Jędrzejewski-Szmek 8c357762c7
Merge pull request #14749 from msekletar/cpu-aff-numa-v3
core: add support for setting CPUAffinity= to special "numa" value
2020-03-18 13:35:58 +01:00
Yu Watanabe b48772f6cb
Merge pull request #15143 from ssahani/networkctl-tunnel-geneve
networkctl: Add support to display geneve tunnel info
2020-03-18 18:33:38 +09:00
Susant Sahani 5712d689b9 networkctl: Add support to display vti and vti6 tunnels 2020-03-18 05:21:41 +01:00
Susant Sahani ad760bc1e7 networkctl: add support to display ip6gre, ip6gretap, ip6erspan 2020-03-18 04:27:09 +01:00
Zbigniew Jędrzejewski-Szmek 34bc838f15
Merge pull request #15136 from yuwata/network-dhcp4-use-gateway
network: add a flag to ignore gateway provided by DHCP server
2020-03-17 16:51:18 +01:00
Zbigniew Jędrzejewski-Szmek 52d247154b
Merge pull request #15108 from keszybz/systemctl-set-default-notices
Make systemctl set-default hint about some common issues
2020-03-17 16:39:45 +01:00
Susant Sahani 4d75ea1ea3 networkctl: Add support to display gre gretap and erspan 2020-03-17 14:31:54 +01:00
Susant Sahani 4e1a1991c6 networkctl: Add support to display geneve tunnel info 2020-03-17 12:47:51 +01:00
Zbigniew Jędrzejewski-Szmek 12877da215 systemctl: print a notice when set-default is not effective
$ sudo ln -svf multi-user.target /run/systemd/generator.early/default.target
'/run/systemd/generator.early/default.target' -> 'multi-user.target'
$ sudo build/systemctl set-default --root=/ sysinit.target
Removed /etc/systemd/system/default.target.
Created symlink /etc/systemd/system/default.target → /usr/lib/systemd/system/sysinit.target.
Note: "multi-user.target" is the default unit (possibly a runtime override).

The output is not super informative, but it should be enough to point the user in
the right direction.

Fixes #3645.
2020-03-17 12:11:09 +01:00
Susant Sahani dca352245b networkctl: Add support to show tunnel (ipip/sit) local and remote address 2020-03-17 19:45:41 +09:00
Anita Zhang a4f4a4e441
Merge pull request #15138 from ssahani/networkctl-vlan
networkctl: Add support to display vlan ID
2020-03-16 12:56:07 -07:00
Yu Watanabe 08c588d18b network: do not re-attach sd-event object
Fixes #15126.
2020-03-17 00:32:55 +09:00
Yu Watanabe 74f0fb9095 network: can: add support for listen-only mode
Closes #15129.
2020-03-17 00:32:35 +09:00
Susant Sahani 6cfef1b308 networkctl: Add support to display master device 2020-03-17 00:32:14 +09:00
Susant Sahani 2b2a1ae6fb networkctl: Add support to display vlan ID 2020-03-16 15:33:16 +01:00
Yu Watanabe b453122789 network: add a flag to ignore gateway provided by DHCP server
Closes #15117.
2020-03-16 19:34:43 +09:00
Michal Sekletár e2b2fb7f56 core: add support for setting CPUAffinity= to special "numa" value
systemd will automatically derive CPU affinity mask from NUMA node
mask.

Fixes #13248
2020-03-16 08:57:28 +01:00
Michal Sekletár 1808f76870 shared: split out NUMA code from cpu-set-util.c to numa-util.c 2020-03-16 08:23:18 +01:00
Haochen Tong f12d19b304 home: fix segfault when parsing arguments in PAM module 2020-03-16 16:20:11 +09:00
Zbigniew Jędrzejewski-Szmek 5e59431c53 systemctl: emit notice about some kernel commandline options
Things can be pretty confusing when there's a commandline option overrding the
configured default... Let's be nice to the user and emit a warning.
2020-03-13 17:52:19 +01:00
Zbigniew Jędrzejewski-Szmek cd57038a30 core: consistently emit oom warning when parsing args
In practice we are very unlikely to fail at this point, but for
consistency, we should always warn when allocation fails, and
we have free_and_strdup_warn() for this.
2020-03-13 15:54:27 +01:00
Susant Sahani e810df37e4 networkctl: Add support to display qdisc
./networkctl status ens38                                                                                                                                                                ─╯
● 4: ens38
             Link File: /usr/lib/systemd/network/99-default.link
          Network File: /usr/lib/systemd/network/10-ens38.network
                  Type: ether
                 State: routable (configured)
     Alternative Names: enp2s6
                  Path: pci-0000:02:06.0
                Driver: e1000
                Vendor: Intel Corporation
                 Model: 82545EM Gigabit Ethernet Controller (Copper) (PRO/1000 MT Single Port Adapter)
            HW Address: 00:0c:29:d2:42:7c (VMware, Inc.)
                   MTU: 1500 (min: 46, max: 16110)
                 QDisc: fq_codel        <============================
  Queue Length (Tx/Rx): 1/1
      Auto negotiation: yes
                 Speed: 1Gbps
                Duplex: full
                  Port: tp
               Address: 192.168.5.123
                        fe80::20c:29ff:fed2:427c
2020-03-13 10:55:31 +01:00
Susant Sahani 8394952777 sd-netlink: Add IFLA_QDISC 2020-03-13 10:54:02 +01:00
Georg Müller 8d0726fcd7 fix journalctl regression (#15099)
This regression was introduced in #14913.

The current_file variable can be NULL, as, for example, with the
following commands:

* journalctl --list-boots
* journalctl -b -1 --no-pager

Since current_file is only checked for pointer equality with f, removing
the assertion is safe here.
2020-03-13 12:31:01 +09:00
Anita Zhang 557b9716f6
Merge pull request #15097 from keszybz/job-logging-and-news-update
Job logging and news update
2020-03-12 13:01:00 -07:00
Christian Hesse ddee0e815e shared/ask-password-api: do not show hint on echo
Giving --echo to systemd-ask-password allows to echo the user input instead
of masking it. This is useful when querying for usernames or similar.

Showing "(press TAB for no echo)" does not make sense there, so do not.
Note that pressing TAB or ESC still disables echo.
2020-03-12 17:55:23 +01:00
nabijaczleweli 567a530760 fstab-generator: handle systemd.swap= command-line argument
Don't generate swap units if set to false

The inverse of this argument is present as "noswap" on Debian sysvinit

Ref:
4422988cb4/debian/vars.sh (L34)
4422988cb4/debian/src/initscripts/etc/init.d/mountall.sh (L78)

Fixes https://github.com/systemd/systemd/issues/6686
2020-03-12 17:52:43 +01:00
Zbigniew Jędrzejewski-Szmek c86c31d9ca core: log an info line about the default target
If the default target is not specified on the kernel command line, it
may not be obvious what we are booting into. See for example
https://github.com/systemd/systemd/issues/15062#issuecomment-597577464.
2020-03-12 15:09:22 +01:00
Yu Watanabe 392a2d5148
Merge pull request #15095 from yuwata/tc-tiny-fixes
network, man: tiny trivial cleanups
2020-03-12 21:17:10 +09:00
Yu Watanabe 1f58feec73 linux: update headers from v5.6 2020-03-12 19:55:10 +09:00
Yu Watanabe ff60129bc4 network: rename type name to ProportionalIntegralControllerEnhanced 2020-03-12 18:18:18 +09:00