Commit graph

25 commits

Author SHA1 Message Date
Michal Schmidt d5099efc47 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.
2014-09-15 16:08:50 +02:00
Dave Reisner 4cb4060678 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.
2014-09-08 09:29:36 -04:00
Lennart Poettering af4ec4309e notify: send STOPPING=1 from our daemons 2014-08-21 17:24:21 +02:00
Zbigniew Jędrzejewski-Szmek de0671ee7f Remove unnecessary casts in printfs
No functional change expected :)
2014-05-15 15:29:58 +02:00
Lennart Poettering 19befb2d5f 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).
2014-05-15 01:15:30 +02:00
Lennart Poettering b87633c4b2 machined: fix enumeration of existing machines on restart 2014-02-11 21:06:51 +01:00
Lennart Poettering d9e34bfda3 machined: implement exit-on-idle 2013-12-19 22:18:39 +01:00
Kay Sievers 5bb658a178 bus: remove explicit activator-specific flags, the kdbus supports it now 2013-12-12 20:27:23 +01:00
Kay Sievers d90bb66996 bus: add SD_BUS_NAME_REPLACE_EXISTING to all activatable services, fix one flags conversion 2013-12-12 06:41:23 +01:00
Lennart Poettering 29a07cdb4a 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.)
2013-12-12 05:55:58 +01:00
Lennart Poettering cde93897cd 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.
2013-12-11 18:20:09 +01:00
Lennart Poettering e7176abbe8 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.)
2013-12-03 18:02:46 +01:00
Lennart Poettering 76b543756e 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.
2013-11-12 00:12:43 +01:00
Lennart Poettering afc6adb5ec 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()".
2013-11-12 00:12:43 +01:00
Kay Sievers ab49725fd8 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'
2013-11-07 14:56:31 +01:00
Lennart Poettering d3e84ddb88 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.
2013-11-06 02:31:35 +01:00
Lennart Poettering a658cafa98 machined: simplifications 2013-11-05 01:13:05 +01:00
Lennart Poettering c335068380 machined: port over to libsystemd-bus 2013-10-30 02:08:57 +01:00
Lennart Poettering 71fda00f32 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.
2013-10-14 06:11:19 +02:00
Zbigniew Jędrzejewski-Szmek bd16acf35e Move functions around to fix underlinking in test-machine-tables 2013-09-26 11:12:04 +02:00
Lennart Poettering 554604b307 machined: forward scope properties array from client to systemd
This makes nspawn's --scope= switch work again.
2013-07-11 19:53:46 +02:00
Lennart Poettering 6797c324a6 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.
2013-07-10 23:41:03 +02:00
Lennart Poettering 943aca8efb logind/machined: properly notice when units are gc'ed 2013-07-03 15:14:47 +02:00
Dave Reisner aba8b84e8d machined: check correct return value for NULL 2013-07-02 13:44:50 -04:00
Lennart Poettering 1ee306e124 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.
2013-07-02 03:47:23 +02:00