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

22482 Commits

Author SHA1 Message Date
Lennart Poettering
f6c2284ad3 util.h: order includes, as suggested by CODING_STYLE
Of course, because Linux is broken we cannot actually really order it,
and must keep linux/fs.h after sys/mount.h... Yay for Linux!
2015-09-22 16:31:19 +02:00
Lennart Poettering
8c721f2bcb util: clean-ups to enum parsers
Never log when we fail due to OOM when translating enums, let the caller
do that. Translating basic types like enums should be something where
the caller logs, not the translatior functions.

Return -1 when NULL is passed to all enum parser functions.

The non-fallback versions of the enum translator calls already handle
NULL as failure, instead of hitting an assert, and we should do this
here, too.
2015-09-22 16:31:10 +02:00
Lennart Poettering
08edf879ed cgtop: make sure help text doesn't cause main contents to move
Let's always keep space for the full help text. (We used to do that, but
recently another line of help was added which broke this.)
2015-09-22 16:31:02 +02:00
Lennart Poettering
4fdae6c847 util: minor cleanups for loop_read() and friends
When 0 bytes are to be written, make sure to go into read() at least
once, in order to validate the parameters, such as the passed fd.

Return error on huge values, add a couple of asserts and casts where
appropriate.
2015-09-22 16:30:51 +02:00
Lennart Poettering
1fc464f6fb cgtop: underline table header
Let's underline the header line of the table shown by cgtop, how it is
customary for tables. In order to do this, let's introduce new ANSI
underline macros, and clean up the existing ones as side effect.
2015-09-22 16:30:42 +02:00
Lennart Poettering
3ade55d31b sd-id128: make size constraints a bit more obvious 2015-09-22 16:30:32 +02:00
Lennart Poettering
ed0d40229b util: add safe_closedir() similar to safe_fclose() 2015-09-22 16:30:24 +02:00
Lennart Poettering
f6d9c616b6 copy: make copy_bytes() return whether we hit EOF or not 2015-09-22 16:30:17 +02:00
Lennart Poettering
c622fbdb8d copy: be more careful when trying to reflink 2015-09-22 16:30:12 +02:00
Lennart Poettering
fa2f8973ad sd-bus: introduce new sd_bus_default_flush_close() call
If code enqueues a message on one of the default busses, but doesn't
sync on it, and immediately drops the reference to the bus again, it
will stay queued and consume memory. Intrdouce a new call
sd_bus_default_flush_close() that can be invoked at the end of programs
(or threads) and flushes out all unsent messages on any of the default
busses.
2015-09-22 16:29:10 +02:00
doubleodoug
fc4049c1ab login: support more than just power-gpio-key
Adding additional keys prevents this gpio-keys powerswitch from working,
e.g. this wouldn't poweroff:

button@23 {
    label = "power-switch";
    linux,code = <116>;
    gpios = <&gpio 23 1>;
};
button@25 {
    label = "KEY_A";
    linux,code = <30>;
    gpios = <&gpio 25 1>;
};

Changing ATTRS{keys}=="116" to ATTRS{keys}=="*116*" makes the
power-switch and the A key both work properly.

(David: rephrase and merge-commits)
2015-09-22 16:18:17 +02:00
Lennart Poettering
9c90e27767 Merge pull request #1333 from dvdhrm/sd-network-cleanup
sd-network: random API cleanups
2015-09-22 15:31:55 +02:00
David Herrmann
9ef61f2e48 sd-lldp: hide internal details
Currently, sd-lldp.h exports "UPDATE_INFO".. and defines it to a magic
constant '10'. This is completely bogus, so fix it to follow our coding
standards:

  - Prefix exported symbols by SD_LLDP_*

  - Define a separate event-enum for event types

  - Translate internal state to external event-types
2015-09-22 15:19:42 +02:00
David Herrmann
8955cf0a45 sd-lldp: hide internal information
Don't export constant that are only used internally.
2015-09-22 15:14:49 +02:00
David Herrmann
e4c3b8e856 sd-pppoe: fix namespacing
Prefix all exported constants by SD_PPPOE_* to avoid namespacing
conflicts.
2015-09-22 15:09:58 +02:00
David Herrmann
be19c5b5e0 sd-ipv4ll: fix namespacing
Prefix all exported constants with SD_IPV4LL_* to avoid namespacing
conflicts.
2015-09-22 15:08:28 +02:00
David Herrmann
2237aa02f3 sd-ipv4acd: fix namespacing
Prefix all exported constants with SD_IPV4ACD to prevent namespacing
conflicts.
2015-09-22 15:05:35 +02:00
David Herrmann
575ac4c62e sd-icmp6-nd: fix namespacing
Prefix all exported constants by SD_ICMP6_ND_* to avoid any namespacing
conflicts.
2015-09-22 15:01:55 +02:00
David Herrmann
10c9ce615d sd-dhcp6: fix namespacing
Prefix all exported constants with SD_DHCP6_CLIENT_* to avoid any
namespacing conflicts.
2015-09-22 14:52:23 +02:00
David Herrmann
0374814250 sd-dhcp: fix namespacing
Prefix all constants with SD_DHCP_CLIENT_* to avoid namespacing
conflicts.
2015-09-22 14:46:21 +02:00
Thomas Haller
f89087272b sd-dhcp6: ensure canceling lease timers and refactor setting lease
Factor our common code to set/clear the client lease.
Resetting the lease involves canceling old timers.

Also, most importantly, when resetting the lease
in client_receive_advertise(), ensure to cancel
the timers too. It is not immediately clear, why
at that point no timers would be pending.

The lease-unref from sd_dhcp6_client_unref() can
be omited, because of the preceeding client_reset()
call.
2015-09-22 14:41:47 +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
Lennart Poettering
29e71235c7 Merge pull request #1331 from dvdhrm/misc-cleanup
util, nspawn, machined: random cleanups
2015-09-22 14:30:09 +02:00
Krzesimir Nowak
c0ffce2bd1 nspawn, machined: fix comments and error messages
A bunch of "Client -> Child" fixes and one barrier-enumerator fix.

(David: rebased on master)
2015-09-22 14:17:03 +02:00
Krzesimir Nowak
327e26d689 nspawn: close unneeded sockets in outer child
(David: Note, this is just a cleanup and doesn't fix any bugs)
2015-09-22 14:11:44 +02:00
David Herrmann
d960371482 util: introduce {send,receive}_one_fd()
Introduce two new helpers that send/receive a single fd via a unix
transport. Also make nspawn use them instead of hard-coding it.

Based on a patch by Krzesimir Nowak.
2015-09-22 14:09:54 +02:00
Daniel Mack
c97e586d8a NEWS: add some information about v227 2015-09-22 13:30:12 +02:00
Pawel Szewczyk
15087cdbd6 core: Add list of additional file descriptors to socket port
Some additional files related to single socket may appear in the
filesystem and they should be opened and passed to related service.

This commit adds optional list of file descriptors, which are
dynamically discovered and opened.
2015-09-22 12:01:53 +02:00
Lennart Poettering
8e112c803c Merge pull request #1323 from dvdhrm/mount-propagate
mount: propagate error codes correctly
2015-09-22 02:34:45 +02:00
Lennart Poettering
a45ad24e05 Merge pull request #1325 from splantefeve/fr-translation
po: update french translation
2015-09-22 01:05:27 +02:00
Sylvain Plantefève
88660ac6e8 po: update french translation 2015-09-22 00:25:13 +02:00
Tom Lyon
cf22cddcfd Fixup WWN bytes for big-endian systems 2015-09-21 14:36:32 -07:00
David Herrmann
0ac58d849f hwdb: fix typo in G9x DPI
Fix typo in DPI: 32000 -> 3200
2015-09-21 21:56:10 +02:00
David Herrmann
ed1236bed8 hwdb: drop weird whitespace
Remove whitespace from empty line in hwdb.
2015-09-21 20:19:23 +02:00
Daniel Mack
2eacee1e71 Merge pull request #1317 from ronnychevalier/rc/ipv4ll_seed
sd-ipv4ll: do not assert_return when seed == 0
2015-09-21 20:05:18 +02:00
David Herrmann
7ff307bc4c mount: propagate error codes correctly
Make sure to propagate error codes from mount-loops correctly. Right now,
we return the return-code of the first mount that did _something_. This is
not what we want. Make sure we return an error if _any_ mount fails (and
then make sure to return the first error to not hide proper errors due to
consequential errors like -ENOTDIR).

Reported by cee1 <fykcee1@gmail.com>.
2015-09-21 20:03:24 +02:00
Daniel Mack
dd2c1128db Merge pull request #1322 from evverx/update-systemd-cgtop-bash-completion
Update systemd-cgtop bash completion
2015-09-21 19:43:49 +02:00
Evgeny Vereshchagin
a2accacb98 shell-completion: cgtop bash completion: add -r,--raw,-k,-P,--order 2015-09-21 17:33:00 +00:00
Evgeny Vereshchagin
79af4b6c1c shell-completion: cgtop bash completion: -n,--iterations,-d,--delay require arg 2015-09-21 17:09:40 +00:00
Lennart Poettering
de45f28e09 Merge pull request #1249 from lnykryn/sysv-symlinks
sysv-generator: follow symlinks in /etc/rc.d/init.d
2015-09-21 19:00:28 +02:00
Lennart Poettering
acf0813d21 Merge pull request #1321 from evverx/cgtop-recurisive-option
shell-completion: update systemd-cgtop bash completion: --recursive
2015-09-21 18:59:38 +02:00
Evgeny Vereshchagin
73b73b762c shell-completion: update systemd-cgtop bash completion: --recursive 2015-09-21 16:54:58 +00:00
Lennart Poettering
f1f679c5b6 Merge pull request #1320 from ronnychevalier/rc/core_fix_group_ownership
core: fix group ownership when Group is set
2015-09-21 18:21:53 +02:00
Ronny Chevalier
5bc7452b32 core: fix group ownership when Group is set
When Group is set in the unit, the runtime directories are owned by
this group and not the default group of the user (same for cgroup paths
and standard outputs)

Fix #1231
2015-09-21 18:14:44 +02:00
Ronny Chevalier
cc3ddc851f test-execute: add tests for RuntimeDirectory 2015-09-21 18:14:44 +02:00
Lennart Poettering
35bb18851a Merge pull request #1315 from systemd-mailing-devs/1442692671-10134-1-git-send-email-dev@benjarobin.fr
systemd-notify: Always pass a valid pid to sd_pid_notify
2015-09-21 18:10:49 +02:00
Alban Crequy
0c5c00f6ef Merge pull request #1318 from alban/alban/container-exit-code4
containers: systemd exits with non-zero code
2015-09-21 17:51:21 +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
Ronny Chevalier
5625be76c7 test-ipv4ll: use unsigned instead of an array for a seed
ipv4ll use an unsigned instead of an uint8_t array. Hence, use an
unsigned seed instead of declaring an array and then dereferencing it
later.
2015-09-21 16:52:52 +02:00
Ronny Chevalier
56065db421 sd-ipv4ll: do not assert_return when seed == 0
Now that seed is an unsigned and not an array, we do not need to assert
on it.
2015-09-21 16:52:52 +02:00