Re: [RFC PATCH 4/4] tools/thermal: Add thermal daemon skeleton

From: srinivas pandruvada
Date: Mon Feb 14 2022 - 19:16:05 EST


On Tue, 2022-02-15 at 00:43 +0100, Daniel Lezcano wrote:
>
> Hi Srinivas,
>
> On 14/02/2022 23:34, srinivas pandruvada wrote:
> > On Mon, 2022-02-14 at 22:04 +0100, Daniel Lezcano wrote:
> > > This change provides a simple daemon skeleton. It provides an
> > > example
> > > of how to use the thermal library.
> > >
> > > The goal of this skeleton is to give a base brick for anyone
> > > interested in writing its own thermal engine.
> > >
> > > In the future, it will evolve with more features.
> > >
> >  From the code, doesn't seam to have a function to daemonize.
>
> Yes, it does, see below. If the stdout output is set, then it won't
> daemonize.
OK.

>
>
> > So may be not call a daemon if that is true. mainloop() is just an
> > infinite loop polling netlink messages.
> >
> > Also thermald will confuse with the standard thermald distributed
> > with
> > every distro. May be thermal_control_sample as this a sample for
> > future
> > development.
>
> Does thermal-engine fine ?
fine.

Thanks,
Srinivas

>
> > > Signed-off-by: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>
>
> [ ... ]
>
> > >   tools/thermal/thermald/thermald.c | 275
>
> [ ... ]
>
> > > +       if (!(options.logopt & TO_STDOUT) && daemon(0, 0))
> > > +               return 1;
>
> [ ... ]
>