b26fa1a2fbcfee7d03b0c8fd15ec3aa64ae70b9f |
|
10-Feb-2016 |
Daniel Mack <daniel@zonque.org> |
tree-wide: remove Emacs lines from all files
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file. |
4afd3348c7506dd1d36305b7bcb9feb8952b9d6b |
|
27-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy
GLIB has recently started to officially support the gcc cleanup
attribute in its public API, hence let's do the same for our APIs.
With this patch we'll define an xyz_unrefp() call for each public
xyz_unref() call, to make it easy to use inside a
__attribute__((cleanup())) expression. Then, all code is ported over to
make use of this.
The new calls are also documented in the man pages, with examples how to
use them (well, I only added docs where the _unref() call itself already
had docs, and the examples, only cover sd_bus_unrefp() and
sd_event_unrefp()).
This also renames sd_lldp_free() to sd_lldp_unref(), since that's how we
tend to call our destructors these days.
Note that this defines no public macro that wraps gcc's attribute and
makes it easier to use. While I think it's our duty in the library to
make our stuff easy to use, I figure it's not our duty to make gcc's own
features easy to use on its own. Most likely, client code which wants to
make use of this should define its own:
#define _cleanup_(function) __attribute__((cleanup(function)))
Or similar, to make the gcc feature easier to use.
Making this logic public has the benefit that we can remove three header
files whose only purpose was to define these functions internally.
See #2008. |
e1427b138fbf7b7f13bb61187635b882be3ca2b2 |
|
09-Nov-2015 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: apply errno.cocci
with small manual cleanups for style. |
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out allocation calls into alloc-util.[ch] |
a09561746f15b84da9471b5c4be74e53d19e4f3f |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: introduce dirent-util.[ch] for directory entry calls
Also, move a couple of more path-related functions to path-util.c. |
3ffd4af22052963e7a29431721ee204e634bea75 |
|
25-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out fd-related operations into fd-util.[ch]
There are more than enough to deserve their own .c file, hence move them
over. |
fbe550738d03b178bb004a1390e74115e904118a |
|
24-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
machined: introduce pseudo-machine ".host" refererring to the host system
Some of the operations machined/machinectl implement are also very
useful when applied to the host system (such as machinectl login,
machinectl shell or machinectl status), hence introduce a pseudo-machine
by the name of ".host" in machined that refers to the host system, and
may be used top execute operations on the host system with.
This copies the pseudo-image ".host" machined already implements for
image related commands.
(This commit also adds a PK privilege for opening a PTY in a container,
which was previously not accessible for non-root.) |
b9a8d250810d4803bc9bf6b36932b528cb991d1e |
|
24-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
machined: validate machine names at more places
When enumerating machines from /run, and when accepting machine names
for operations, be more strict and always validate.
Note that these checks are strictly speaking unnecessary, since
enumeration happens only on the trusted /run... |
25300b5a1fcf54674a69d0f4ab08925be00b0227 |
|
24-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
util: make machine_name_is_valid() a macro and move it to hostname-util.h
As it turns out machine_name_is_valid() does the exact same thing as
hostname_is_valid() these days, as it just invoked that and checked the
name length was < 64. However, hostname_is_valid() checks the length
against HOST_NAME_MAX anyway (which is 64 on Linux), hence any
additional check is redundant.
We hence replace machine_name_is_valid() by a macro that simply maps it
to hostname_is_valid() but sets the allow_trailing_dot parameter to
false. We also move this this call to hostname-util.h, to the same place
as the hostname_is_valid() declaration. |
3e044c492e3ebe64f4e3175c94f9db8a62557b82 |
|
17-Aug-2015 |
Markus Elfring <elfring@users.sourceforge.net> |
Bug #944: Deletion of unnecessary checks before a few calls of systemd functions
The following functions return immediately if a null pointer was passed.
* calendar_spec_free
* link_address_free
* manager_free
* sd_bus_unref
* sd_journal_close
* udev_monitor_unref
* udev_unref
It is therefore not needed that a function caller repeats a corresponding check.
This issue was fixed by using the software Coccinelle 1.0.1. |
49f3fffd94591bdf2bd6c2233a9300daeab79566 |
|
06-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
machined: rework state tracking logic for machines
This splits up the stopping logic for machines into two steps: first on
machine_stop() we begin with the shutdown of a machine by queuing the
stop method call for it. Then, in machine_finalize() we actually remove
the rest of its runtime context. This mimics closely how sessions are
handled in logind.
This also reworks the GC logic to strictly check the current state of
the machine unit, rather than shortcutting a few cases, like for example
assuming that UnitRemoved really means a machine is gone (which it isn't
since Reloading might trigger it, see #376).
Fixes #376. |
72c0a2c255b172ebbb2a2b7dab7c9aec4c9582d9 |
|
15-Jun-2015 |
Lennart Poettering <lennart@poettering.net> |
everywhere: port everything to sigprocmask_many() and friends
This ports a lot of manual code over to sigprocmask_many() and friends.
Also, we now consistly check for sigprocmask() failures with
assert_se(), since the call cannot realistically fail unless there's a
programming error.
Also encloses a few sd_event_add_signal() calls with (void) when we
ignore the return values for it knowingly. |
24882e06c135584f16f31ba8a00fecde8b7f6fad |
|
29-May-2015 |
Lennart Poettering <lennart@poettering.net> |
util: split out signal-util.[ch] from util.[ch]
No functional changes. |
11b90e69e5620c2483b019340eff121d504db115 |
|
28-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
machined: make PropertiesChanged match more strict |
6482f6269c87d2249e52e889a63adbdd50f2d691 |
|
10-Apr-2015 |
Ronny Chevalier <chevalier.ronny@gmail.com> |
shared: add formats-util.h |
2eec67acbb00593e414549a7e5b35eb7dd776b1b |
|
23-Feb-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
remove unused includes
This patch removes includes that are not used. The removals were found with
include-what-you-use which checks if any of the symbols from a header is
in use. |
0370612e0522191f929e3feb7d4937fff3d421e2 |
|
17-Feb-2015 |
Lennart Poettering <lennart@poettering.net> |
machined: make "machinectl copy-to" and "machinectl copy-from" server side operations
This way, any bus client can make use of these calls. |
1ddb263d21099ae42195c2bc382bdf72a7f24f82 |
|
28-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
machined: don't look for images on each property get, but cache the image object inbetween |
d04c1fb8e215600b4950c6778c6c16ddafc14024 |
|
23-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
machined: introduce polkit for OpenLogin() call
This way "machinectl login" can be opened up to run without privileges. |
ebeccf9eecf5939a2ef772c3160e89efcad96194 |
|
19-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
machined: add a full bus object for images |
56f64d95763a799ba4475daf44d8e9f72a1bd474 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: use log_*_errno whenever %m is in the format string
If the format string contains %m, clearly errno must have a meaningful
value, so we might as well use log_*_errno to have ERRNO= logged.
Using:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/'
Plus some whitespace, linewrap, and indent adjustments. |
f647962d64e844689f3e2acfce6102fc47e76df2 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: yet more log_*_errno + return simplifications
Using:
find . -name '*.[ch]' | while read f; do perl -i.mmm -e \
'local $/;
local $_=<>;
s/(if\s*\([^\n]+\))\s*{\n(\s*)(log_[a-z_]*_errno\(\s*([->a-zA-Z_]+)\s*,[^;]+);\s*return\s+\g4;\s+}/\1\n\2return \3;/msg;
print;'
$f
done
And a couple of manual whitespace fixups. |
da927ba997d68401563b927f92e6e40e021a8e5c |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: no need to negate errno for log_*_errno()
It corrrectly handles both positive and negative errno values. |
0a1beeb64207eaa88ab9236787b1cbc2f704ae14 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: auto-convert the simple cases to log_*_errno()
As a followup to 086891e5c1 "log: add an "error" parameter to all
low-level logging calls and intrdouce log_error_errno() as log calls
that take error numbers", use sed to convert the simple cases to use
the new macros:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/'
Multi-line log_*() invocations are not covered.
And we also should add log_unit_*_errno(). |
c34255bdb217c2a1d3ac6348252437ab8be9ca46 |
|
23-Oct-2014 |
Lennart Poettering <lennart@poettering.net> |
label: unify code to make directories, symlinks |
d5099efc47d4e6ac60816b5381a5f607ab03f06e |
|
15-Sep-2014 |
Michal Schmidt <mschmidt@redhat.com> |
hashmap: introduce hash_ops to make struct Hashmap smaller
It is redundant to store 'hash' and 'compare' function pointers in
struct Hashmap separately. The functions always comprise a pair.
Store a single pointer to struct hash_ops instead.
systemd keeps hundreds of hashmaps, so this saves a little bit of
memory. |
4cb40606785c30710bcf39bba33167bee66ad0bd |
|
08-Sep-2014 |
Dave Reisner <dreisner@archlinux.org> |
machined: remove redundant sd_notify
We already call this on via bus_event_loop_with_idle on exit. This
makes machined consistent with other similar daemons: localed,
hostnamed, timedated. |
af4ec4309e8f82aad87a8d574785c12f8763d5f8 |
|
21-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
notify: send STOPPING=1 from our daemons |
de0671ee7fe465e108f62dcbbbe9366f81dd9e9a |
|
15-May-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Remove unnecessary casts in printfs
No functional change expected :) |
19befb2d5fc087f96e40ddc432b2cc9385666209 |
|
15-May-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: introduce sd_bus_slot objects encapsulating callbacks or vtables attached to a bus connection
This makes callback behaviour more like sd-event or sd-resolve, and
creates proper object for unregistering callbacks.
Taking the refernce to the slot is optional. If not taken life time of
the slot will be bound to the underlying bus object (or in the case of
an async call until the reply has been recieved). |
b87633c4b20e3221748d6c98336cf6c85123cd66 |
|
11-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
machined: fix enumeration of existing machines on restart |
d9e34bfda3d34dcde00a876cb052e7de0655e1cb |
|
19-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
machined: implement exit-on-idle |
5bb658a1784a0fd4f0f32adb4b1fb636ff503f7d |
|
12-Dec-2013 |
Kay Sievers <kay@vrfy.org> |
bus: remove explicit activator-specific flags, the kdbus supports it now |
d90bb66996f5e3e9b6987e60980ff721b6fc2aff |
|
12-Dec-2013 |
Kay Sievers <kay@vrfy.org> |
bus: add SD_BUS_NAME_REPLACE_EXISTING to all activatable services, fix one flags conversion |
29a07cdb4a317f2e1ea160b79bfe6eb1be2e6e01 |
|
12-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
bus: instead of exposing the dbus1 flags when acquiring a name use our own that are closer to kdbus
This turns around DO_NOT_QUEUE into QUEUE which implies a more useful
default. (And negative options are awful anyway.) |
cde93897cdefdd7c7f66c400a61e42ceee5f6a46 |
|
11-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
event: hook up sd-event with the service watchdog logic
Adds a new call sd_event_set_watchdog() that can be used to hook up the
event loop with the watchdog supervision logic of systemd. If enabled
and $WATCHDOG_USEC is set the event loop will ping the invoking systemd
daemon right after coming back from epoll_wait() but not more often than
$WATCHDOG_USEC/4. The epoll_wait() will sleep no longer than
$WATCHDOG_USEC/4*3, to make sure the service manager is called in time.
This means that setting WatchdogSec= in a .service file and calling
sd_event_set_watchdog() in your daemon is enough to hook it up with the
watchdog logic. |
e7176abbe818c75c6acd90227a7a84c3e05fee31 |
|
03-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
bus: make sd_bus_request_name() and sd_bus_release_name() behave more like other calls
Instead of returning an enum of return codes, make them return error
codes like kdbus does internally.
Also, document this behaviour so that clients can stick to it.
(Also rework bus-control.c to always have to functions for dbus1 vs.
kernel implementation of the various calls.) |
76b543756ef69ce69784d571aefe8de65eaeb331 |
|
12-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
bus: introduce concept of a default bus for each thread and make use of it everywhere
We want to emphasize bus connections as per-thread communication
primitives, hence introduce a concept of a per-thread default bus, and
make use of it everywhere. |
afc6adb5ec7e73bc13156c43f52fb015cd80cc68 |
|
12-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
bus: introduce concept of a "default" event loop per-thread and make use of it everywhere
Try to emphasize a bit that there should be a mapping between event
loops and threads, hence introduce a logic that there's one "default"
event loop for each thread, that can be queried via
"sd_event_default()". |
ab49725fd8587ef2b90dd0a67b2c915bc772d089 |
|
07-Nov-2013 |
Kay Sievers <kay@vrfy.org> |
machine: move symbols referenced by shared code from main to shared file
With --enable-address-sanitizer we get:
machined-dbus.c:228: undefined reference to 'manager_add_machine' |
d3e84ddb885e9d5f0ae9930eb905910e3a81f157 |
|
06-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
machined: keep track of the initial leader PID of a machine
This way we can without races always determine the machine for a leader
PID. This allows machine managers to query the machine for a forked off
container/VM without a race where the child might already have died
before we could read the cgroup information from /proc/$PID/cgroup. |
a658cafa98ab55ea948c29bc87eb3945d515fb41 |
|
05-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
machined: simplifications |
c335068380fe8c9d843cdb2cf8a00f822cfabed3 |
|
30-Oct-2013 |
Lennart Poettering <lennart@poettering.net> |
machined: port over to libsystemd-bus |
71fda00f320379f5cbee8e118848de98caaa229d |
|
14-Oct-2013 |
Lennart Poettering <lennart@poettering.net> |
list: make our list macros a bit easier to use by not requring type spec on each invocation
We can determine the list entry type via the typeof() gcc construct, and
so we should to make the macros much shorter to use. |
bd16acf35e13a19cd2ded0a0c2ef774a98f73808 |
|
26-Sep-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Move functions around to fix underlinking in test-machine-tables |
554604b3073467af75dc94fac9e2343148603289 |
|
11-Jul-2013 |
Lennart Poettering <lennart@poettering.net> |
machined: forward scope properties array from client to systemd
This makes nspawn's --scope= switch work again. |
6797c324a653f119a3d7133122648aaa4878ddd6 |
|
10-Jul-2013 |
Lennart Poettering <lennart@poettering.net> |
logind: don't misunderstand UnitRemoved signals during reloading
When PID 1 reloads the units logind/machined will see UnitRemoved
signals for all units. Instead of trusting these immediately, let's
check the actual unit state before considering a unit gone, so that
reloading PID 1 is not mistaken as the end of all sessions. |
943aca8efb39453e3994ccdd1e08534b788c5aee |
|
03-Jul-2013 |
Lennart Poettering <lennart@poettering.net> |
logind/machined: properly notice when units are gc'ed |
aba8b84e8d72224445b67646974b9dabc0972187 |
|
02-Jul-2013 |
Dave Reisner <dreisner@archlinux.org> |
machined: check correct return value for NULL |
1ee306e1248866617c96ed9f4263f375588ad838 |
|
02-Jul-2013 |
Lennart Poettering <lennart@poettering.net> |
machined: split out machine registration stuff from logind
Embedded folks don't need the machine registration stuff, hence it's
nice to make this optional. Also, I'd expect that machinectl will grow
additional commands quickly, for example to join existing containers and
suchlike, hence it's better keeping that separate from loginctl. |