[DGD] Reboot and shutdown in kernellib or cloud-library

Raymond Jennings shentino at gmail.com
Sat May 11 01:26:14 CEST 2019


>From the perspective of LPC within DGD, the only way to know if some force
external to DGD has requested a shutdown is through the driver apply called
"interrupt",

For the kernel library, this is handled in /kernel/sys/driver.c by calling
the shutdown() kfun, also requesting a snapshot/statedump if the config.h
specifies SYS_PERSISTENT.

As for having a shell script notice or react, you'd probably want to
intercept the shutdown() process with something that leaves a message for
the shell script to read later, a "mailbox" of some sort.  Kotaka itself
keeps this mailbox in /home/Secret/System to protect it both from tampering
and prying eyes.  DGD itself doesn't do anything special when it shuts
down, but it does allow kfuns to be overridden by LPC efuns, and for its
own purposes the kernel library does so to restrict shutdown() to System
code.  You could use your second auto object to mask it yourself and have a
note stuffed into a mailbox that your shell script could check on DGD's
termination.

Kotaka's designated dgd manager script, the monitor, either already does or
in the foreseeable future will check for messages there whenever DGD
terminates, in addition to the checks it already does on DGD's exit status
(including whether or not DGD died from a fatal signal).

On Fri, May 10, 2019 at 3:13 AM francisco del roio <francipvb at hotmail.com>
wrote:

> Hello,
>
> Is there a way to check if the admin has requested shutdown or reboot
> when dgd exits when coding with Kernel or Cloud libraries?
>
> I mean from a shell script.
>
> Cheers,
> --
> Cuando tus fuerzas terminan, las de mi Dios comienzan.
>
> ____________________________________________
> https://mail.dworkin.nl/mailman/listinfo/dgd


More information about the DGD mailing list