1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-08 11:27:32 +03:00
Commit Graph

8183 Commits

Author SHA1 Message Date
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
Lennart Poettering
3e2d435b3d exit-status: rename ExitStatusSet's "code" field to "status"
We should follow the naming scheme waitid() uses, not come up with our
own reversed one...
2014-07-03 15:37:46 +02:00
Zbigniew Jędrzejewski-Szmek
fd3b401e5d architecture: add tuples for arm 2014-07-03 09:03:16 -04:00
Umut Tezduyar Lindskog
9b3a0ba3e9 arch: add crisv32 to uname check 2014-07-03 12:51:33 +02:00
Lennart Poettering
ce38dbc84b nspawn: when running in a service unit, use systemd for restarts
THis way we can remove cgroup priviliges after setup, but get them back
for the next restart, as we need it.
2014-07-03 12:51:07 +02:00
Lennart Poettering
206e7a5f7b machined: don't force terminate registered machines
When a machine is registered in machined with CreateMachine it is OK to
kill the machine when it is terminated, but when an existing unit is
simply registered via RegisterMachine we shouldn't do that, as the unit
is controlled by somebody else.
2014-07-03 12:51:07 +02:00
Lennart Poettering
37520c1bec core: introduce new RestartForceExitStatus= service setting
This does the inverse of RestartPreventExitStatus=: it forces a restart
of a service when a certain exit status is returned by a service
process.
2014-07-03 12:51:07 +02:00
Tom Gundersen
ffd488e272 networkd: tuntap - default to no packet information
Susant says:
> ip tuntap turns this off by default.

Let's follow ip(8) here as that should be the least surprising.
2014-07-03 12:19:26 +02:00
Susant Sahani
853284abdd networkd vxlan: Pass correct type
The group argument is a union. We need to
pass the correct type
2014-07-03 11:39:12 +02:00
Tom Gundersen
63dadd9075 networkd: tuntap - enable PacketInfo by default 2014-07-03 11:37:54 +02:00
Tom Gundersen
6ef892fc05 networkd: netdev - move tunnel address parsing to networkd-tunnel.c 2014-07-03 11:00:36 +02:00
Tom Gundersen
4826dd6850 networkd: tunnels - make tunnel address parsing generic
It had a bug in the typing, fix that and also make it save the address family so we
can print proper error messages.
2014-07-03 11:00:36 +02:00
Susant Sahani
30ae9dfda3 networkd: Introduce tun/tap device
This patch introduces TUN/TAP device creation support
to networkd.

Example conf to create a tap device:

file: tap.netdev
------------------
[NetDev]
Name=tap-test
Kind=tap

[Tap]
OneQueue=true
MultiQueue=true
PacketInfo=true
User=sus
Group=sus
------------------

Test:
1. output of ip link
tap-test: tap pi one_queue UNKNOWN_FLAGS:900 user 1000 group 1000

id:
uid=1000(sus) gid=10(wheel) groups=10(wheel),1000(sus)
context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

Modifications:

Added:
1. file networkd-tuntap.c
3. netdev kind NETDEV_KIND_TUN and NETDEV_KIND_TAP
2. Tun and Tap Sections and config params to parse
   conf and gperf conf parameters

[tomegun: tweak the 'kind' checking for received ifindex]
2014-07-03 11:00:02 +02:00
Tom Gundersen
866ee36822 udev: net_setup_link - add a bit more logging 2014-07-03 11:00:02 +02:00
Tom Gundersen
ad0774e61e networkd: netdev - drop the link callbacks after calling them once
We should never call them again, so make sure they are cleaned up correctly.
2014-07-03 11:00:01 +02:00
Tom Gundersen
563c69c6b2 networkd: netdev - take ref immediately after calling out
Keeping the refcounting next to the sd_bus_call_async() makes it easier to check.
2014-07-03 11:00:01 +02:00
Tom Gundersen
0372cb2bd2 networkd: split out vlan and macvlan handling 2014-07-03 11:00:01 +02:00
Lennart Poettering
620a687cd2 sd-login: use the same code for verfiying machine names everywhere 2014-07-03 01:19:26 +02:00
Lennart Poettering
db9bb83fa5 bus: close a bus that failed to connect 2014-07-03 01:19:21 +02:00
Lennart Poettering
7f0d207d2c sd-bus: support connecting to remote hosts, directly into containers
systemctl -H root@foobar:waldi

will now show a list of services running on container "waldi" on host
"foobar", using "root" for authenticating at "foobar".

Since entereing a container requires priviliges, this will only work
correctly for root logins.
2014-07-03 01:17:26 +02:00
Lennart Poettering
7bb4d371af sd-bus: when an event loop terminates, explicitly close the bus
This makes sure we actually release the bus and all the messages it
references.
2014-07-02 17:36:47 +02:00
Lennart Poettering
b5eca3a205 bus: drop bus/message GC logic
When a caller drops all references to a bus and its messages while the
messages where still queue, this causes the bus to reference the
messages, and the messages to reference the bus, without anybody else
keeping a reference, which is something we so far considered a leak, and
tried to fix with a GC logic that would recognize cases like this, and
drop the reference.

This GC logic has been broken sofar, and remained unfixed. This commit
removes it altogther, replacing it with nothing. The rationale is that
simply because all refs to the bus have been dropped its queued messages
should *still* be written to the bus, even if the caller doesn't retain
any reference to either bus nor message. This means it was actually
wrong to attempt to clean up the bus in this case.

The proper way how applications should handle this is by explicitly
invoking sd_bus_close(), when they want busses to go away. This is
probably want they want to do anyway to avoid getting spurious
callbacks after they stopped using a bus.
2014-07-02 17:29:09 +02:00
Lennart Poettering
62bb05f64f bus-proxy: restore operation in non-kdbus mode
bus-proxyd is not only the bridge between legacy dbus clients and kdbus
but is also used to access remote dbus servers via ssh. Let's make sure
it actually works for that.
2014-07-02 17:12:24 +02:00
Michal Sekletar
387066c2e5 localed: consider an unset model as a wildcard 2014-07-02 16:11:50 +02:00
Tom Gundersen
5e91345094 sd-dhcp6-client: initialize variable 2014-07-02 15:54:27 +02:00
Lennart Poettering
01d4590b77 udev: net_setup_link builtin should print the reason why something fails
Let's tell users what is going wrong.
2014-07-02 15:13:29 +02:00
Lennart Poettering
e0a33e7ba6 util: when unescaping strings, don't allow smuggling in of additional NUL bytes
Better safe than sorry.
2014-07-02 13:45:49 +02:00
Lennart Poettering
fecc80c1ba util: generalize is_localhost() and use it everywhere where applicable 2014-07-02 13:41:31 +02:00
Lennart Poettering
9a00f57a5b path: add new "systemd-path" utility for querying paths described in file-hierarchy(7)
This new tool is based on "sd-path", a new (so far unexported) API for
libsystemd, that can hopefully grow into a workable API covering /opt
and more one day.
2014-07-02 12:23:36 +02:00
Thomas Hindoe Paaboel Andersen
cd4ba18a84 coredump: vacuum - fix calculation of 10% of fs size for MaxUse 2014-07-01 23:49:56 +02:00
Thomas Hindoe Paaboel Andersen
926695f1b5 sd-dhcp6-client: check return value
Checking the return values seems to have been forgotten in
ed6ee21953
2014-07-01 23:46:51 +02:00
Filipe Brandenburger
72165d6191 networkd: fix alignment of gperf source 2014-07-01 23:44:27 +02:00
Tom Gundersen
9e358851b4 networkd: netdev - add dummy support 2014-07-01 22:10:07 +02:00
Eugene Yakubovich
4cc7a82c94 networkd: send hostname to dhcp server
Send hostname (option 12) in DISCOVER and REQUEST messages so the
DHCP server could use it to register with dynamic DNS and such.

To opt-out of this behaviour set SendHostname to false in [DHCP]
section of .network file

[tomegun: rebased, made sure a failing set_hostname is a noop and moved
          config from DHCPv4 to DHCP]
2014-07-01 22:02:25 +02:00
Tom Gundersen
8900367cd2 networkd: netdev - take ref when creating netdevs
We were doing this correctly for when the callback takes the Link object, but
must also do it for the cases it takes the NetDev object.
2014-07-01 20:33:30 +02:00
Kay Sievers
f841a154ef parse_uid: return -ENXIO for -1 uids 2014-07-01 16:00:05 +02:00
Thadeu Lima de Souza Cascardo
3058e017fc Use dev_port for the ID of a network device.
For network devices on the same PCI function, dev_id should not be used,
since its purpose is for IPv6 support on interfaces with the same MAC
address.

The new dev_port sysfs attribute should be used instead of dev_id.
2014-07-01 15:19:20 +02:00
Tom Gundersen
856f962c7a networkd: link - don't fail if master netdev already exists
This allows restarts to work gracefully.
2014-07-01 13:30:23 +02:00
Tom Gundersen
d5b3d845f0 networkd: tunnel - ensure that enslave callback is always invoked
The Link statemachine relies on this, as it would otherwise wait forever. Hook up the tunnels in the
same way as the other NetDev's.
2014-07-01 12:55:19 +02:00
Tom Gundersen
1a941ac4b6 networkd: link - ignore missing MAC address
Currently DHCP/IPv4LL only works on ethernet devices, but no reason not to otherwise
manage them.
2014-07-01 12:55:05 +02:00
Kay Sievers
afc3f9cb24 base-filesystem: avoid all searching if the link already exists 2014-07-01 12:25:38 +02:00
Kay Sievers
3fd165e53a base-filesystem: explicitely check existence of the platform's ABI dynamic loader 2014-07-01 12:12:40 +02:00
Kay Sievers
e1ae9755ab base-filesystem: create /lib64 symlink to libdir /usr directory 2014-07-01 11:46:12 +02:00
Susant Sahani
0099bc15f1 networkd: address_acquire use cleanup macro
use cleanup macro for Address na

[tomegun: dropped unneccessary braces]
2014-07-01 10:38:07 +02:00
Susant Sahani
8469c1d329 networkd: netdev add one separate line 2014-07-01 10:35:42 +02:00
Tom Gundersen
28aeb07f55 networkd: link - drop assert from _free()
_free() should always succeed, even if object is not fully allocated.
2014-07-01 10:30:37 +02:00
Tom Gundersen
54d61deb7b sd-dhcp6-client: fix free before use 2014-07-01 10:21:18 +02:00
Tom Gundersen
5da8149fd3 networkd: link - improve refcounting
We failed to take a ref when waiting for udev synchronization. Fix that and also
make unreffing in callbacks simpler throughout by using _cleanup_ macros.

Fixes <https://bugs.freedesktop.org/show_bug.cgi?id=80556>.
2014-07-01 10:21:18 +02:00
Zbigniew Jędrzejewski-Szmek
8eea868708 cryptsetup: allow x-systemd.device-timeout
https://bugs.freedesktop.org/show_bug.cgi?id=54210
2014-06-30 18:41:17 -04:00
Zbigniew Jędrzejewski-Szmek
b3208b6629 fstab-generator: allow x-systemd.device-timeout for swap units 2014-06-30 18:39:45 -04:00
Zbigniew Jędrzejewski-Szmek
2968644080 Move x-systemd-device.timeout handling from core to fstab-generator
Instead of adjusting job timeouts in the core, let fstab-generator
write out a dropin snippet with the appropriate JobTimeout.
x-systemd-device.timeout option is removed from Options= line
in the generated unit.

The functions to write dropins are moved from core/unit.c to
shared/dropin.c, to make them available outside of core.

generator.c is moved to libsystemd-label, because it now uses
functions defined in dropin.c, which are in libsystemd-label.
2014-06-30 18:39:45 -04:00
Lennart Poettering
ded21b6de3 pc: no longer expose exec_prefix in .pc file
There's little reason to export this, so let's drop it to minimize the
file a bit.
2014-06-30 23:19:00 +02:00
Lennart Poettering
d4e85aac0b pc: expose more drop-in dirs in the .pc file 2014-06-30 23:19:00 +02:00
Lennart Poettering
eb39a6239c pc: export $libdir in the .pc file
This is useful for code that tries to figure out the primary arch's
$libdir on the local system, given that is different on the various
Linuxes.
2014-06-30 23:19:00 +02:00
Lennart Poettering
28650077f3 nspawn: block open_by_handle_at() and others via seccomp
Let's protect ourselves against the recently reported docker security
issue. Our man page makes clear that we do not make any security
promises anyway, but well, this one is easy to mitigate, so let's do it.
While we are at it block a couple of more syscalls that are no good in
containers, too.
2014-06-30 16:22:12 +02:00
Lennart Poettering
840295fc1e nspawn: let's avoid using goto to wildly for non-cleanup purposes 2014-06-30 15:20:59 +02:00
Lennart Poettering
ce9f1527b6 nspawn: simplify exit condition check 2014-06-30 15:19:00 +02:00
Luke Shumaker
8baaf7a3d8 nspawn: log a warning on failure from wait_for_terminate()
This is at the suggestion of Djalal Harouni on the mailing list, and
reflects the behavior of shared/util.c:wait_for_terminate_and_warn().
2014-06-30 15:13:53 +02:00
Luke Shumaker
6d416b9cc8 nspawn: Fix regression with exit status
Commit 113cea8 introduced a bug that caused the exit code of systemd-nspawn
to not reflect the exit code of the program executed in the container.
2014-06-30 15:13:47 +02:00
Luke Shumaker
0659e8baf2 shared/util.c:wait_for_terminate_and_warn(): Add a comment on the return values 2014-06-30 15:13:34 +02:00
Tom Gundersen
3e53303ea6 networkd: dhcp - use same metric for all DHCP-related routes 2014-06-30 13:06:33 +02:00
Lennart Poettering
6afeb1cfe4 util: fix comment 2014-06-30 12:41:26 +02:00
Ronny Chevalier
6dbfd10471 tests: add missing XDG_RUNTIME_DIR env variable
Otherwise the test fails because specifier_runtime() returns -ENOTSUP
when XDG_RUNTIME_DIR is not set.
2014-06-30 12:40:47 +02:00
Lennart Poettering
306a55c863 util: refuse considering UID 0xFFFF and 0xFFFFFFFF valid 2014-06-29 22:27:07 +02:00
Tom Gundersen
69f08c8338 network-internal: initialize _cleanup_ variable 2014-06-29 22:26:06 +02:00
Susant Sahani
31db01208b netowrkd:deserialize_dhcp_routes verify strndup ret
strndup need to be chcked
2014-06-29 22:22:35 +02:00
Tom Gundersen
46ba9fbae2 networkd: dhcp - update the lifetime of an existing address
The logic otherwise is that we leave anything preconfigured alone, but in the case of DHCP
we actually need to update it whenever the lease is renewed.
2014-06-29 17:01:23 +02:00
Tom Gundersen
fb41e6d7c6 sd-dhcp-client: don't fail hard if UDP socket can not be bound
Even if we cannot renew the lease at T1, we will likely succeed at T2, so warn and ignore the failure.

This could happen if for whatever reason the received address is not yet configured, or it has
been lost.
2014-06-29 16:42:43 +02:00
Tom Gundersen
b16665806a networkd: improve DHCP error logging 2014-06-29 16:34:43 +02:00
Tom Gundersen
fb6730c498 networkd: set static addresses immediately
Don't wait for IPv4LL nor DHCP to finish before setting statically configured addresses.
2014-06-29 15:18:21 +02:00
Eugene Yakubovich
e1ea665eda Add support for DHCP static route options
This adds support for DHCP options 33 and 121: Static Route and
Classless Static Route. To enable this feature, set UseRoutes=true
in .network file. Returned routes are added to the routing table.
2014-06-29 15:18:21 +02:00
Tom Gundersen
ed942a9eb2 networkd: merge DHCPv4 and DHCPv6 config
If there are v4 or v6 specific options we can keep those in separate sections,
but for the common options, we will use only one.

Moreovere only use DHCP=[yes/both|no/none|v4|v6] to enable or disable the clients.
2014-06-29 15:18:21 +02:00
Patrik Flykt
68ceb9df6a sd-dhcp-client/networkd: set lifetimes for IPv4 addresses
Note that /proc/sys/net/ipv4/ip_dynaddr needs to be non-zero.

[tomegun: hook up DHCP renew events to increase the lifetime when necessary]
2014-06-29 15:18:21 +02:00