My two cents is feature can be implemented as long as we get support from the application. For example sd-event has the builtin support to quit when it is idle. Systemd can pass the exit-on-idle timeout to the application via env variables so the event loop can configure itself to quit.
I am not sure if glib event loop has this functionality already but I would be very interested to have it. I am just waiting for kdbus. Exiting on non-kdbus is still racy if we don't let systemd know upfront. Umut On Mon, Apr 20, 2015 at 5:10 PM, Lennart Poettering <lenn...@poettering.net> wrote: > On Mon, 20.04.15 23:56, WaLyong Cho (walyong....@samsung.com) wrote: > >> If a service does not consume CPU during some time(can be configured >> by ExitOnIdleSec=) and set to stopped on idle state(ExitOnIdle=), the >> service will be stopped. This can be useful if the service provides >> some of activation methods. > > Hmm, I am not convinced this would be a good idea, sorry. > > The crux of the issue is that it is really hard to detect from the > outside if a daemon is really idle. Only the daemon itself knows > whether it is truly idle or not. I mean, it could just be waiting for > some timer to elapse, or some other external event. > > I doubt this is really useful unless you have really really simple > daemons that purely react on client requests and nothing else, and you > know the codebase and that it is OK to terminate the daemon just > because its CPU usage is zero. But if you know the codebase that well > it would probably be a better idea to just add support for > exit-on-idle directly to the daemon in question. > > exit-on-idle is really something that should be implemented *in* the > daemon, and not done externally! > > Sorry, > > Lennart > > -- > Lennart Poettering, Red Hat > _______________________________________________ > systemd-devel mailing list > systemd-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/systemd-devel _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel