Commit graph

23205 commits

Author SHA1 Message Date
Lennart Poettering d8e023aa07 core: expose number of file descriptors in fd store on the bus
For each service expose how many file descriptors there are currently in
the fd store.

(Also, fix the exporting of the fdstore limit, given that the field is
just an "unsigned" but we exported it as "uint32_t". Not that there way
any effective difference, but let's make this clean...)
2015-11-02 23:44:05 +01:00
Lennart Poettering 934ae16baf proc-cmdline: return proper errors from shall_restore_state()
Let's not eat up errors in shall_restore_state(), but in the consumers
instead, just for the sake of keeping the library calls generic.
2015-11-02 23:44:05 +01:00
Lennart Poettering 19854865a8 core: bump net.unix.max_dgram_qlen really early during boot
Only that way it actually has an effect on all our sockets, including
$NOTIFY_SOCKET.
2015-11-02 23:44:05 +01:00
Ronny Chevalier 3342582deb Merge pull request #1757 from phomes/minor-fixes
Minor fixes
2015-11-02 23:27:49 +01:00
Thomas Hindoe Paaboel Andersen 859fdd1eea sysv-generator: remove duplicate const
I assume this was a typo in c279613f86
2015-11-02 23:18:20 +01:00
Thomas Hindoe Paaboel Andersen f2c624cb8b man: various typos 2015-11-02 23:18:20 +01:00
Lennart Poettering 9fe4ea21be string-util: rework memory_erase() so that it cannot be optimized away
memory_erase() so far just called memset(), which the compiler might
optimize away under certain conditions if it feels there's benefit in
it. C11 knows a new memset_s() call that is like memset(), but may not
be optimized away. Ideally, we'd just use that call, but glibc currently
does not support it. Hence, implement our own simplistic version of it.

We use a GCC pragma to turn off optimization for this call, and also use
the "volatile" keyword on the pointers to ensure that gcc will use the
pointers as-is. According to a variety of internet sources, either one
does the trick. However, there are also reports that at least the
volatile thing isn't fully correct, hence let's add some snake oil and
employ both techniques.

https://news.ycombinator.com/item?id=4711346
2015-11-02 23:07:20 +01:00
Lennart Poettering 5732a7dbb0 Merge pull request #1690 from evverx/run-runtime-directory
systemd-run can launch units with RuntimeDirectory
2015-11-02 20:16:18 +01:00
Lennart Poettering 3e66a83cc3 Merge pull request #1736 from ronnychevalier/rc/test_execute_more_tests2
test-execute: add more tests
2015-11-02 20:06:48 +01:00
Lennart Poettering 88cee0cf9c Merge pull request #1753 from fbuihuu/teach-delegate-for-runtime
Teach bus_append_unit_property_assignment() about 'Delegate' property
2015-11-02 19:52:00 +01:00
Lennart Poettering a05207c1e8 Merge pull request #1755 from ssahani/word-systemctl
systemctl: port to extract_first_word
2015-11-02 19:50:51 +01:00
Susant Sahani 5ab22f3321 systemctl: port to extract_first_word 2015-11-02 21:47:40 +05:30
Martin Pitt 1d40ddbfd3 core: drop check for /etc/mtab
util-linux 2.27.1 now entirely stops looking at /etc/mtab, so we don't need to
verify /etc/mtab during early boot any more. Later on, tmpfiles.d/etc.conf will
fix /etc/mtab anyway, so there's not even a point in warning about it.

Drop test_mtab() and bump the util-linux dependency to >= 2.17.1.

Fixes #1495
2015-11-02 10:05:20 -06:00
Daniel Mack 0fc85c8670 Merge pull request #1751 from ssahani/word-machine
machine: fix #1739
2015-11-02 12:38:24 +01:00
Franck Bui ea1a971646 Teach bus_append_unit_property_assignment() about 'Delegate' property 2015-11-02 12:37:45 +01:00
Susant Sahani 52278ad31d machine: fix extract_first_word 2015-11-02 16:55:59 +05:30
Daniel Mack cb6762862b Merge pull request #1722 from evverx/port-cap-bounding-set-to-extract-first-word
Port capabiliy bounding set parsing to extract_first_word
2015-11-02 11:45:06 +01:00
Daniel Mack 117b94060d Merge pull request #1750 from systemd/revert-1740-master
Revert "utf8.[ch]: use char32_t and char16_t instead of int, int32_t,…
2015-11-02 11:31:10 +01:00
Daniel Mack 85e3351f79 Merge pull request #1725 from ssahani/word-journal
sd-journal.c: port to extract_first_word
2015-11-02 11:23:32 +01:00
Lennart Poettering dcd1262673 Revert "utf8.[ch]: use char32_t and char16_t instead of int, int32_t, int16_t" 2015-11-02 11:21:25 +01:00
Daniel Mack 6b61ae72fa Merge pull request #1739 from ssahani/word-machine
machine: : port to extract_first_word
2015-11-02 11:21:18 +01:00
Daniel Mack 86b4428a58 Merge pull request #1740 from shawnl/master
utf8.[ch]: use char32_t and char16_t instead of int, int32_t, int16_t
2015-11-02 10:57:38 +01:00
Daniel Mack 8fa7cf7076 Merge pull request #1738 from evverx/fix-paths-lookup-test
tests: lookup_paths_init depends on SYSTEMD_UNIT_PATH. Test it
2015-11-02 10:43:16 +01:00
Lennart Poettering ecad2e51e1 Merge pull request #1749 from zonque/cmsg
core: two trivial debug/error message improvements
2015-11-02 10:31:24 +01:00
Daniel Mack fba397e2af Merge pull request #1711 from mustrumr/network-use-after-free
network: fix use-after-free in link_free
2015-11-02 10:17:24 +01:00
Daniel Mack ec8c6b19da Merge pull request #1748 from karelzak/todo
update TODO
2015-11-02 10:16:04 +01:00
Daniel Mack 8ea823b60d core: be more verbose when NameOwnerChanged subscriptions fail 2015-11-02 10:14:35 +01:00
Daniel Mack 4b1728250d core: service: fix error message
The directive is called FileDescriptorStoreMax=, not FDStoreMax=.
2015-11-02 10:13:29 +01:00
Daniel Mack d0744e54eb Merge pull request #1745 from poettering/journal-deadlock
Make sure journald never blocks on sd_notify() to PID 1
2015-11-02 10:10:44 +01:00
Karel Zak 4c8965ad0a update TODO
- inotify utab has been removed and we use libmount now
- x-systemd.requires= fstab option has been implemented to specify
  dependencies in fstab
2015-11-02 09:59:27 +01:00
Lennart Poettering 3958325852 journal-remote: remove unused variable warning when building without GNUTLS. 2015-11-01 22:14:13 +01:00
Lennart Poettering e22aa3d328 journald: never block when sending messages on NOTIFY_SOCKET socket
Otherwise we might run into deadlocks, when journald blocks on the
notify socket on PID 1, and PID 1 blocks on IPC to dbus-daemon and
dbus-daemon blocks on logging to journald. Break this cycle by making
sure that journald never ever blocks on PID 1.

Note that this change disables support for event loop watchdog support,
as these messages are sent in blocking style by sd-event. That should
not be a big loss though, as people reported frequent problems with the
watchdog hitting journald on excessively slow IO.

Fixes: #1505.
2015-11-01 22:12:29 +01:00
Lennart Poettering 638b56cd3c sd-daemon: verify NOTIFY_SOCKET path length
Better generate a real error then simply connect to the wrong socket.
2015-11-01 21:49:19 +01:00
Shawn Landden 025b4c4105 utf8.[ch]: use char32_t and char16_t instead of int, int32_t, int16_t
rework C11 utf8.[ch] to use char32_t instead of uint32_t when referring
to unicode chars, to make things more expressive.
2015-10-31 21:00:57 -07:00
Susant Sahani 75a8fd6ac8 machine: : port to extract_first_word 2015-11-01 03:36:27 +05:30
Susant Sahani 7294bb5be2 sd-journal.c: port to extract_first_word 2015-11-01 03:32:45 +05:30
Evgeny Vereshchagin aa3e4400e3 man: MANAGER_SYSTEM understands SYSTEMD_UNIT_PATH too 2015-10-31 23:07:47 +03:00
Evgeny Vereshchagin 1b6a0f0b35 tests: lookup_paths_init depends on SYSTEMD_UNIT_PATH. Test it 2015-10-31 22:00:32 +03:00
Lennart Poettering a47806fafa sd-daemon: increase sd_notify() socket buffer size
Let's make sure we don't start blocking on sd_notify() earlier than
necessary, let's bump the socket buffer sizes to 8M.

We already do something similar for our logging socket buffers, hence
apply a similar bump here.
2015-10-31 19:09:20 +01:00
Lennart Poettering cacea34bd1 sysctl.d: bump number of queueable AF_UNIX/SOCK_DGRAM datagrams
The default of 16 is pretty low, let's bump this to accomodate for more
queued datagrams. This is useful for AF_UNIX/SOCK_DGRAM logging and
sd_notify() sockets as this allows queuing more datagrams before things
start to block, thus improving parallelization and logging performance.
2015-10-31 19:09:20 +01:00
Lennart Poettering c279613f86 sysv-generator: modernize
- Make sure we log each error at least once, and at most once

- Replace FOREACH_WORD loops by extract_first_word() loops

- Use FOREACH_DIRENT() for directory loops

- Use free_and_strdup() where appropriate

- Do not operate on half-loaded SysV files

- Always properly free all memory
2015-10-31 19:09:20 +01:00
Lennart Poettering a1a078eef2 core: bail our earlier when doing audit
Let's make sure we don't even try to create the audit socket
2015-10-31 19:09:20 +01:00
Lennart Poettering 97044145b4 core,nspawn: minor coding style fixes 2015-10-31 19:09:20 +01:00
Lennart Poettering 3c747da38c nspawn: fix minor memory leak
When rebooting nspawn containers about 400 times we'd otherwise hit the
fd limit and refuse further reboots.
2015-10-31 19:09:20 +01:00
Lennart Poettering 96d66d89c9 core: constify a few things 2015-10-31 19:09:20 +01:00
Lennart Poettering b41b9d2ae9 systemctl: add a way to explicitly request client-side unit installing
This adds support for a new environment variable
SYSTEMCTL_INSTALL_CLIENT_SIDE, that ensures that systemctl executes
install operations client-side instead of passing them to PID1. This is
useful in debugging situations, but even beyond that. However, we don't
want to make it official API, hence let's just make it an undocumented
environment variable.

Similar, add a second variable, SYSTEMCTL_SKIP_SYSV which allows
skipping the SysV chkconfig fall-back if set. This is useful for similar
reasons, and exposed as undocumented as environment variable for similar
reasons, too.
2015-10-31 19:09:20 +01:00
Ronny Chevalier 534e8f89d6 Merge pull request #1734 from evverx/overwrite-sysemd-unit-path
core: set_unit_path overwrites SYSTEMD_UNIT_PATH
2015-10-31 17:22:20 +01:00
Ronny Chevalier aa8e00da54 test-path: move all related test files to a specific directory
To avoid polluting test/
2015-10-31 15:07:19 +01:00
Ronny Chevalier ac40081621 test-execute: move all files related to a specific directory
To avoid polluting test/
2015-10-31 15:07:19 +01:00
Ronny Chevalier 7d0f09a932 build-sys: add missing test files to EXTRA_DIST 2015-10-31 15:07:19 +01:00