On Mon, Dec 30, 2013 at 9:43 AM, Tollef Fog Heen <firstname.lastname@example.org> wrote:
>> If this is not required by systemd, why is it done by sd_notify ?
> It's not.
You obviously did not read the code. It is. Here is a G+ convo with
Lennart I had:
> As a sender you only have to set SCM_CREDENTIALS manually if you
> want to fake it (for which you need privs however).
sd_notify() basically impersonates the process. You only need to set
SCM manually if you are writing an external library. If someone is
just doing it in the daemon, the kernel will set SCM_CREDENTIALS
You seem to be confusing systemd-notify(1) with sd_notify(3).
sd_notify(3) is the library call that's called by the daemon itself.
systemd-notify(1) is a command line tool to «Notify service manager
about start-up completion and other daemon status changes».