Commit graph

8155 commits

Author SHA1 Message Date
Lennart Poettering 4f4b92ba7a always check for __BYTE_ORDER == __BIG_ENDIAN when checking for endianess
Let's always stick to glibc's way to determine byte order, and not mix
autoconf-specific checks with gcc checks.
2014-07-11 15:56:16 +02:00
Lennart Poettering ce0f1493c3 hostnamed: introduce new location machin-info field, too 2014-07-11 15:50:32 +02:00
Lennart Poettering 1e5b1aaa4c hostnamed: drop nss-myhostname check
The check only cares about whether the module is installed, not enabled.
But installation we should know anyway, after all we ship the module
with systemd these days...
2014-07-11 15:38:17 +02:00
Lennart Poettering c2142cf1d1 hostnamed: make use of in_charset() to verify charset 2014-07-11 15:37:11 +02:00
Lennart Poettering d4c9895d93 nss-myhostname: simplify array building a bit 2014-07-11 15:35:22 +02:00
Lennart Poettering d77ab3f7e3 hostnamed: minor modernization 2014-07-11 15:35:22 +02:00
Lennart Poettering 46b131574f journald: turn ForwardToSyslog= off by default
After all, rsyslog and friends nowadays read their data directly from
the journal, hence the forwarding is unnecessary in most cases.
2014-07-11 15:34:40 +02:00
Zbigniew Jędrzejewski-Szmek 1cb1767a29 util: fix has cc check and add test 2014-07-11 09:22:01 -04:00
Jóhann B. Guðmundsson 799298d651 Add DEPLOYMENT to hostnamectl
[zj: remove the check against a fixed list of environments.]
2014-07-11 09:22:01 -04:00
Zbigniew Jędrzejewski-Szmek 938a560b76 sysusers: allow overrides in /etc and /run
An administrator might want to block a certain sysusers config file from
being executed, e.g. to block the creation of a certain user.

Only a relatively short description is added in the man page, since
overrides should be relatively rare.
2014-07-10 22:51:41 -04:00
Lennart Poettering cabb0bc6b1 nss-mymachines: add new NSS module for automatically resolving addresses of all local containers 2014-07-11 03:15:21 +02:00
Lennart Poettering 2de30868ed build-sys: export sd_path APIs 2014-07-11 03:13:24 +02:00
Lennart Poettering c9fdc26e96 nss-myhostname: move NSS boilerplate to nss-util.h 2014-07-10 23:33:55 +02:00
Lennart Poettering f48e75cb9a machinectl: show network interface name for containers
Also, append the if indexes as scope field to the addresses we show.
That way they may be used for connecting to the containers directly.
2014-07-10 23:12:32 +02:00
Lennart Poettering 5aa4bb6b5b nspawn: register external network interface with machined 2014-07-10 22:48:30 +02:00
Lennart Poettering 9b5ed6feda machined: allow registering host-side network interfaces for communication with containers 2014-07-10 22:47:55 +02:00
Lennart Poettering 4faefc7ff8 networkd: always prefer dhcp routes over ipv4ll routes 2014-07-10 21:32:44 +02:00
Lennart Poettering 496a5a6970 machined: when querying addresses of a container, use same code as nss-myhostname uses 2014-07-10 21:27:14 +02:00
Lennart Poettering 3cb4674019 libsystemd: make use of our common sockaddr_union everywhere 2014-07-10 21:16:40 +02:00
Lennart Poettering 3b653205cf shared: split out in_addr related calls from socket-util.[ch] into its private in-addr-util.[ch]
These are enough calls for a new file, and they are sufficiently
different from the sockaddr-related calls, hence let's split this out.
2014-07-10 21:15:26 +02:00
Lennart Poettering e80af1bddd nss-myhostname: move local address listing logic into shared, so that we can make use of it from machined 2014-07-10 21:01:25 +02:00
Lennart Poettering 947127ff62 nss-myhostname: only export the NSS entry point symbols, nothing else 2014-07-10 20:38:07 +02:00
Lennart Poettering bb62fb68f6 machined: various modernizations when enumerating container addresses 2014-07-10 20:25:21 +02:00
Lennart Poettering 47efffc22b nss-myhostname: following the usual naming scheme for .c/.h files 2014-07-10 20:25:21 +02:00
Lennart Poettering 5502f0d971 nss-myhostname: various modernizations 2014-07-10 20:12:34 +02:00
Lennart Poettering 096b677388 resolved: properly free network monitor 2014-07-10 20:12:34 +02:00
Lennart Poettering 1389925348 event: pull in sd-event.h from event-util.h 2014-07-10 20:12:34 +02:00
Lennart Poettering 38c74dad1c sysusers: don't allow control characters in gecos fields 2014-07-09 19:22:13 +02:00
Lennart Poettering 932ad62b84 sysusers: don't allow user names longer than UT_NAMESIZE
As pointed out by Miloslav Trmač it might be a good idea to make sure
that usernames stay with in the utmp-defined limits.
2014-07-09 19:22:13 +02:00
Kay Sievers b72ddf0f4f timedated: manage systemd-timesyncd directly instead of lists of alternatives
Alternative NTP implementations should add a:
  Conflicts=systemd-timesyncd.service
to take over the built-in NTP functionality of systemd.
2014-07-09 17:04:11 +02:00
Lennart Poettering c49e59c183 hostnamed: add a new chassis type for watches 2014-07-09 13:20:05 +02:00
Jon Severinsson 1930eed2a7 journal/compress: improve xz compression performance
The new lzma2 compression options at the top of compress_blob_xz are
equivalent to using preset "0", exept for using a 1 MiB dictionary
(the same as preset "1"). This makes the memory usage at most 7.5 MiB
in the compressor, and 1 MiB in the decompressor, instead of the
previous 92 MiB in the compressor and 8 MiB in the decompressor.

According to test-compress-benchmark this commit makes XZ compression
20 times faster, with no increase in compressed data size.
Using more realistic test data (an ELF binary rather than repeating
ASCII letters 'a' through 'z' in order) it only provides a factor 10
speedup, and at a cost if a 10% increase in compressed data size.
But that is still a worthwhile trade-off.

According to test-compress-benchmark XZ compression is still 25 times
slower than LZ4, but the compressed data is one eighth the size.
Using more realistic test data XZ compression is only 18 times slower
than LZ4, and the compressed data is only one quarter the size.

$ ./test-compress-benchmark
XZ: compressed & decompressed 2535300963 bytes in 42.30s (57.15MiB/s), mean compresion 99.95%, skipped 3570 bytes
LZ4: compressed & decompressed 2535303543 bytes in 1.60s (1510.60MiB/s), mean compresion 99.60%, skipped 990 bytes
2014-07-08 23:16:21 -04:00
Ronny Chevalier 92261977d8 fix #ifdef 2014-07-08 23:15:07 -04:00
Bastien Nocera a545c6e1aa accelerometer: Don't wait for new data from the sensor
Instead of waiting for new data from the sensor, which might be
a long time coming, depending on the sensor device, ask the kernel
for the last state for that particular input device.
2014-07-08 18:36:53 +02:00
Michal Schmidt 9a8c867fec load-fragment: ConditionFirstBoot wants a bool string, not a path 2014-07-08 17:22:34 +02:00
Michal Schmidt b7bbdabeb4 systemctl: fix visual alignment for lines prefixed with color dots 2014-07-08 17:22:34 +02:00
David Herrmann 154034270c logind: allow switching to unused VTs via SwitchTo()
If compositors use the new SwitchTo() logic to map F1-F12, we should allow
them to switch to unregistered VTs, too. Otherwise, the auto-spawn logic
of gettys won't trigger.

Reported-by: Jasper St. Pierre <jstpierre@mecheye.net>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-07-08 12:56:55 +02:00
Zbigniew Jędrzejewski-Szmek 061df014fd Fix typo 2014-07-07 18:36:55 -04:00
Zbigniew Jędrzejewski-Szmek 126cc76074 fstab-generator: fix trivial leak 2014-07-07 18:36:55 -04:00
Zbigniew Jędrzejewski-Szmek 1ec7120e50 journal/compress: fix calls to decompress_blob 2014-07-07 18:36:55 -04:00
Lennart Poettering c92e531c82 resolved: make use of union in_addr_union in resolved, too 2014-07-07 23:11:48 +02:00
Lennart Poettering 186fe1db20 networkd: simplify signal handling of SIGTERM/SIGINT
sd-event makes handling SIGTERM/SIGINT a lot easier than it used to,
let's make use of this
2014-07-07 23:11:03 +02:00
Lennart Poettering b9e7a9d870 resolved: make sure SIGTER/SIGINT actually can be caught and processed 2014-07-07 23:09:02 +02:00
Lennart Poettering 987d561fe2 resolved: let config_parse() open the configuration file for us 2014-07-07 23:03:17 +02:00
Lennart Poettering de48d5ab62 shared: fix format string for usec_t type 2014-07-07 22:49:59 +02:00
Lennart Poettering a1948c7bfe escape: beef up new systemd-escape tool
Add various options for making it easy unescape, or mangle, or format as
template instance or append a suffix.
2014-07-07 22:23:42 +02:00
Michael Biebl b1a5a9989a add new systemd-escape tool 2014-07-07 22:23:42 +02:00
Thomas Hindoe Paaboel Andersen f5a4b0d353 dropin: add format attribute and fix a wrong caller 2014-07-07 22:20:56 +02:00
Zbigniew Jędrzejewski-Szmek 36a259d22c fstab-generator: add comma when removed option is in the middle
xxx,x-systemd.default-timeout=y,zzz was filtered to xxxzzz,
but should be xxx,zzz, of course.
2014-07-07 16:11:41 -04:00
Susant Sahani fe8ac65b68 networkd: add support for mode
This patch adds supports networkd to configure bond mode
during creation via persistent conf. Mode can be configured
with conf param 'Mode'. A new section Bond is added to the
conf to support bond mode.

These modes can be configured now.

balance-rr
active-backup
balance-xor
broadcast
802.3ad
balance-tlb
balance-alb

Example conf file: test-bond.conf
[NetDev]
Name=bond1
Kind=bond

[Bond]
Mode=balance-xor

Test case:
1. start networkd service:

12: bond1: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc
noqueue state UNKNOWN mode DEFAULT group default
link/ether 22:89:6c:47:23:d2 brd ff:ff:ff:ff:ff:ff

2. find bond mode:

cat /proc/net/bonding/bond1
    Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
    Bonding Mode: load balancing (xor)
    Transmit Hash Policy: layer2 (0)
    MII Status: up
    MII Polling Interval (ms): 0
    Up Delay (ms): 0
    Down Delay (ms): 0

Changes:
       1. Added file networkd-bond.c
       2. Bond mode enum BondMode
       3. conf section [Bond]

[tomegun: whitespace]
2014-07-07 21:52:01 +02:00
Susant Sahani 948a6f8eb4 networkd veth: Make kind assert
It's more appropriate to make it's assert than -ENOTSUP
2014-07-07 21:49:14 +02:00
Lennart Poettering e26807239b firstboot: get rid of firstboot generator again, introduce ConditionFirstBoot= instead
As Zbigniew pointed out a new ConditionFirstBoot= appears like the nicer
way to hook in systemd-firstboot.service on first boots (those with /etc
unpopulated), so let's do this, and get rid of the generator again.
2014-07-07 21:05:09 +02:00
Lennart Poettering 45035609fc firstboot: follow lock protocol when changing /etc/shadow 2014-07-07 18:57:09 +02:00
Harald Hoyer 30d7c9c472 base-filesystem.c: terminate string array elements with \0
NULSTR_FOREACH() looks for a terminating zero and the element also needs
one.
2014-07-07 17:51:53 +02:00
Lennart Poettering 8cfdb077b8 service: flush status text and errno values each time a service is started
We shouldn't show status texts from previous service starts
2014-07-07 17:33:46 +02:00
Lennart Poettering b4af5a803a systemctl: show StatusErrno value in "systemctl status" 2014-07-07 17:33:26 +02:00
Lennart Poettering 2040ccf171 service: don't accept negative ERRNO= notification messages 2014-07-07 17:32:44 +02:00
Lennart Poettering 5e56b378b4 service: minor modernization 2014-07-07 17:03:34 +02:00
Miguel Angel Ajo 4774e35726 core: Added support for ERRNO NOTIFY_SOCKET message parsing, and added StatusErrno dbus property along StatusText to allow notification of numeric status condition while degraded service operation or any other special situation. 2014-07-07 17:01:25 +02:00
Lennart Poettering 3250929b70 firstboot: change /etc/shadow access mode to 000
It appears to be customary to remove all access bits from /etc/shadow
including those for the root owner), hence let's do the same.
2014-07-07 16:55:08 +02:00
Michal Sekletar ffc90a1196 dhcp-network: make clear that we are ANDing Fragment offset field with mask
Reading BPF assembly written as C macros is inherently difficult. Don't
make it harder than necessary and provide clearer explanation in the
comment.
2014-07-07 15:59:13 +02:00
Michal Sekletar b064329fd8 dhcp-network: ignore IP packets with More Fragments (MF) flag set
We already ignore IP fragments, because we expect that Fragment
offset (FO) field is not set. However first fragment in a fragmented IP
flow will have all zeroes in FO field. We should ignore such packet as
well, thus we need to look at MF flag in the IP header. Checking MF flag
will filter out all except last packet in fragmented flows. Last one
will be ruled out by next check for value of FO.
2014-07-07 15:32:12 +02:00
Lennart Poettering 418b9be500 firstboot: add new component to query basic system settings on first boot, or when creating OS images offline
A new tool "systemd-firstboot" can be used either interactively on boot,
where it will query basic locale, timezone, hostname, root password
information and set it. Or it can be used non-interactively from the
command line when prepareing disk images for booting. When used
non-inertactively the tool can either copy settings from the host, or
take settings on the command line.

$ systemd-firstboot --root=/path/to/my/new/root --copy-locale --copy-root-password --hostname=waldi

The tool will be automatically invoked (interactively) now on first boot
if /etc is found unpopulated.

This also creates the infrastructure for generators to be notified via
an environment variable whether they are running on the first boot, or
not.
2014-07-07 15:25:55 +02:00
Lennart Poettering 037c26d0ae architecture: add string table entries for mips-le archs which were missing 2014-07-07 15:25:55 +02:00
Lennart Poettering 736937e5aa fileio: simplify write_env_file() 2014-07-07 15:25:55 +02:00
Lennart Poettering 6294aa76d8 util: don't consider tabs special in string_has_cc() anymore
Instead, take a list of exceptions to our usual CC check
2014-07-07 15:25:55 +02:00
Lennart Poettering 7568345034 shared: make timezone and locale enumeration and validation generic
This way we can reuse it other code thatn just localectl/localed +
timedatectl/timedated.
2014-07-07 15:25:55 +02:00
Lennart Poettering 3408ba015a main: explain our /etc empty check a bit in a comment 2014-07-07 15:25:55 +02:00
Lennart Poettering 3a8a916338 util: consider 0x7F a control chracter (which it is: DEL)
Let's better be safe than sorry.
2014-07-07 15:25:55 +02:00
Tom Gundersen a669ea9860 udev: link_config - ignore errors due to missing MAC address
Otherwis, we get misleading error messages on links with MACs.

Reported by Leonid Isaev.
2014-07-07 15:03:12 +02:00
Zbigniew Jędrzejewski-Szmek 3dde3f8197 vconsole-setup: fix inverted error messages
Introduced in abee28c56d.

Pointed-out-by: Werner Fink <werner@suse.de>
2014-07-07 08:55:58 -04:00
Tom Gundersen e04468dec0 networkd: netdev - add missing refs
Without this, the underlying device would get freed (and hence
fail).
2014-07-07 14:18:33 +02:00
Susant Sahani c081882f07 networkd: add support for peer address
This patch adds peer address support for
networkd . In the  [Address]  a new configurable
param is Peer.

[Match]
Name=ipip-tun

[Address]
Address=10.0.0.1/32
Peer=10.0.0.2/32
2014-07-07 13:32:14 +02:00
Michal Sekletar 58587a7a0c dhcp-network: add check for DHCP.chaddr
Check that received DHCP packets actually include our MAC address in
chaddr field. BPF interpreter has 32 bit wide registers but MAC address
is 48 bits long so we have to do check in two steps.
2014-07-07 12:17:55 +02:00
Zbigniew Jędrzejewski-Szmek 31cda3d175 coredumpctl: show a useful error on permission problems 2014-07-06 19:06:03 -04:00
Zbigniew Jędrzejewski-Szmek fd53fee04b compress: add benchmark-style test
This is useful to test the behaviour of the compressor for various buffer
sizes.

Time is limited to a minute per compression, since otherwise, when LZ4
takes more than a second which is necessary to reduce the noise, XZ
takes more than 10 minutes.

% build/test-compress-benchmark (without time limit)
XZ: compressed & decompressed 2535300963 bytes in 794.57s (3.04MiB/s), mean compresion 99.95%, skipped 3570 bytes
LZ4: compressed & decompressed 2535303543 bytes in 1.56s (1550.07MiB/s), mean compresion 99.60%, skipped 990 bytes

% build/test-compress-benchmark (with time limit)
XZ: compressed & decompressed 174321481 bytes in 60.02s (2.77MiB/s), mean compresion 99.76%, skipped 3570 bytes
LZ4: compressed & decompressed 2535303543 bytes in 1.63s (1480.83MiB/s), mean compresion 99.60%, skipped 990 bytes

 It appears that there's a bug in lzma_end where it leaks 32 bytes.
2014-07-06 19:06:03 -04:00
Zbigniew Jędrzejewski-Szmek d89c8fdf48 journal: add LZ4 as optional compressor
Add liblz4 as an optional dependency when requested with --enable-lz4,
and use it in preference to liblzma for journal blob and coredump
compression. To retain backwards compatibility, XZ is used to
decompress old blobs.

Things will function correctly only with lz4-119.

Based on the benchmarks found on the web, lz4 seems to be the best
choice for "quick" compressors atm.

For pkg-config status, see http://code.google.com/p/lz4/issues/detail?id=135.
2014-07-06 19:06:03 -04:00
Zbigniew Jędrzejewski-Szmek 5e592c66bd journal/compress: return early in uncompress_startswith
uncompress_startswith would always decode the whole stream, even
if it did not start with the given prefix.

Reallocation policy was also strange.
2014-07-06 19:06:02 -04:00
Zbigniew Jędrzejewski-Szmek abee28c56d vconsole-setup: run setfont before loadkeys
https://bugs.freedesktop.org/show_bug.cgi?id=80685
2014-07-06 19:06:02 -04:00
Ronny Chevalier bce415edca sysusers: fix uninitialized warning 2014-07-06 14:16:16 +02:00
Tom Gundersen f14aa1f1b2 machine: don't return uninitialized variable
Repotred by Ronny Chevalier
2014-07-06 14:12:28 +02:00
Steven Noonan c38d2eb828 networkd: accept section DHCP in systemd.network files 2014-07-04 11:34:43 +02:00
Steven Noonan b1e1238fb3 networkd: don't clear dhcpv6 lease timers if there's no previous lease
If client->lease is NULL, dhcp6_lease_clear_timers will cause a segmentation
fault.
2014-07-04 11:34:43 +02:00
Lennart Poettering 4d9f07b492 nspawn: add new --volatile switch for booting containers in volatile (ephemeral) mode
Two modes are supported: --volatile=yes mounts only /usr into the
container, and a tmpfs as root directory. --volatile=state mounts the
full OS tree in, but overmounts /var with a tmpfs.

--volatile=yes hence boots with an unpopulated /etc and /var, starting
with pristine configuration and state.

--volatile=state hence boots with an unpopulated /var, only starting
with pristine state.
2014-07-04 03:24:42 +02:00
Lennart Poettering baa1bdf70f main: change check whether /etc is unpopulated to look for /etc/machine-id
Previously, we checked whether /etc was completely empty. This makes it
difficult though for container managers such as nspawn to install a
small number of files (such as /etc/timezone), and have the system
otherwise populate its own tree.

Hence, change this by looking for /etc/machine-id, which should be a
good sign whether /etc is populated or not.
2014-07-04 03:24:42 +02:00
Tom Gundersen 4958aee497 networkd: properly track addresses when first added
When doing a NEWADDR, the reply we get back is the NEWADDR itself, rather
than just an empty ack (unlike how NEWLINK works). For this reason, the
process that did the NEWADDR does not get the broadcast message.

We were only listening for broadcast messages, and hence not tracking the
addresses we added ourselves. This went unnoticed as the kernel will usually
send NEWADDR messages from time to time anyway, so things would mostly work,
but in the worst case we would not notice that a routable address was available
and consider ourselves offline.
2014-07-03 22:55:05 +02:00
Tom Gundersen 393c0c5e64 networkd: link - improve link tracking logging 2014-07-03 22:55:05 +02:00
Lennart Poettering bc4bc52bc3 architecture: remove "cris" from uname list
the only correct name appears to be "crisv32"...

http://lists.freedesktop.org/archives/systemd-devel/2014-July/020899.html
2014-07-03 22:52:44 +02:00
Umut Tezduyar Lindskog 0c74488672 sd-path: add missing header 2014-07-03 16:41:52 -04:00
Lennart Poettering 8d90c8a8d6 machine: properly distuingish created and registered machines 2014-07-03 20:19:58 +02:00
Lennart Poettering a12b0cc34d sysusers: add new line type "m" to add users as members to groups 2014-07-03 19:54:46 +02:00
Lennart Poettering 717603e391 machinectl: show /etc/os-release information of container in status output 2014-07-03 17:54:24 +02:00
Lennart Poettering 664064d60c namespace: make sure /tmp, /var/tmp and /dev are writable in namespaces we set up 2014-07-03 16:28:26 +02:00
Lennart Poettering 002b226843 namespace: fix uninitialized memory access 2014-07-03 16:28:26 +02:00
Lennart Poettering 579af51964 architecture: also add tuples for old ARM BE ABI 2014-07-03 15:59:32 +02:00
Zbigniew Jędrzejewski-Szmek 2a9899d862 architecture: add tuple for old arm abi
I don't have suitable hardware at hand, so this is based
on debian documentation:

https://wiki.debian.org/ArmEabiPort#GCC_preprocessor_macros_for_floating_point
2014-07-03 09:54:05 -04:00
Lennart Poettering c3a07d946b test: print library tuple in test 2014-07-03 15:50:57 +02:00
Lennart Poettering 0881d7af14 shared: add LIB_ARCH tuples for BE ARM archs 2014-07-03 15:50:53 +02:00
Lennart Poettering 55ebf98cbe core: introduce exit_status_set_is_empty() to make things a bit easier to read 2014-07-03 15:50:31 +02:00
Lennart Poettering 613e3a26c1 shared: rename ARCH_TUPLE to LIB_ARCH_TUPLE
This is really just about library locations, hence clarify that we don't
assume this to be anything but that.
2014-07-03 15:40:14 +02:00