On Sun, 16 Aug 2020 09:58:51 +0200
aitor <aitor_czr@???> wrote:
> Hi,
>
> On 28/7/20 11:08, aitor wrote:
> >
> > Hi,
> >
> > On 24/3/20 23:00, aitor_czr wrote:
> >> On 3/3/20 15:26, aitor wrote:
> >>> I removed the MAC Address so far because it's giving me a
> >>> segmentation fault. I hope to fix this issue shortly.
> >> The issue has been solved replacing the standard C sprintf() by
> >> g_strdup_printf() in the "netproc.c" file, which is similar
> >> to the first one but safer.So, the backend of simple-netaid will
> >> depend on glib-2.0 until a new solution is found.
> >
> > I'm pushing the new code of simple-netaid to gitlab:
> >
> > https://git.devuan.org/aitor_czr/libnetaid
> >
> > Any feedback is welcome,
> >
> > Aitor.
> >
> I'm daemonizing simple-netaid:
>
> https://git.devuan.org/aitor_czr/snetaid
>
> Cheers,
Hi Aitor,
It's very important that there continue to be a way to run
simple-netaid in the foreground, so runit and s6 and other good inits
can run it reliably, without kludge.
I can see by your code that your intent was to give the user a choice
of self-daemonize or foreground, judging by the lines:
46: static int daemonized_flag = 1;
and
585: if (daemonized_flag == 1) {
but I saw no way for the user to set daemonized_flag to 0. I saw a
way for the user to reiterate setting it to 1:
484: {"daemon", no_argument, &daemonized_flag, 1},
If I remember my getopt_long correctly, the preceding line allows
someone to specify --daemon but not whether it's 1 or 0, and the
preceding line defaults it to 1.
I'd suggest you add -f and --foreground so the user can set it to
foreground.
Personally, I'd also suggest setting the default to foreground, to
better fit with inits like runit and s6, which I think some time in the
future will be Devuan's default init system.
Thanks,
SteveT
Steve Litt
Autumn 2020 featured book: Thriving in Tough Times
http://www.troubleshooters.com/thrive