chiark / gitweb /
elogind.git
5 years agokmod: conditionalize kmod setup on CAP_SYS_MODULE, not whether we run in a container
Lennart Poettering [Tue, 17 Jun 2014 01:23:23 +0000 (03:23 +0200)]
kmod: conditionalize kmod setup on CAP_SYS_MODULE, not whether we run in a container

It's generally preferrable to conditionalize on the actual ability to do
something then the context we run in.

5 years agobuild-sys: touch /usr on "make install"
Lennart Poettering [Tue, 17 Jun 2014 01:09:27 +0000 (03:09 +0200)]
build-sys: touch /usr on "make install"

this way, the "make install" will be detected as offline update on next
boot.

5 years agounits: minor cleanups
Lennart Poettering [Tue, 17 Jun 2014 00:18:33 +0000 (02:18 +0200)]
units: minor cleanups

5 years agoinstall: improve paths we show the user when enabling/disabling
Lennart Poettering [Tue, 17 Jun 2014 00:15:03 +0000 (02:15 +0200)]
install: improve paths we show the user when enabling/disabling

5 years agonetworkd: don't pull in systemd-networkd-wait-online service from systemd-networkd...
Lennart Poettering [Tue, 17 Jun 2014 00:13:08 +0000 (02:13 +0200)]
networkd: don't pull in systemd-networkd-wait-online service from systemd-networkd when enabling

networkd-wait-online should never exist in the default transaction,
unless explicitly enable or pulled in via things like NFS. However, just
enabling networkd shouldn't enable networkd-wait-online, since it's
common to use the former without the latter.

5 years agoconf-files: fix when for --root= logic
Lennart Poettering [Mon, 16 Jun 2014 23:56:44 +0000 (01:56 +0200)]
conf-files: fix when for --root= logic

This is based on parts of similar patches from Michael Marineau and
Lukas Nykrin, but simply uses strappenda3().

5 years agosystemctl: output human readable strings in "systemctl enable" and "systemctl disable"
Lennart Poettering [Mon, 16 Jun 2014 23:38:07 +0000 (01:38 +0200)]
systemctl: output human readable strings in "systemctl enable" and "systemctl disable"

5 years agoinstall: simplify symlink --root= logic
Lennart Poettering [Mon, 16 Jun 2014 23:37:54 +0000 (01:37 +0200)]
install: simplify symlink --root= logic

5 years agoinstall: "systemctl enable" should be a nop for template units lacking a DefaultInsta...
Lennart Poettering [Mon, 16 Jun 2014 23:22:55 +0000 (01:22 +0200)]
install: "systemctl enable" should be a nop for template units lacking a DefaultInstance= setting

5 years agopreset: ship a minimal preset file upstream
Lennart Poettering [Mon, 16 Jun 2014 23:14:44 +0000 (01:14 +0200)]
preset: ship a minimal preset file upstream

This is useful so that distros have something to base their own policy
of. It also useful to make sure that minimal installs always get useful
configuration in place.

5 years agolog: don't downgrade log level in non-PID 1 if "quiet" is passed on kernel cmdline
Lennart Poettering [Mon, 16 Jun 2014 23:05:39 +0000 (01:05 +0200)]
log: don't downgrade log level in non-PID 1 if "quiet" is passed on kernel cmdline

"debug" should apply to all tools, but "quiet" only to PID1.

5 years agoinstall: make sure that --root= mode doesn't make us consider all units outside of...
Lennart Poettering [Mon, 16 Jun 2014 22:53:49 +0000 (00:53 +0200)]
install: make sure that --root= mode doesn't make us consider all units outside of search path

5 years agoinstall: make sure "systemctl disable foobar@.service" actually removes all instances
Lennart Poettering [Mon, 16 Jun 2014 22:33:39 +0000 (00:33 +0200)]
install: make sure "systemctl disable foobar@.service" actually removes all instances

5 years agoinstall: introduce new DefaultInstance= field for [Install] sections
Lennart Poettering [Mon, 16 Jun 2014 22:15:31 +0000 (00:15 +0200)]
install: introduce new DefaultInstance= field for [Install] sections

The DefaultInstance= name is used when enabling template units when only
specifying the template name, but no instance.

Add DefaultInstance=tty1 to getty@.service, so that when the template
itself is enabled an instance for tty1 is created.

This is useful so that we "systemctl preset-all" can work properly,
because we can operate on getty@.service after finding it, and the right
instance is created.

5 years agoinstall: when looking for a unit file for enabling, search for templates only after...
Lennart Poettering [Mon, 16 Jun 2014 22:13:48 +0000 (00:13 +0200)]
install: when looking for a unit file for enabling, search for templates only after traversing all search directories

Let's always make sure to look in all search directories for the full
unit names first, before looking for templates for them.

5 years agoinstall: use symlink_atomic() instead of unlink()+symlink() when force creating a...
Lennart Poettering [Mon, 16 Jun 2014 22:11:47 +0000 (00:11 +0200)]
install: use symlink_atomic() instead of unlink()+symlink() when force creating a symlink

5 years agoinstall: various modernizations
Lennart Poettering [Mon, 16 Jun 2014 22:10:54 +0000 (00:10 +0200)]
install: various modernizations

5 years agoinstall: teach preset query logic --root= support
Lennart Poettering [Mon, 16 Jun 2014 18:33:29 +0000 (20:33 +0200)]
install: teach preset query logic --root= support

5 years agoinstall: beef up preset logic to limit to only enable or only disable, and do all...
Lennart Poettering [Mon, 16 Jun 2014 17:49:31 +0000 (19:49 +0200)]
install: beef up preset logic to limit to only enable or only disable, and do all-unit preset operations

The new "systemctl preset-all" command may now be used to put all
installed units back into the enable/disable state the vendor/admin
encoded in preset files.

Also, introduce "systemctl --preset-mode=enable-only" and "systemctl
--preset-mode=disable-only" to only apply the enable or only the disable
operations of a "systemctl preset" or "systemctl preset-all" operation.

"systemctl preset-all" implements this RFE:

https://bugzilla.redhat.com/show_bug.cgi?id=630174

5 years agoinstall: simplify and clarify disabling logic for instanced units
Lennart Poettering [Mon, 16 Jun 2014 17:48:31 +0000 (19:48 +0200)]
install: simplify and clarify disabling logic for instanced units

5 years agoinstall: various modernizations
Lennart Poettering [Mon, 16 Jun 2014 15:19:30 +0000 (17:19 +0200)]
install: various modernizations

5 years agoupdate TODO
Lennart Poettering [Mon, 16 Jun 2014 15:04:49 +0000 (17:04 +0200)]
update TODO

5 years agounit-name: various modernizations
Lennart Poettering [Mon, 16 Jun 2014 15:04:30 +0000 (17:04 +0200)]
unit-name: various modernizations

5 years agounit-name: fix detection of unit templates/instances
Lennart Poettering [Mon, 16 Jun 2014 15:01:26 +0000 (17:01 +0200)]
unit-name: fix detection of unit templates/instances

We need to check for the last dot, not the first one in a unit name, for
the suffix. Correct that.

5 years agojournal-remote: fix memleak
Thomas Hindoe Paaboel Andersen [Mon, 16 Jun 2014 21:49:10 +0000 (23:49 +0200)]
journal-remote: fix memleak

5 years agotests: unlink temp file used in test
Ronny Chevalier [Sun, 15 Jun 2014 20:47:49 +0000 (22:47 +0200)]
tests: unlink temp file used in test

5 years agotests: add tests to test-hashmap
Ronny Chevalier [Sun, 15 Jun 2014 20:46:05 +0000 (22:46 +0200)]
tests: add tests to test-hashmap

add tests for:
  - hashmap_remove_and_put
  - hashmap_first_key
  - hashmap_last
  - hashmap_steal_first_key
  - hashmap_clear_free_free

5 years agotests: add test-fdset
Ronny Chevalier [Sat, 14 Jun 2014 20:10:45 +0000 (22:10 +0200)]
tests: add test-fdset

5 years agotests: add test-socket-util
Ronny Chevalier [Sat, 14 Jun 2014 20:10:44 +0000 (22:10 +0200)]
tests: add test-socket-util

5 years agonetworkd: unref tunnel
Susant Sahani [Mon, 16 Jun 2014 06:24:34 +0000 (11:54 +0530)]
networkd: unref tunnel

Unref tunnel while shutting down

5 years agonetworkd: introduce vxlan
Susant Sahani [Mon, 16 Jun 2014 06:24:33 +0000 (11:54 +0530)]
networkd: introduce vxlan

This patch enables netwokd to create vxlan

Changes:
Added:
1. File networkd networkd-vxlan.c
2. to netdev
    bool learning
    struct in_addr group
    uint64_t vxlanid;
3. VXLAN subsection and config
   parameters

5 years agonetworkd: rename netdev variables
Susant Sahani [Mon, 16 Jun 2014 06:24:32 +0000 (11:54 +0530)]
networkd: rename netdev variables

Rename the netdev variables. Remove tunnel_
so that it can be reused .

5 years agosd-rtnl: add support for vxlan rtnl attributes
Susant Sahani [Mon, 16 Jun 2014 06:24:31 +0000 (11:54 +0530)]
sd-rtnl: add support for vxlan rtnl attributes

This patch adds vxlan rtnl attributes to sd-rtnl

5 years agobus-proxy: policy - ignore unsupported tags and attributes
Kay Sievers [Mon, 16 Jun 2014 14:03:30 +0000 (16:03 +0200)]
bus-proxy: policy - ignore unsupported tags and attributes

5 years agoReset signal-mask on re-exec to init=..
Ruediger Oertel [Fri, 13 Jun 2014 14:41:06 +0000 (16:41 +0200)]
Reset signal-mask on re-exec to init=..

Process 1 (aka init) needs to be started with an empty signal mask.
That includes the process 1 that's started after the initrd is finished.
When the initrd is using systemd (as it does with dracut based initrds)
then it is systemd that calls the real init.  Normally this is systemd
again, except when the user uses for instance "init=/bin/bash" on the
kernel command line.

5 years agoutil: add realloc_multiply() helper
David Herrmann [Fri, 13 Jun 2014 16:43:22 +0000 (18:43 +0200)]
util: add realloc_multiply() helper

This is similar to malloc_multiply() and friends. It is realloc() with a
multiplication-overflow check.

5 years agoutil: fix multiply-alloc helpers with size==0
David Herrmann [Fri, 13 Jun 2014 16:38:15 +0000 (18:38 +0200)]
util: fix multiply-alloc helpers with size==0

Passing 0 to malloc() is not required to return NULL. Therefore, don't
bail out if "b" is 0. This is not of importance to the existing helpers,
but the upcoming realloc_multiply() requires this. To keep consistence, we
keep the same behavior for the other helpers.

5 years agomacro: add DISABLE_WARNING_SHADOW
David Herrmann [Thu, 12 Jun 2014 15:54:48 +0000 (17:54 +0200)]
macro: add DISABLE_WARNING_SHADOW

As it turns out, we cannot use _Pragma in compound-statements. Therefore,
constructs like MIN(MAX(a, b), x) will warn due to shadowed variable
declarations. The DISABLE_WARNING_SHADOW macro can be used to suppress
these.

Note that using UNIQUE(_var) does not work either as GCC uses the last
line of a macro-expansion for __LINE__, therefore, still causing both
macros to have the same variables. We could use different variable-names
for MIN and MAX, but that just hides the problem and still fails for
MIN(something(MIN(a, b)), c).

The only working solution is to use __COUNTER__ and pass it pre-evaluated
as extra argument to a macro to use as name-prefix. This, however, makes
all these macros much more complicated so I'll go with manual
DISABLE_WARNING_SHADOW so far.

5 years agotmpfiles: add new "L+" command as stronger version of "L", that removes the destinati...
Lennart Poettering [Mon, 16 Jun 2014 11:21:07 +0000 (13:21 +0200)]
tmpfiles: add new "L+" command as stronger version of "L", that removes the destination before creating a symlink

Also, make use of this for mtab as long as mount insists on creating it
even if we invoke it with "-n".

5 years agotmpfiles: set up selinux label proeprly when creating fifos
Lennart Poettering [Mon, 16 Jun 2014 11:20:38 +0000 (13:20 +0200)]
tmpfiles: set up selinux label proeprly when creating fifos

5 years agoupdate TODO
Lennart Poettering [Mon, 16 Jun 2014 10:29:51 +0000 (12:29 +0200)]
update TODO

5 years agobuild-sys: add missing Makefile link
Lennart Poettering [Mon, 16 Jun 2014 10:29:35 +0000 (12:29 +0200)]
build-sys: add missing Makefile link

5 years agounits: add a service to invoke ldconfig on system updates at boot
Lennart Poettering [Mon, 16 Jun 2014 10:28:44 +0000 (12:28 +0200)]
units: add a service to invoke ldconfig on system updates at boot

5 years agounits: drop RefuseManualStart= from a couple of update services
Lennart Poettering [Mon, 16 Jun 2014 10:25:49 +0000 (12:25 +0200)]
units: drop RefuseManualStart= from a couple of update services

The only update service we really need to guard like this is
systemd-tmpfiles-setup.service since if invoked manually might create
/var/run/nologin and thus blocking the user from login. The other
services are pretty much idempotent and don't suffer by this problem,
hence let's simplify them.

5 years agoupdate TODO
Lennart Poettering [Sun, 15 Jun 2014 23:03:38 +0000 (01:03 +0200)]
update TODO

5 years agomount: add new SloppyOptions= setting for mount units, mapping to mount(8)'s "-s...
Lennart Poettering [Sun, 15 Jun 2014 23:02:27 +0000 (01:02 +0200)]
mount: add new SloppyOptions= setting for mount units, mapping to mount(8)'s "-s" switch

5 years agomount: tell /bin/mount to never touch /etc/mtab
Lennart Poettering [Sun, 15 Jun 2014 22:53:02 +0000 (00:53 +0200)]
mount: tell /bin/mount to never touch /etc/mtab

/etc/mtab should die die die. It's sad enough util-linux still contains
support for it, but we don't have to partake in that charade, so let's
turn this off.

This is in-line with the fact that since years we already have been
"tainting" systemd if we detect /etc/mtab not being a symlink...

Of course, util-linux is currently broken, and still touches /etc/mtab,
weven if we pass "--no-mtab" to it:

https://bugzilla.redhat.com/show_bug.cgi?id=1109367

But hey, let's hope that gets fixed quickly, even if total removal of
/etc/mtab support from util-linux might not happen so quickly...

5 years agounits: bring systemd-tmpfiles-setup-dev.service closer to systemd-tmpfiles-setup...
Lennart Poettering [Sun, 15 Jun 2014 21:42:53 +0000 (23:42 +0200)]
units: bring systemd-tmpfiles-setup-dev.service closer to systemd-tmpfiles-setup.service

Among other things, order both services relative to
systemd-sysusers.service in the same direction.

5 years agotmpfiles: create /etc/resolv.conf as link to networkd's version, if it doesn't exist
Lennart Poettering [Sun, 15 Jun 2014 21:39:00 +0000 (23:39 +0200)]
tmpfiles: create /etc/resolv.conf as link to networkd's version, if it doesn't exist

If /etc/resolv.conf doesn't exist it's better than nothing to make it
point to networkd's version.

5 years agosysusers: order before tmpfiles which need the ids
Kay Sievers [Sat, 14 Jun 2014 20:16:46 +0000 (22:16 +0200)]
sysusers: order before tmpfiles which need the ids

5 years agonetworkd: link - flush all pending NEWLINK events before trying to match
Tom Gundersen [Sat, 14 Jun 2014 16:52:46 +0000 (18:52 +0200)]
networkd: link - flush all pending NEWLINK events before trying to match

We could still have an old interface name and/or mac address when libudev
tells us that the device is initialized, as the up-to-date info could still
be on its way from the kernel.

5 years agoRevert "Revert "networkd: netdev - set predictable mac address when creating netdev""
Tom Gundersen [Sat, 14 Jun 2014 13:48:16 +0000 (15:48 +0200)]
Revert "Revert "networkd: netdev - set predictable mac address when creating netdev""

This reverts (and rewrites) commit 7d95c772cba1836545459760273b13f2e01dd2a8.

The issue blocking this feature has now been fixed in the kernel, and backported
to the various stable kernels.

Our netdevs will now have stable MAC addresses, even if one is not specified.

5 years agonetworkd: netdev - allow setting MACAddress in .netdev files
Tom Gundersen [Sat, 14 Jun 2014 13:38:35 +0000 (15:38 +0200)]
networkd: netdev - allow setting MACAddress in .netdev files

It may sometimes be necessary to specify the MAC address of a netdev.
Let us set the correct one from the get-go, rather than having the
kernel generate a random one, and then change it after.

5 years agonetworkd: add assert
Tom Gundersen [Sat, 14 Jun 2014 13:03:56 +0000 (15:03 +0200)]
networkd: add assert

It should not be possible to have a DHCP lease on a link without also having
an associated network. Add assert() to avoid compiler warnings.

Reported by Thomas H. P. Andersen

5 years agonetworkd: link - check returned value from set_lease_pool
Thomas Hindoe Paaboel Andersen [Fri, 13 Jun 2014 20:00:55 +0000 (22:00 +0200)]
networkd: link - check returned value from set_lease_pool

5 years agoFix spelling mistake, scirpt --> script
Colin Ian King [Thu, 12 Jun 2014 15:41:41 +0000 (16:41 +0100)]
Fix spelling mistake, scirpt --> script

5 years agocore: don't complain at early boot if /etc/mtab is not the right symlink
Lennart Poettering [Fri, 13 Jun 2014 18:04:31 +0000 (20:04 +0200)]
core: don't complain at early boot if /etc/mtab is not the right symlink

When we boot up with an empty /etc it's ok if the symlink doesn't exist.
We will create it later with tmpfiles.

5 years agotmpfiles: always use relative symlinks from tmpfiles snippets
Lennart Poettering [Fri, 13 Jun 2014 17:56:12 +0000 (19:56 +0200)]
tmpfiles: always use relative symlinks from tmpfiles snippets

5 years agoos-release: define /usr/lib/os-release as fallback for /etc/os-release
Lennart Poettering [Fri, 13 Jun 2014 17:45:52 +0000 (19:45 +0200)]
os-release: define /usr/lib/os-release as fallback for /etc/os-release

The file should have been in /usr/lib/ in the first place, since it
describes the OS container in /usr (and not the configuration in /etc),
hence, let's support os-release files in /usr/lib as fallback if no
version in /etc exists, following the usual override logic.

A prior commit already enabled tmpfiles to create /etc/os-release as a
symlink to /usr/lib/os-release should it be missing, thus providing nice
compatibility with applications only checking in /etc.

While it's probably a good idea if all apps check both locations via a
fallback logic, it is only necessary in the early boot process, as long
as the /etc/os-release symlink has not been restored, in case we boot
with an empty /etc.

5 years agosysusers: always treat ENOENT as entry-not-found when doing NSS calls
Lennart Poettering [Fri, 13 Jun 2014 17:24:11 +0000 (19:24 +0200)]
sysusers: always treat ENOENT as entry-not-found when doing NSS calls

For most NSS calls it is documented that they return NULL + errno=0 when
an entry is not found. However, in reality it appears to be common to
return NULL + errno=ENOENT, instead. Handle that correctly, and don't
consider ENOENT a systematic error.

5 years agorpm: add RPM macros to apply sysusers, sysctl, and binfmt drop-ins
Lennart Poettering [Fri, 13 Jun 2014 17:18:55 +0000 (19:18 +0200)]
rpm: add RPM macros to apply sysusers, sysctl, and binfmt drop-ins

With this in place RPMs can make sure that whatever they drop in is
immeidately applied, and not delayed until next reboot.

This also moves systemd-sysusers back to /usr/bin, since hardcoding the
path to /usr/lib in the macros would mean compatibility breaks in
future, should we turn sysusers into a command that is actually OK for
people to call directly. And given that that is quite likely to happen
(since it is useful to prepare images with its --root= switch), let's
just prepare for it.

5 years agorpm: don't hardcode the binary paths in the macros, rely on $PATH
Lennart Poettering [Fri, 13 Jun 2014 17:05:22 +0000 (19:05 +0200)]
rpm: don't hardcode the binary paths in the macros, rely on $PATH

this gives us a little bit more freedom to move things around later on,
as we don't hardcode the systemd paths in old RPMs that shall work with
new systemds.

5 years agosd-dhcp-server: test - skip when lacking perms
Tom Gundersen [Fri, 13 Jun 2014 17:11:31 +0000 (19:11 +0200)]
sd-dhcp-server: test - skip when lacking perms

5 years agoinstall: fix invalid free() in unit_file_mask()
Andreas Henriksson [Fri, 13 Jun 2014 16:48:18 +0000 (18:48 +0200)]
install: fix invalid free() in unit_file_mask()

int unit_file_mask(...) in ./src/shared/install.c calls
get_config_path(...) which can in 4 error cases return without setting
"ret", and thus "prefix" can be uninitialized when unit_file_mask(...)
finishes (which it does directly after the error is returned from
get_config_path(...)).

5 years agoudev: fix invalid free() in enable_name_policy()
Andreas Henriksson [Fri, 13 Jun 2014 16:48:21 +0000 (18:48 +0200)]
udev: fix invalid free() in enable_name_policy()

static bool enable_name_policy(...) in ./src/udev/net/link-config.c
calls proc_cmdline(...) to get "line" initialized, but
proc_cmdline(...) does not guarantee that atleast when both
conditions (detect_container(NULL) > 0) and
read_full_file(...) returned < 0.

5 years agocore: fix invalid free() in killall()
Andreas Henriksson [Fri, 13 Jun 2014 16:48:19 +0000 (18:48 +0200)]
core: fix invalid free() in killall()

static int killall(....) in ./src/core/killall.c tries to get "s"
initialized by calling get_process_comm(...) which calls
read_one_line_file(...) which if it fails will mean it is left
uninitialized.
It is then used in argument to strna(s) call where it is
dereferenced(!), in addition to nothing else initializing it before
the scope it is in finishes.

5 years agosd-dhcp-client: fix invalid free() in client_send_request()
Andreas Henriksson [Fri, 13 Jun 2014 16:48:20 +0000 (18:48 +0200)]
sd-dhcp-client: fix invalid free() in client_send_request()

static int client_send_request(...) in
./src/libsystemd-network/sd-dhcp-client.c tries to initialize
"request" by calling client_message_init(...), which has atleast
5 error cases where it can return without that happening.
This leads to the function finishing without "request" being initialized.

5 years agonetworkd: link - left-align debug messages
Tom Gundersen [Fri, 13 Jun 2014 16:34:34 +0000 (18:34 +0200)]
networkd: link - left-align debug messages

Still add some whitespace betwen ifname and the message to get the
messages aligned (as I find it easier to spot specific messages this way).

5 years agonetworkd: add dhcp server support
Tom Gundersen [Wed, 5 Mar 2014 07:13:30 +0000 (08:13 +0100)]
networkd: add dhcp server support

When enabled in [Network] it will set up a dhcp server on the interface, listening
on one of its statically configured IPv4 addresses and with a fixed size pool of
leases determined from it.

Example:

[Match]
Name=ve-arch-tree

[Network]
Address=192.168.12.5/24
DHCPServer=yes

[Route]
Gateway=192.168.12.5
Destination=192.168.12.0/24

In this case we will configure ve-arch-tree with the address 192.168.12.5 and
hand out addresses in the range 192.168.12.6 - 192.168.12.38.

In the future, we should (as suggested by Lennart) introduce a syntax to pick the
server address automatically.

5 years agosd-dhcp-server: add RELEASE support
Tom Gundersen [Mon, 26 May 2014 13:18:47 +0000 (15:18 +0200)]
sd-dhcp-server: add RELEASE support

5 years agosd-dhcp-server: add dummy DECLINE support
Tom Gundersen [Mon, 26 May 2014 13:06:42 +0000 (15:06 +0200)]
sd-dhcp-server: add dummy DECLINE support

5 years agosd-dhcp-server: track bound leases
Tom Gundersen [Sun, 25 May 2014 20:07:53 +0000 (22:07 +0200)]
sd-dhcp-server: track bound leases

Make sure we don't hand out the same IP twice. We still don't
handle lease expiry.

5 years agosd-dhcp-server: add support for clients requesting lease lifetime
Tom Gundersen [Sun, 25 May 2014 19:47:38 +0000 (21:47 +0200)]
sd-dhcp-server: add support for clients requesting lease lifetime

5 years agosd-dhcp-server: add basic NAK support
Tom Gundersen [Sun, 25 May 2014 18:39:02 +0000 (20:39 +0200)]
sd-dhcp-server: add basic NAK support

5 years agosd-dhcp-server: add basic REQUEST/ACK support
Tom Gundersen [Sun, 25 May 2014 16:28:03 +0000 (18:28 +0200)]
sd-dhcp-server: add basic REQUEST/ACK support

5 years agosd-dhcp-server: add basic DISCOVER/OFFER support
Tom Gundersen [Sun, 25 May 2014 15:31:17 +0000 (17:31 +0200)]
sd-dhcp-server: add basic DISCOVER/OFFER support

5 years agosd-dhcp-server: add support for sending messages
Tom Gundersen [Sun, 25 May 2014 15:20:57 +0000 (17:20 +0200)]
sd-dhcp-server: add support for sending messages

5 years agosd-dhcp-server: add support for setting the server address
Tom Gundersen [Sat, 24 May 2014 22:29:13 +0000 (00:29 +0200)]
sd-dhcp-server: add support for setting the server address

5 years agosd-dhcp-server: bind to raw socket for sending
Tom Gundersen [Sat, 24 May 2014 21:03:49 +0000 (23:03 +0200)]
sd-dhcp-server: bind to raw socket for sending

We would like to use the UDP socket, but we cannot as we need to specify
the MAC address manually.

5 years agosd-dhcp-server: add basic message parsing
Tom Gundersen [Sat, 24 May 2014 20:14:32 +0000 (22:14 +0200)]
sd-dhcp-server: add basic message parsing

Parse the maximum message size the client can accept and the client id, falling back to
sane defaults if they are not set.

5 years agosd-dhcp-server: add basic message handling and verification
Tom Gundersen [Sat, 24 May 2014 19:04:27 +0000 (21:04 +0200)]
sd-dhcp-server: add basic message handling and verification

5 years agosd-dhcp-server: bind to a given interface
Tom Gundersen [Sat, 24 May 2014 17:38:17 +0000 (19:38 +0200)]
sd-dhcp-server: bind to a given interface

We will (at least at first), restrict our focus to running the server
on at most one interface.

5 years agosd-dhcp-server: add basic functionality for starting/stopping server
Tom Gundersen [Sat, 24 May 2014 17:27:20 +0000 (19:27 +0200)]
sd-dhcp-server: add basic functionality for starting/stopping server

Bind to UDP socket and listen for messages, discarding anything we receive.

5 years agosd-dhcp-server: add basic functionality for creating/destroying server instance
Tom Gundersen [Sat, 24 May 2014 16:48:41 +0000 (18:48 +0200)]
sd-dhcp-server: add basic functionality for creating/destroying server instance

5 years agodhcp-network: allow UDP socket to listen on any address
Tom Gundersen [Sat, 24 May 2014 13:48:47 +0000 (15:48 +0200)]
dhcp-network: allow UDP socket to listen on any address

For this to work nicely we need to use REUSEADDR so that more than one socket
can be open at the same time. Also, we request the ifindex to be appended
to incoming messages, so we know whence it came.

5 years agotmpfiles: add minimal tmpfiles snippet to rebuild the most essential stuff from /etc
Lennart Poettering [Fri, 13 Jun 2014 11:29:25 +0000 (13:29 +0200)]
tmpfiles: add minimal tmpfiles snippet to rebuild the most essential stuff from /etc

5 years agounits: rebuild /etc/passwd, the udev hwdb and the journal catalog files on boot
Lennart Poettering [Fri, 13 Jun 2014 11:10:30 +0000 (13:10 +0200)]
units: rebuild /etc/passwd, the udev hwdb and the journal catalog files on boot

Only when necessary of course, nicely guarded with the new
ConditionNeedsUpdate= condition we added.

5 years agocore: add new ConditionNeedsUpdate= unit condition
Lennart Poettering [Fri, 13 Jun 2014 10:52:31 +0000 (12:52 +0200)]
core: add new ConditionNeedsUpdate= unit condition

This new condition allows checking whether /etc or /var are out-of-date
relative to /usr. This is the counterpart for the update flag managed by
systemd-update-done.service. Services that want to be started once after
/usr got updated should use:

        [Unit]
        ConditionNeedsUpdate=/etc
        Before=systemd-update-done.service

This makes sure that they are only run if /etc is out-of-date relative
to /usr. And that it will be executed after systemd-update-done.service
which is responsible for marking /etc up-to-date relative to the current
/usr.

ConditionNeedsUpdate= will also checks whether /etc is actually
writable, and not trigger if it isn't, since no update is possible then.

5 years agoupdate-done: add minimal tool to manage system updates for /etc and /var, if /usr...
Lennart Poettering [Fri, 13 Jun 2014 10:43:49 +0000 (12:43 +0200)]
update-done: add minimal tool to manage system updates for /etc and /var, if /usr has changed

In order to support offline updates to /usr, we need to be able to run
certain tasks on next boot-up to bring /etc and /var in line with the
updated /usr. Hence, let's devise a mechanism how we can detect whether
/etc or /var are not up-to-date with /usr anymore: we keep "touch
files" in /etc/.updated and /var/.updated that are mtime-compared with
/usr. This means:

Whenever the vendor OS tree in /usr is updated, and any services that
shall be executed at next boot shall be triggered, it is sufficient to
update the mtime of /usr itself. At next boot, if /etc/.updated and/or
/var/.updated is older than than /usr (or missing), we know we have to
run the update tools once. After that is completed we need to update the
mtime of these files to the one of /usr, to keep track that we made the
necessary updates, and won't repeat them on next reboot.

A subsequent commit adds a new ConditionNeedsUpdate= condition that
allows checking on boot whether /etc or /var are outdated and need
updating.

This is an early step to allow booting up with an empty /etc, with
automatic rebuilding of the necessary cache files or user databases
therein, as well as supporting later updates of /usr that then propagate
to /etc and /var again.

5 years agocondition: minor modernizations
Lennart Poettering [Fri, 13 Jun 2014 10:39:58 +0000 (12:39 +0200)]
condition: minor modernizations

5 years agounits: don't conditionalize sysctl service
Lennart Poettering [Fri, 13 Jun 2014 10:25:12 +0000 (12:25 +0200)]
units: don't conditionalize sysctl service

We install two sysctl snippets ourselves, hence the condition will
always trigger, so no point in tryng to optimize things with this, it
just will make things slower, if anything.

5 years agounits: remove conditions from systemd-tmpfiles-setup
Lennart Poettering [Fri, 13 Jun 2014 10:22:04 +0000 (12:22 +0200)]
units: remove conditions from systemd-tmpfiles-setup

There's no point in conditionalizing systemd-tmpfiles at boot, since we
ship tmpfiles snippets ourselves, hence they will always trigger anyway.

Also, there's no reason to pull in local-fs.target from the service,
hence drop that.

5 years agosystem-update-generator: modernizations
Lennart Poettering [Fri, 13 Jun 2014 10:21:45 +0000 (12:21 +0200)]
system-update-generator: modernizations

5 years agosysusers: hide generate .conf file
Lennart Poettering [Fri, 13 Jun 2014 10:18:18 +0000 (12:18 +0200)]
sysusers: hide generate .conf file

5 years agoupdate TODO
Lennart Poettering [Fri, 13 Jun 2014 10:17:30 +0000 (12:17 +0200)]
update TODO

5 years agosysusers: move systemd-sysusers to libexec for now
Lennart Poettering [Fri, 13 Jun 2014 10:17:11 +0000 (12:17 +0200)]
sysusers: move systemd-sysusers to libexec for now

5 years agotmpfiles: skip mknod() on -EPERM (device cgroup)
Kay Sievers [Fri, 13 Jun 2014 02:11:11 +0000 (04:11 +0200)]
tmpfiles: skip mknod() on -EPERM (device cgroup)

5 years agosysusers: do not set todo to create a user when we only need a group
Kay Sievers [Fri, 13 Jun 2014 01:26:41 +0000 (03:26 +0200)]
sysusers: do not set todo to create a user when we only need a group

5 years agocryptsetup: check that password is not null
Thomas Hindoe Paaboel Andersen [Thu, 12 Jun 2014 20:50:04 +0000 (22:50 +0200)]
cryptsetup: check that password is not null

Beef up the assert to protect against passing null to strlen.

Found with scan-build.

5 years agosysuser: generate default snippet incorporating TTY_GID properly
Lennart Poettering [Thu, 12 Jun 2014 21:22:27 +0000 (23:22 +0200)]
sysuser: generate default snippet incorporating TTY_GID properly

When the user specifies --with-tty-gid= then we should honour that and
write it to the snippet, too.