AA-COMMAND(1)

NAME
aa-command - Helper to trigger one of anopa's commands

SYNOPSIS
aa-command COMMAND [ARG..]

DEPRECATED
aa-command(1) has been deprecated and will be removed in the next version of anopa. A better way to achieve similar results is via a longrun service, thus guaranteeing same environment, proper logging, etc

For example, such longrun could be named aa-command and have the following run file :

    #!/usr/bin/execlineb -P
    fdmove -c 2 1
    fdmove -c 4 1
    fdmove 1 3
    s6-ipcserver -1 -- socket
    s6-ipcserver-access -i rules --
    fdmove 2 4
    s6-sudod -2
    ./aa-command

With the following aa-command file :

    #!/usr/bin/execlineb -s1
    ifelse -n { test $1 = start -o $1 = stop -o =1 = reset }
    { if { aa-echo -De "Invalid command: $1" } exit 1 }
    if { aa-echo -Dn +w "Running: " +b "aa-${1} $@" }
    exec aa-${1} -D $@

And to e.g. start service foobar, one would simply do something like :

    s6-sudo /run/services/aa-command/socket start foobar

DESCRIPTION
aa-command(1) is a simple execline script that can be used to run one of anopa's command, ensuring proper environment and logging the output.

That is, instead of running e.g. `aa-start -W foo bar` to start those two services (but not auto-start any "wants"), one could do:

    aa-command start -W foo bar

This would simply reset the environment to load it from /etc/anopa/env (much like what happens on boot, i.e. in the aa-stage* scripts), set up a pipe on stderr to log things (timestamped via s6-tai64n) by appending into /var/log/boot/current; then execute `aa-COMMAND -D ARG..`

As a result, the command runs with a clean/predictable environment, and in addition to the output showing on the terminal, it gets added to the log of the current boot (again, as per the aa-stage* scripts).

BUGS
They're probably crawling somewhere in there... if you happen to catch one, (or more) report it and I'll do my best to squash it.

REPOSITORY
You can find the latest source code of anopa as well as report bugs and/or suggest features on its GitHub repository, available at <https://github.com/jjk-jacky/anopa>; or visit its official website at <https://jjacky.com/anopa>

AUTHOR

Olivier Brunel <jjk@jjacky.com>