Commit graph

2026 commits

Author SHA1 Message Date
Lennart Poettering 07630cea1f util-lib: split our string related calls from util.[ch] into its own file string-util.[ch]
There are more than enough calls doing string manipulations to deserve
its own files, hence do something about it.

This patch also sorts the #include blocks of all files that needed to be
updated, according to the sorting suggestions from CODING_STYLE. Since
pretty much every file needs our string manipulation functions this
effectively means that most files have sorted #include blocks now.

Also touches a few unrelated include files.
2015-10-24 23:05:02 +02:00
Lennart Poettering 4f5dd3943b util: split out escaping code into escape.[ch]
This really deserves its own file, given how much code this is now.
2015-10-24 23:04:42 +02:00
Lennart Poettering 84ac7bea36 util: split out extract_first_word() and related calls into extract-word.[ch]
This is quite a lot of code these days, hence move it to its own source
file.
2015-10-24 23:03:49 +02:00
Sangjung Woo 5dfcb8d200 units: add 'SmackFileSystemRoot=*' option into tmp.mount
If SMACK is enabled, 'smackfsroot=*' option should be specified when
/tmp is mounted since many non-root processes use /tmp for temporary
usage. If not, /tmp is labeled as '_' and smack denial occurs when
writing.

In order to do that, 'SmackFileSystemRoot=*' is newly added into
tmp.mount.
2015-10-24 20:54:21 +09:00
Tom Gundersen a13c50e7a3 networkd: ndisc - split out from dhcp6 code 2015-10-22 17:19:54 +02:00
Tom Gundersen 940367a0ab libsystemd-network: split icm6-util.[ch] out of dhcp6 code 2015-10-22 17:19:54 +02:00
Tom Gundersen 3ad0c5d8a4 sd-icmp6-nd: rename files to sd-ndisc
The actual code rename will follow. The reason for the change of name is to make it
simpler and more uniform with how we name other libraries (we don't include the
underlying protocol). The new name also matches the naming in the kernel (which
is particularly relevent here as we expect to let the kernel do some parts of
the protocol and we do others).
2015-10-22 17:19:54 +02:00
Lennart Poettering bf1ae29f21 Merge pull request #1584 from mischief/journal-remote-no-gnutls
build: install journal-remote units and directory regardless of GNUTLS
2015-10-19 19:16:15 +02:00
Kay Sievers 29a3f0d4c5 Revert "units: add 'smackfsroot=*' option into tmp.mount when SMACK is enabled"
This reverts commit 409c2a13fd.

It breaks the bootup of systems which enable smack at compile time, but have no
smack enabled in the kernel. This needs a different solution.
2015-10-18 12:21:21 +02:00
Nick Owens 08b62a9a13 build: install journal-remote units and directory regardless of GNUTLS 2015-10-15 16:24:47 -07:00
Lennart Poettering 2ac3f19a51 Merge pull request #1572 from again4you/devel/tmp-smack
units: add 'smackfsroot=*' option into tmp.mount when SMACK is enabled
2015-10-15 13:09:57 +02:00
Sangjung Woo 409c2a13fd units: add 'smackfsroot=*' option into tmp.mount when SMACK is enabled
If SMACK is enabled, 'smackfsroot=*' option should be specified in
tmp.mount file since many non-root processes use /tmp for temporary
usage. If not, /tmp is labeled as '_' and smack denial occurs when
writing.
2015-10-15 14:02:44 +09:00
Lennart Poettering 6777e2ad72 Merge pull request #1562 from michich/overlinking
build: fix overlinking
2015-10-14 17:29:24 +02:00
Michal Schmidt e97379dea2 build: libdl is needed only for libnss_resolve
Not everything needs to link to libdl. dlopen+dlsym are used only by
libnss_resolve.
2015-10-14 14:49:18 +02:00
Martin Pitt 1d3f8fa747 keymap: Drop keyboard-keys-to-name.h
We don't use that anywhere any more. With the introduction of alias names it
also is not a proper mapping any more as several keys (e. g. KEY_COFFEE and
KEY_SCREENLOCK) have the same numerical mapping.
2015-10-14 07:15:58 +02:00
Martin Pitt 4c14822029 keymap: Recognize KEY_* aliases
linux/input.h contains alias definitions like

  #define KEY_COFFEE              152
  #define KEY_SCREENLOCK          KEY_COFFEE
  #define KEY_ROTATE_DISPLAY      153
  #define KEY_DIRECTION           KEY_ROTATE_DISPLAY

But we ignored these when building keyboard-keys-list.txt. Also allow the value
to start with "K" now (for KEY_*), and drop the hardcoded COFFEE →  SCREENLOCK
aliasing.

This fixes assignments to key "direction".

Fixes #1151
2015-10-14 07:15:54 +02:00
Lennart Poettering c379f143a5 build-sys: bump library version 2015-10-07 17:06:22 +02:00
Tom Gundersen a245d90a89 test: siphash24 - add regression test 2015-10-05 17:33:58 +02:00
Lennart Poettering d35c1bb1f4 rfkill: rework and make it listen on /dev/rfkill
With this rework we introduce systemd-rfkill.service as singleton that
is activated via systemd-rfkill.socket that listens on /dev/rfkill. That
way, we get notified each time a new rfkill device shows up or changes
state, in which case we restore and save its current setting to disk.

This is nicer than the previous logic, as this means we save/restore
state even of rfkill devices that are around only intermittently, and
save/restore the state even if the system is shutdown abruptly instead
of cleanly.

This implements what I suggested in #1019 and obsoletes it.
2015-10-01 16:21:09 +02:00
Lennart Poettering 618234a525 basic: split out cpu set specific APIs into cpu-set-util.[ch] 2015-09-30 22:26:16 +02:00
Lennart Poettering 4a9b1dd4ad machine-id-commit: merge machine-id-commit functionality into machine-id-setup
And remove machine-id-commit as separate binary.

There's really no point in keeping this separate, as the sources are
pretty much identical, and have pretty identical interfaces. Let's unify
this in one binary.

Given that machine-id-commit was a private binary of systemd (shipped in
/usr/lib/) removing the tool is not an API break.

While we are at it, improve the documentation of the command substantially.
2015-09-29 21:55:51 +02:00
Hendrik Brueckner 7517f51ef9 s390: add personality support
Introduce personality support for Linux on z Systems to run
particular services with a 64-bit or 31-bit personality.
2015-09-24 13:03:18 +02:00
Kay Sievers a13cff19ce pam: systemd-user - call selinux module
https://bugzilla.redhat.com/show_bug.cgi?id=1262933
2015-09-22 17:54:13 +02:00
Lennart Poettering 85fade1edb Merge pull request #986 from karelzak/monitor
mount: use libmount to monitor mountinfo & utab
2015-09-22 14:31:58 +02:00
Alban Crequy 287419c119 containers: systemd exits with non-zero code
When a systemd service running in a container exits with a non-zero
code, it can be useful to terminate the container immediately and get
the exit code back to the host, when systemd-nspawn returns. This was
not possible to do. This patch adds the following to make it possible:

- Add a read-only "ExitCode" property on PID 1's "Manager" bus object.
  By default, it is 0 so the behaviour stays the same as previously.
- Add a method "SetExitCode" on the same object. The method fails when
  called on baremetal: it is only allowed in containers or in user
  session.
- Add support in systemctl to call "systemctl exit 42". It reuses the
  existing code for user session.
- Add exit.target and systemd-exit.service to the system instance.
- Change main() to actually call systemd-shutdown to exit() with the
  correct value.
- Add verb 'exit' in systemd-shutdown with parameter --exit-code
- Update systemctl manpage.

I used the following to test it:

| $ sudo rkt --debug --insecure-skip-verify run \
|            --mds-register=false --local docker://busybox \
|            --exec=/bin/chroot -- /proc/1/root \
|            systemctl --force exit 42
| ...
| Container rkt-895a0cba-5c66-4fa5-831c-e3f8ddc5810d failed with error code 42.
| $ echo $?
| 42

Fixes https://github.com/systemd/systemd/issues/1290
2015-09-21 17:32:45 +02:00
Tom Gundersen 7b713b81c2 sd-ipv4{acd,ll}: add simple test programs
These programs should be run manually, typically two instances on a
veth pair to check conflict detection.

Both test programs take the ifname as input, the ACD also takes the
IP address to check, whereas LL (optionally) takes the seed, which
determines the sequence of IP addresses to try.
2015-09-18 15:14:43 +02:00
Tom Gundersen e3dca0089b sd-ipv4acd: introduce new library split out from sd-ipv4ll
This splits the Address Conflict Detection out of the Link Local
library so that we can reuse it for DHCP and static addresses in
the future.

Implements RFC5227.
2015-09-18 15:14:43 +02:00
Tom Gundersen 996d16975b sd-ipv4ll: filter out unwanted ARP packets in the kernel
We currently process every ARP packet, but we should only care about the ones
relating to our IP address.

Also rename ipv4ll helpers to apr-utils.[ch], and rework the helpers a bit.
2015-09-18 15:14:42 +02:00
Karel Zak d379d44255 mount: use libmount to monitor mountinfo & utab
The current implementation directly monitor /proc/self/mountinfo and
/run/mount/utab files. It's really not optimal because utab file is
private libmount stuff without any official guaranteed semantic.

The libmount since v2.26 provides API to monitor mount kernel &
userspace changes and since v2.27 the monitor is usable for
non-root users too.

This patch replaces the current implementation with libmount based
solution.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-14 09:12:31 +02:00
Lennart Poettering afc966e288 util: remove ring.[ch] + pty.[ch] and tests
This was used by consoled, which was removed, let's remove this too now.
2015-09-11 18:28:29 +02:00
Lennart Poettering 1d1423257a Makefile: fix gardel target 2015-09-09 23:05:46 +02:00
David Herrmann 23d08d1b2b build: prepare for v226
Bump version info and update NEWS for the upcoming release.
2015-09-08 13:31:57 +02:00
Lennart Poettering 2b5c04d59c nspawn: remove nspawn.h, it's empty now 2015-09-07 18:47:34 +02:00
Lennart Poettering ee64508006 nspawn: split out --uid= logic into nspawn-setuid.[ch] 2015-09-07 18:44:31 +02:00
Lennart Poettering b7103bc5f4 nspawn: split out machined registration code to nspawn-register.[ch] 2015-09-07 18:44:31 +02:00
Lennart Poettering 34829a324b nspawn: split out cgroup related calls into nspawn-cgroup.[ch] 2015-09-07 18:44:30 +02:00
Lennart Poettering 9a2a5625bf nspawn: split out network related code to nspawn-network.[ch] 2015-09-07 18:44:30 +02:00
Lennart Poettering 7a8f63251d nspawn: split all port exposure code into nspawn-expose-port.[ch] 2015-09-07 18:44:30 +02:00
Lennart Poettering e83bebeff7 nspawn: split out mount related functions into a new nspawn-mount.c file 2015-09-07 18:44:30 +02:00
Lennart Poettering f757855e81 nspawn: add new .nspawn files for container settings
.nspawn fiels are simple settings files that may accompany container
images and directories and contain settings otherwise passed on the
nspawn command line. This provides an efficient way to attach execution
data directly to containers.
2015-09-06 01:49:06 +02:00
Tom Gundersen 4a316c44aa Merge pull request #1055 from poettering/dhcp-updates
Various networkd and dhcp updates
2015-08-27 21:38:36 +02:00
Lennart Poettering fc2f9534d0 networkd: split up networkd.h into per-object header files
No functional changes, just moving definitions into separate header
files.
2015-08-27 14:01:23 +02:00
Kay Sievers fd5a461316 hwdb: update 2015-08-26 18:38:30 +02:00
Kay Sievers 1aa28c9521 build-sys: bump versions 2015-08-26 16:09:17 +02:00
Lennart Poettering d5972272d2 Merge pull request #888 from keszybz/completions-optional
build-sys: allow skipping installation of completions
2015-08-06 10:18:57 +03:00
Zbigniew Jędrzejewski-Szmek 73974f6768 Merge branch 'hostnamectl-dot-v2'
Manual merge of https://github.com/systemd/systemd/pull/751.
2015-08-05 21:02:41 -04:00
Zbigniew Jędrzejewski-Szmek 8fb4944358 hostname-util: add relax parameter to hostname_is_valid
Tests are modified to check behaviour with relax and without relax.
New tests are added for hostname_cleanup().
Tests are moved a new file (test-hostname-util) because there's
now a bunch of them.

New parameter is not used anywhere, except in tests, so there should
be no observable change.
2015-08-05 20:49:20 -04:00
Zbigniew Jędrzejewski-Szmek a5ba84b7f2 build-sys: allow skipping installation of completions
./configure --with-bashcompletiondir=no or --without-bashcompletiondir
now works as expected. Similarly for zsh.

https://github.com/systemd/systemd/issues/533
2015-08-05 20:16:34 -04:00
Daniel Mack da8ba7219a test: add test for static lists
Test af-list and arphdr-list.
2015-07-31 19:58:27 +02:00
David Herrmann 11811e856b build: bump version to 224
Prepare for bug-fix release and bump versions.
2015-07-31 18:13:57 +02:00