caffe412c77a662f7b856109e588b03817acc36e |
|
03-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
sd-daemon: explicitly filter out -1 when parsing watchdog timeout
We already filter out 0, and as -1 is usually special (meaning infinity,
as in USEC_INFINITY) we should better not accept it either. Better safe
than sorry... |
a47806fafaec9a52a80e1795ad880b9b5008c4b8 |
|
31-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
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. |
40f44238924acf4e7a3ddfc1b0b1c111032bb43d |
|
12-Oct-2015 |
Daniel Mack <daniel@zonque.org> |
sd-daemon: wipe out memory before using CMSG_NXTHDR()
CMSG_NXTHDR() checks for cmsg->cmsg_len *after* it increased the pointer.
While this makes sense for parsing received messages, that's a pitfall
for code crafting messages with this macro.
Wipe out the allocated memory to fix this. |
0260d1d542da73b3358fa659fb1fa634badbf00e |
|
30-Sep-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
sd-daemon: fix sd_is_mq for non-mq fds
mq_getattr returns -1/EBADF for file descriptors which are not mq.
But we should return 0 in this case.
We first check that fd is a valid fd, so we can assume that if
mq_getattr returns EBADF, it is simply a non-mq fd. There is a slight
race, but there doesn't seem to be a nice way to fix it. |
a354329f724d6ce913d2ccffb2be8f3327a67faa |
|
06-Jan-2015 |
Lennart Poettering <lennart@poettering.net> |
core: add new logic for services to store file descriptors in PID 1
With this change it is possible to send file descriptors to PID 1, via
sd_pid_notify_with_fds() which PID 1 will store individually for each
service, and pass via the usual fd passing logic on next invocation.
This is useful for enable daemon reload schemes where daemons serialize
their state to /run, push their fds into PID 1 and terminate, restoring
their state on next start from the data in /run and passed in from PID
1.
The fds are kept by PID 1 as long as no POLLHUP or POLLERR is seen on
them, and the service they belong to are either not dead or failed, or
have a job queued. |
a9becdd65bb4b64675bc0c109d14ab12b1ecd2b7 |
|
23-Oct-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
sd-daemon,man: ignore missing $WATCHDOG_PID
Systemd 209 started setting $WATCHDOG_PID, and sd-daemon watch was
modified to check for this variable. This means that
sd_watchdog_enabled() stopped working with previous versions of
systemd. But sd-event is a public library and API and we must keep it
working even when a program compiled with a newer version of the
libary is used on a system running an older version of the manager.
getenv() and unsetenv() are fairly expensive calls, so optimize
sd_watchdog_enabled() by not calling them when unnecessary.
man: centralize the description of $WATCHDOG_PID and $WATCHDOG_USEC in
the sd_watchdog_enabled manpage. It is better not to repeat the same
stuff in two places. |
be8f4e9e8eb3b0c34a49c2e80a5c5b7dc6d175f0 |
|
05-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-daemon: introduce sd_pid_notify() and sd_pid_notifyf()
sd_pid_notify() operates like sd_notify(), however operates on a
different PID (for example the parent PID of a process).
Make use of this in systemd-notify, so that message are sent from the
PID specified with --pid= rather than the usually shortlived PID of
systemd-notify itself.
This should increase the likelyhood that PID 1 can identify the cgroup
that the notification message was sent from properly. |