========================
== Experimental Emacs ==
========================
Corwin's Emacs Blog


Chad - compute heterogeneous asynchronous datagrams

Daemon to execute commands when data becomes available.

SYNOPSIS

DESCRIPTION

The system will start Chad automatically when entering a multi-user run-level.

OPTIONS

  • -f --foreground stay in the foreground

  • -s --single-user disable individual chadtabs for each user

NOTES

Unless started with the s or single-user option, Chad searches its spool area (/var/spool/chad/chadtabs, by default) for chadtab files (which are named after the accounts in /etc/passwd); valid chadtabs found loaded into memory. The chadtabs in this directory should not be directly accessible by users - the chadtab command should be used to access and update them.

Chad also reads /etc/chadtab which has a slightly different format.

Chad reads and writes /var/run/chadtab to associate system users to ports and file descriptors it has opened for them.

Rationale

Chad provides interfaces (inspired by cron) to schedule the execution of commands based on data becoming available (rather than on date/time conditions). Like cron jobs, Chad takes the form of a line of shell script ("command") preceded by execution preconditions ("rules"). Chad (again, like cron) evaluates each command whenever it satisfies (all of) the rules preceding it. Chad also supports a limited form for setting of shell environment variables.

chadtab (vs crontab)

  • rules define general data/state assertions (not just date/time)

  • assign names to commands and rules and reuse them

  • line-continuation and commenting

    • for commands

      • replace the part of the current line matching a pattern with the line following

      • Pattern is one of

        \\\n slash followed by newline
        \\\s+#.*?\n slash then whitespace followed by hash
        then anything to next newline
    • for rules

      • use multiple styles interchangeably and redundantly

        long identifiers
        mnemonic short visual reminders of function