1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-05 15:21:37 +03:00
Commit Graph

43837 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
96d33e4ac0 Rename _PATH variables to _DIR when they refer to a directory
We were very inconsistent in this, but in general _PATH signifies
a search path (separated with :), and _DIR signifies a single directory.
2020-03-27 20:12:45 +01:00
Zbigniew Jędrzejewski-Szmek
9c5bb2033d path: show various systemd directories and search paths too
So far we had various ad hoc APIs to query search paths:
systemd-analyze unit-paths, lookup_paths_log(), the pkgconfig file,
debug logs emitted by systemd-analyze cat-config.
But answering a simple question "what is the search path for tmpfiles,
sysusers, .network files, ..." is surprisingly hard.

I think we should have an api that makes it easy to query this. Pkgconfig is
not bad, but it is primarily a development tool, so it's not available in many
context. Also it can't provide support for paths which are influenced by
environment variables, and I'd like to be able to answer the question "what is
the search path for ..., assuming that VAR_FOO=... is set?".

Extending sd-path to support more of our internal paths seems to be most
flexible solution. We already have systemd-path which provides a nice
way to query, and we can add stuff like optional descriptions later on.
We we essentially get a nice programmatic and commmandline apis for the price
of one.
2020-03-27 20:12:45 +01:00
Zbigniew Jędrzejewski-Szmek
ce7eb6aa84 sd-path: simplify implementation of sd_path_lookup*()
The two functions were duplicating a lot of functionality and more
importantly, they both had explicit lists of types which are search
paths. I want to add more types, and I don't want to have to remember
to add them to both lists.
2020-03-27 20:12:44 +01:00
Zbigniew Jędrzejewski-Szmek
09e6443ef4 Move path-lookup.c to src/basic
I want to use it from sd-path later on so it needs to be moved out of
src/shared (libsystemd is not allowed to use code from src/shared).
2020-03-27 20:12:44 +01:00
Zbigniew Jędrzejewski-Szmek
385093b702 Split out generator directory setup to a src/core/generator-setup.c
Those functions have only one non-test user, so we can move them to src/core/.
2020-03-27 20:12:44 +01:00
Zbigniew Jędrzejewski-Szmek
a7addf32a5 sd-path,strv: add simple helper to wrap oom handling around strv_split_nulstr() 2020-03-27 20:12:44 +01:00
Zbigniew Jędrzejewski-Szmek
b35ed5530b man: add sd_path_lookup(3) 2020-03-27 20:12:44 +01:00
Zbigniew Jędrzejewski-Szmek
557afad2b7 libsystemd: install sd-path.h and export sd_path_lookup{,_strv}
Those are not terribly imporant functions, but we have them, and there's
no reason not to export them.
2020-03-27 20:12:44 +01:00
Zbigniew Jędrzejewski-Szmek
3919ecc553 meson: run a no-op build to generate man rules
When a new page is added using man/update-man-rules, ninja doesn't know
about the new target until a build is initiated, so build/man/man and
build/man/html would fail. Force a trivial build to regenerate the rules
before calling 'ninja -t'.
2020-03-27 20:12:44 +01:00
Zbigniew Jędrzejewski-Szmek
51327bcc74 sd-path: rename the two functions
I think the two names were both pretty bad. They did not give a proper hint
what the difference between the two functions is, and sd_path_home sounds like
it is somehow related to /home or home directories or whatever, when in fact
both functions return the same set of paths as either a colon-delimited string
or a strv. "_strv" suffix is used by various functions in sd-bus, so let's
reuse that.

Those functions are not public yet, so let's rename.
2020-03-27 20:12:44 +01:00
Zbigniew Jędrzejewski-Szmek
d32014a5bb test-sd-path: basic test for the sd-path API 2020-03-27 20:12:44 +01:00
Zbigniew Jędrzejewski-Szmek
4908de44b0 {systemd,udev}.pc: add names with underscores, deprecate the old ones
The names with multiple lowercase words run together are hard to read.  We
started that way with very short names like rootprefix, but then same pattern
was applied to longer and longer names. Looking at the body of .pc files
available on my machine, many packages use underscores; let's do the same. Old
names are kept for compatiblity, so this is backwards compatible.
2020-03-27 20:12:44 +01:00
Zbigniew Jędrzejewski-Szmek
009b80a48d path: align columns
Without that it's really hard to see what items are in the table...
2020-03-27 20:12:44 +01:00
Tom
90c40df0a6 Add Lenovo IdeaPad Miix 300 ACCEL_MOUNT_MATRIX 2020-03-27 19:32:29 +01:00
Balint Reczey
93c23c9297 user-util: Allow names starting with a digit
In 1a29610f5f the change inadvertedly
disabled names with digit as the first character. This follow-up change
allows a digit as the first character in compat mode.

Fixes: #15141
2020-03-27 19:06:36 +01:00
Wen Yang
acd1987a18 core/unit: print info when unit_add_name failed
When there are hundreds of mounts on the server, it will take a long
time to analyze the failure of a certain mount unit. So it is useful
to print the reason why unit_add_name() failed.
2020-03-27 18:46:13 +01:00
Zhu Li
9520a0308d Remove stale doc about PrivateNetwork and type 2020-03-27 18:40:31 +01:00
Franck Bui
e730db6c90 systemd-network-generator.service: network-pre.target is a passive target unit 2020-03-27 18:30:57 +01:00
Pieter Lexis
72e1c0b308 Add shell to machinectl ZSH completion 2020-03-27 18:15:15 +01:00
Anita Zhang
4047a411f4
Merge pull request #15186 from DaanDeMeyer/clangd-fix-wstring-plus-int
Silence Wstring-plus-int warning when using clangd with GCC.
2020-03-26 16:45:01 -07:00
Anita Zhang
c08323dcd1
Merge pull request #15236 from ssahani/br-follow-up
shared- bride util allign bridge_state_table
2020-03-26 16:27:33 -07:00
Susant Sahani
4c6a4a5bfe shared- bride util allign bridge_state_table 2020-03-26 19:43:58 +01:00
Yuri Chornoivan
6281c6e56c
po: update Ukrainian translation (#15228) 2020-03-26 18:45:41 +01:00
Zbigniew Jędrzejewski-Szmek
1ab2033804
Merge pull request #15224 from ssahani/geneve
networkctl: Display more geneve properties
2020-03-26 18:30:37 +01:00
David Edmundson
f0d0698f0b path-lookup: Use default value for XDG_CONFIG_DIRS if environment is not set
If XDG_CONFIG_DIRS is unset, the specification says we should assume
/etc/xdg.
2020-03-26 18:25:41 +01:00
Zbigniew Jędrzejewski-Szmek
a879b6d22f
Merge pull request #15214 from ssahani/networkctl-br1
network: Introduce bridge util
2020-03-26 17:51:29 +01:00
Zbigniew Jędrzejewski-Szmek
272a8864da
Merge pull request #15170 from keszybz/sd-bus-resolve-magic
sd-bus: resolve SD_BUS_DEFAULT_* in more places
2020-03-26 17:08:09 +01:00
Zbigniew Jędrzejewski-Szmek
ce4c73eb5d
Merge pull request #15209 from anitazha/moar-cgroup-utils
cgroup-utils: convenience helpers
2020-03-26 16:54:08 +01:00
Anita Zhang
a22e8850a8
Merge pull request #15191 from GiedriusS/feature/list-unit-files-return-1
systemctl: exit with 1 if no unit files found
2020-03-25 16:50:30 -07:00
Giedrius Statkevičius
eeb1542b5e systemctl: exit with 1 if no unit files found
Add a simple check on the number of unit files that were found: return
`-ENOENT` when none is found from the function and thus `systemctl`
consequently exits with `1` (`EXIT_FAILURE`) if none were found.

Verification:
```bash
root@image:~# systemctl list-unit-files dbus-nonexistant.service; echo
$?
UNIT FILE STATE VENDOR PRESET

0 unit files listed.
1
root@image:~# systemctl list-unit-files dbus.service; echo $?
UNIT FILE    STATE  VENDOR PRESET
dbus.service static enabled

1 unit files listed.
0
```

Fixes #15082.
2020-03-25 22:20:58 +02:00
Susant Sahani
e7b38d7d5c networkctl: Display more geneve preperties 2020-03-25 14:52:52 +01:00
Susant Sahani
3039cc0281 network: Introduce geneve util 2020-03-25 14:52:31 +01:00
Anita Zhang
baa358df32 cgroup-util: cg_get_xattr_malloc helper
`cg_get_xattr_malloc` to read a cgroup xattr value and allocate space
to hold said value (simple helper combining existing functions).
2020-03-24 16:06:32 -07:00
Anita Zhang
613328c3e2 cgroup-util: helper to cg_get_attribute and convert to uint64_t
A common pattern in the codebase is reading a cgroup memory value
and converting it to a uint64_t. Let's make it a helper and refactor a
few places to use it so it's more concise.
2020-03-24 16:05:16 -07:00
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
a8389a3307 networkctl: Use string table for bridge state 2020-03-24 14:22:59 +01:00
Susant Sahani
af94bb24b5 shared: Introduce bridge util 2020-03-24 14:22:50 +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
Balint Reczey
cdc6c95737 units: Don't mount tracefs in LXC
Mounting tracefs fails in unprivileged LXC containers and latest LXD
(3.23) bind mounts tracefs already.

Fixes https://github.com/lxc/lxd/issues/7059
2020-03-23 08:34:48 +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
ml
992622c428 man: fix typo in loader.conf(5) 2020-03-22 20:22:03 +01:00
Daan De Meyer
b0f4c02e2d sd-bus: Add sd_bus_send docs + cleanups. 2020-03-22 20:21:11 +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
Daan De Meyer
f455f8633e Silence Wstring-plus-int warning when using clangd with GCC. 2020-03-21 22:30:59 +01:00
Susant Sahani
be1af90585 network: DHCP lease load SIP copy paste error 2020-03-21 18:34:46 +01:00
Zbigniew Jędrzejewski-Szmek
f41df6954c sd-bus: whitespace adjustments 2020-03-19 21:38:46 +01:00