Commit graph

8138 commits

Author SHA1 Message Date
Lennart Poettering 74b2466e14 resolved: add a DNS client stub resolver
Let's turn resolved into a something truly useful: a fully asynchronous
DNS stub resolver that subscribes to network changes.

(More to come: caching, LLMNR, mDNS/DNS-SD, DNSSEC, IDN, NSS module)
2014-07-16 00:31:38 +02:00
Thomas Hindoe Paaboel Andersen 337ede5693 networkd: remove unused variable 2014-07-15 20:38:49 +02:00
Tom Gundersen 53af3b7564 networkd: netdev - set mac for bond/bridge devicse
Suggested by poma.
2014-07-15 19:07:35 +02:00
Tom Gundersen f5de5b0020 sd-dhcp-client: make request broadcasts opt-in
It appears there is no good way to decide whether or not broadcasts should be enabled,
there is hardware that must have broadcast, and there are networks that only allow
unicast. So we give up and make this configurable.

By default, unicast is used, but if the kernel were to inform us abotu certain
interfaces requiring broadcast, we could change this to opt-in by default in
those cases.
2014-07-15 18:55:31 +02:00
Kay Sievers 30632d97d9 rules: uaccess - add ID_SOFTWARE_RADIO
On Tue, Jul 15, 2014 at 1:52 PM, Alick Zhao <alick9188@gmail.com> wrote:
>>>
>>> So maybe ID_SOFTWARE_RADIO ?
>>
>> Hmm, SDR is more a term for a generic technology than for a device
>> class. To me it does not really sound like an administrator would know
>> what this is.
>>
>> What exactly is the device or subsystem you want to make accessible to
>> locally logged-in users only?
>
> Initially it is bladeRF, but many more are of interest: USRP, rtl-sdr,
> HackRF, ... [1]
>
> I agree an administrator might not know what SDR is, since it is
> currently still not widely known, and makes sense only for amateurs
> and researchers. But as a SDR fan, I see many new SDR peripherals
> are created recently, and expect to see more. So a generic ID seems
> reasonable to me.
>
> [1] http://en.wikipedia.org/wiki/List_of_software-defined_radios
2014-07-15 17:35:53 +02:00
Umut Tezduyar Lindskog 285cd771cb core: fix oneshot service resource control
Oneshot services's cgroup is removed when the service
exits. An assert is hit otherwise.
2014-07-15 10:08:01 -04:00
Zbigniew Jędrzejewski-Szmek ae2db4e7e8 timesyncd: add sockaddr_pretty wrapper 2014-07-15 09:53:18 -04:00
Zbigniew Jędrzejewski-Szmek c566ee3253 timesyncd: only listen to clock changes when connected
This reverts previous commit and applies a different fix.

manager_clock_watch() callback calls manager_send_request() to kick
off a resync. We can only do that when we're actually connected to
something. It is not useful to setup the callback from manager_new().

Now the callback will be dropped in manager_connect() and requested
in manager_begin().

https://bugs.freedesktop.org/show_bug.cgi?id=80932
2014-07-15 09:52:19 -04:00
Kay Sievers afc7b1b9c1 timesyncd: suppress resync at system time change when not connected
Jul 04 17:46:03 orchid systemd[1]: Starting Network Time Synchronization...
Jul 04 17:46:03 orchid systemd[1]: Started Network Time Synchronization.
Jul 04 17:46:22 orchid systemd-timesyncd[301]: System time changed. Resyncing.
Jul 04 17:46:22 orchid systemd-timesyncd[301]: Assertion 'm->current_server_name'

https://bugs.freedesktop.org/show_bug.cgi?id=80932
2014-07-15 02:24:35 +02:00
Kay Sievers 64dfe7b744 rules: consistently use "?*" instead of "*?" 2014-07-15 02:04:47 +02:00
Tom Gundersen 679b3605f0 networkd: link - fix memory leak
Make link_initialized() idempotent to avoid taking refs on several udev_device
objects.
2014-07-14 16:50:01 +02:00
Tom Gundersen 5347925a59 test: network - skip if we don't have permissions to create netdevs 2014-07-14 16:49:41 +02:00
Tom Gundersen 1231c4d238 sd-dhcp-server: make gcc happy
It complains about optoffset possibly being uninitialized. It is wrong,
but let's just initialize it.
2014-07-14 16:49:41 +02:00
Tom Gundersen 4b4923e654 sd-dhcp6-client: make gcc happy
It complains about {max,init}_retransmit_time possibly being
uninitialized. It is wrong, but let's just initialize it.
2014-07-14 16:49:41 +02:00
Tom Gundersen 3be1d7e0c5 networkd: netdev - introduce vtable for netdev kinds
Split each netdev kind into its own .h/.c.
2014-07-14 16:49:41 +02:00
Tom Gundersen 2023dc8a9a networkd: netdev - rework load_one
We now:
 - parse config
 - match on environment
 - verify and complement config
 - create netdev
2014-07-14 16:47:04 +02:00
Tom Gundersen 6235b3def8 networkd: netdev - split out bridge creation 2014-07-14 16:47:04 +02:00
Tom Gundersen 3f26503776 networkd: netdev - rename 'enslave' to 'join'
Enslave only really makes sense when referring to bridges and bonds, so try to be
a bit more neutral.
2014-07-14 16:47:04 +02:00
Tom Gundersen dde2efef37 networkd: add back route destination support
This was accidentally dropped when adding metric support.
2014-07-14 12:14:23 +02:00
Tom Gundersen b621239e29 networkd: bond - explicitly map to kernel mode values 2014-07-14 12:13:45 +02:00
Susant Sahani edb85f0d8d networkd: dhcp add vendor class indentifier option 60
Vendor Class Identifier be used by DHCP clients to identify
their vendor type and configuration. When using this option,
vendors can define their own specific identifier values, such
as to convey a particular hardware or operating system
configuration or other identifying information.

Vendor-specified DHCP options—features that let administrators assign
separate options to clients with similar configuration requirements.
For example, if DHCP-aware clients for example we want to separate
different gateway and option for different set of people
(dev/test/hr/finance) in a org or devices for example web/database
servers or let's say in a embedded device etc and require a different
default gateway or DNS server than the rest of clients.
2014-07-14 11:39:20 +02:00
Susant Sahani 5d8e593dce networkd: make metric of routes configurable
Now route metric can be configuted via conf file:

example conf:

[Match]
Name=em1

[Route]
Gateway=192.168.1.12
Metric=10

Test:
ip route output
default via 192.168.1.12 dev em1 metric 10

[tomegun: squash TODO update and reword man page a bit]
2014-07-14 11:39:20 +02:00
Tom Gundersen 5bdd314cd9 networkd: return 1 from successful event handlers 2014-07-14 11:04:13 +02:00
Mantas Mikulėnas 0ce5a80601 fileio: quote more shell characters in envfiles
Turns out, making strings shell-proof is harder than expected:

    # machinectl set-hostname "foo|poweroff" && . /etc/machine-info

(This could be simplified by quoting *and* escaping all characters,
which is harmless in shell but unnecessary.)
2014-07-13 22:50:24 -04:00
Tanu Kaskinen 667a1cd645 path-lookup: don't make ~/.local/share/systemd/user a symlink
We already encourage upstreams to keep the default configuration
separate from user customizations for software that is installed in
the system location. Let's allow that separation also for software
that is installed in the home directory.

Some discussion:
http://thread.gmane.org/gmane.comp.sysutils.systemd.devel/19627
2014-07-13 21:14:07 -04:00
Zbigniew Jędrzejewski-Szmek f7f628b5db Add function to open temp files in selinux mode 2014-07-13 21:11:07 -04:00
Colin Walters a334cbba72 sysusers: preserve label of /etc/{passwd, group}
These files are specially labeled on SELinux systems, and we need to
preserve that label.
2014-07-13 21:10:56 -04:00
Lennart Poettering 92daebc0d0 sd-event: don't require a signal event source to be enabled for the child event source to work 2014-07-11 16:50:10 +02:00
David Herrmann b63c8d4f03 sd-event: always call epoll_ctl() on mask-updates if edge-triggered
A call to sd_event_source_set_io_events() skipps calling into the kernel
if the new event-mask matches the old one. This is safe for
level-triggered sources as the kernel moves them onto the ready-list
automatically if events change. However, edge-triggered sources might not
be on the ready-list even though events are present.

A call to sd_event_source_set_io_events() with EPOLLET set might thus be
used to just move the io-source onto the ready-list so the next poll
will return it again. This is very useful to avoid starvation in
priority-based event queues.

Imagine a read() loop on an edge-triggered fd. If we cannot read data fast
enough to drain the receive queue, we might decide to skip reading for now
and schedule it for later. On edge-triggered io-sources we have to make
sure it's put on the ready-list so the next dispatch-round will return it
again if it's still the highest priority task. We could make sd-event
handle edge-triggered sources directly and allow marking them ready again.
However, it's much simpler to let the kernel do that for now via
EPOLL_CTL_MOD.
2014-07-11 16:43:53 +02:00
David Herrmann 1ca5fd003f shared: fix coding-style for ring-buffer implementation
We use "typedef struct Ring Ring" with camel-case for internal objects.
So rename "struct ring" to "Ring".
2014-07-11 16:43:53 +02:00
David Herrmann 7df23077e4 shared: add MIN3 macro
This is like MIN but evaluates 3 arguments. We already have MAX3, so add
the equivalent for MIN.
2014-07-11 16:43:53 +02:00
Zbigniew Jędrzejewski-Szmek 3b1a55e110 Fix build without any compression enabled 2014-07-11 10:42:27 -04:00
Lennart Poettering 6017365a1d endian: explicitly include endian.h wherever we want to use __BYTE_ORDER 2014-07-11 16:13:13 +02:00
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