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

15763 Commits

Author SHA1 Message Date
Lennart Poettering
e50bd77516 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.
2014-06-17 02:43:43 +02:00
Lennart Poettering
1f8c46040e install: use symlink_atomic() instead of unlink()+symlink() when force creating a symlink 2014-06-17 02:43:43 +02:00
Lennart Poettering
1dacfd2ad6 install: various modernizations 2014-06-17 02:43:43 +02:00
Lennart Poettering
c2a8d7b05c install: teach preset query logic --root= support 2014-06-17 02:43:43 +02:00
Lennart Poettering
d309c1c364 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
2014-06-17 02:43:17 +02:00
Lennart Poettering
bcafe923a7 install: simplify and clarify disabling logic for instanced units 2014-06-17 01:24:04 +02:00
Lennart Poettering
da39f6a63e install: various modernizations 2014-06-17 01:24:04 +02:00
Lennart Poettering
e7b4d43ec3 update TODO 2014-06-17 01:24:03 +02:00
Lennart Poettering
b9a3302630 unit-name: various modernizations 2014-06-17 01:24:03 +02:00
Lennart Poettering
6ef9eeed61 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.
2014-06-17 01:24:03 +02:00
Thomas Hindoe Paaboel Andersen
e94b5a7bc2 journal-remote: fix memleak 2014-06-16 23:51:34 +02:00
Ronny Chevalier
40edd23670 tests: unlink temp file used in test 2014-06-16 20:38:23 +02:00
Ronny Chevalier
d06b3a9d70 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
2014-06-16 20:38:22 +02:00
Ronny Chevalier
106ecd769d tests: add test-fdset 2014-06-16 20:38:22 +02:00
Ronny Chevalier
c182135d3a tests: add test-socket-util 2014-06-16 20:38:22 +02:00
Susant Sahani
889a044ddc networkd: unref tunnel
Unref tunnel while shutting down
2014-06-16 20:38:22 +02:00
Susant Sahani
326cb4061a 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
2014-06-16 20:38:22 +02:00
Susant Sahani
1324e3ae51 networkd: rename netdev variables
Rename the netdev variables. Remove tunnel_
so that it can be reused .
2014-06-16 20:38:22 +02:00
Susant Sahani
6ef8147700 sd-rtnl: add support for vxlan rtnl attributes
This patch adds vxlan rtnl attributes to sd-rtnl
2014-06-16 20:38:22 +02:00
Kay Sievers
ba98e746e6 bus-proxy: policy - ignore unsupported tags and attributes 2014-06-16 16:04:18 +02:00
Ruediger Oertel
5a85ca1cb6 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.
2014-06-16 15:23:17 +02:00
David Herrmann
9489490a69 util: add realloc_multiply() helper
This is similar to malloc_multiply() and friends. It is realloc() with a
multiplication-overflow check.
2014-06-16 15:23:06 +02:00
David Herrmann
368504f485 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.
2014-06-16 15:22:57 +02:00
David Herrmann
d442e2ec6e 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.
2014-06-16 15:22:46 +02:00
Lennart Poettering
2e78fa79bb 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".
2014-06-16 13:21:07 +02:00
Lennart Poettering
45c196a76b tmpfiles: set up selinux label proeprly when creating fifos 2014-06-16 13:20:38 +02:00
Lennart Poettering
a01647e537 update TODO 2014-06-16 12:33:23 +02:00
Lennart Poettering
de66f68d9f build-sys: add missing Makefile link 2014-06-16 12:33:23 +02:00
Lennart Poettering
137243fd13 units: add a service to invoke ldconfig on system updates at boot 2014-06-16 12:33:22 +02:00
Lennart Poettering
b63bb8a724 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.
2014-06-16 12:25:49 +02:00
Lennart Poettering
4997cb9e16 update TODO 2014-06-16 01:03:38 +02:00
Lennart Poettering
2dbd4a9454 mount: add new SloppyOptions= setting for mount units, mapping to mount(8)'s "-s" switch 2014-06-16 01:02:27 +02:00
Lennart Poettering
8eb5a6e001 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...
2014-06-16 00:53:02 +02:00
Lennart Poettering
2db7648aa8 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.
2014-06-15 23:42:53 +02:00
Lennart Poettering
d4c6d50a2a 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.
2014-06-15 23:39:49 +02:00
Kay Sievers
3a0efd7030 sysusers: order before tmpfiles which need the ids 2014-06-14 22:17:15 +02:00
Tom Gundersen
4f561e8e43 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.
2014-06-14 19:01:46 +02:00
Tom Gundersen
5c8f858d20 Revert "Revert "networkd: netdev - set predictable mac address when creating netdev""
This reverts (and rewrites) commit 7d95c772cb.

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.
2014-06-14 15:48:16 +02:00
Tom Gundersen
96c907429e 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.
2014-06-14 15:38:35 +02:00
Tom Gundersen
d9876a527f 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
2014-06-14 15:06:17 +02:00
Thomas Hindoe Paaboel Andersen
efdc73dae3 networkd: link - check returned value from set_lease_pool 2014-06-13 23:00:52 +02:00
Colin Ian King
855d111304 Fix spelling mistake, scirpt --> script 2014-06-13 23:00:48 +02:00
Lennart Poettering
5b4c013121 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.
2014-06-13 20:11:59 +02:00
Lennart Poettering
6d1d50f081 tmpfiles: always use relative symlinks from tmpfiles snippets 2014-06-13 20:11:59 +02:00
Lennart Poettering
5ae4d543cb 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.
2014-06-13 20:11:59 +02:00
Lennart Poettering
b0284aba93 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.
2014-06-13 20:11:59 +02:00
Lennart Poettering
b532bdeae9 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.
2014-06-13 20:11:59 +02:00
Lennart Poettering
8cf7c96517 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.
2014-06-13 20:11:59 +02:00
Tom Gundersen
6f08fb7b34 sd-dhcp-server: test - skip when lacking perms 2014-06-13 19:11:31 +02:00
Andreas Henriksson
223217749e 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(...)).
2014-06-13 19:01:07 +02:00