Subject: bug#31498: [PATCH] Notify systemd in daemon-initialized and kill-emacs

From: Noam Postavsky <[email-masked]>
Date: Sat, 09 Jun 2018 08:29:22 -0400

> >> I think it should have a NEWS entry mentioning that Emacs now supports
> >> this systemd notification feature.  I would probably go ahead and
> >> combine with #31521, since it's using the same feature.
> >> 
> >
> > Do you mean, announce both in this patch, or completely merge that patch
> > into this one?

> The latter (maybe it would have been clearer to put those two sentences
> in separate paragraphs).

I think I still managed to be unclear about this; I meant you should
both announce the change in etc/NEWS, and merge the patches.

Lucas Werkmeister <[email-masked]> writes:

> With --[bg-]daemon and Type=forking, systemd will only consider the
> daemon to have fully started up once the original process exits, and
> will wait until then to start units depending on the Emacs service.  To
> get the same functionality with --fg-daemon, use Type=notify instead of
> Type=simple and explicitly send a readiness notification to systemd at
> the point where the forked process would in --bg-daemon mode notify its
> parent process and cause it to exit.  Similarly, notify systemd at the
> beginning of the shutdown process as well.  (Both of these calls are
> successful no-ops if emacs was not started by systemd.)
> * etc/emacs.service: Update Type.
> * src/emacs.c (daemon-initialized): Call sd_notify().
> * src/emacs.c (kill-emacs): Call sd_notify().

Thanks, I think I still managed to be unclear about the