Aegis documentation

#Beanstalkd

The Beanstalkd cube owns the job queue. Beanstalkd has no configuration file, so the cube renders aegis-beanstalkd.env (mode 0640) under beanstalkd.config_dir (/aegis/config/beanstalkd) and turns each key into a command-line flag at start time: BEANSTALKD_LISTEN_ADDR → -l, BEANSTALKD_LISTEN_PORT → -p, BEANSTALKD_BINLOG_DIR → -b, BEANSTALKD_USER → -u. The binlog that survives a restart lives in beanstalkd.binlog_dir (/aegis/data/beanstalkd), owned by the service account; there is no database.

The daemon listens on 127.0.0.1:<beanstalkd.port> (default 11300) and runs as the keeper service aegis-beanstalkd. The keeper records the pid itself, because the daemon is started in the foreground.

#Common commands

Cube operations share one wrapper: ✔ beanstalkd: <detail> on success, ✖ <message> on failure (exit 1), and {"ok": true, "cube": "beanstalkd", "result": "<detail>"} with global --json.

expose is the only verb that prints a block instead of that line.

VerbEffect
configurecreate the account, render the options file, start when stopped, validate
validateopen a TCP connection and require an OK answer to stats
reloadrestart; options are read at startup only
statusread config/beanstalkd.pid: running (pid N) or stopped
startstart the daemon with the flags from the options file
stopSIGTERM, then SIGKILL after 15 seconds
restartstop, then start
exposeprint the options file, binlog and port, then publish the daemon
helpprint the command list with examples

#configure

bash
aegis cubes beanstalkd configureaegis --json cubes beanstalkd configure

Re-rendering the options file is how a setting is changed: edit aegis-beanstalkd.env, run configure (or restart), and the new flags are used.

text
✔ beanstalkd: server answers on 11300{"ok": true, "cube": "beanstalkd", "result": "server answers on 11300"}

#validate

bash
aegis cubes beanstalkd validateaegis --json cubes beanstalkd validate

Connects to 127.0.0.1:<port>, sends stats and requires the reply to start with OK. A refused connection is reported with the socket error.

text
✔ beanstalkd: server answers on 11300{"ok": true, "cube": "beanstalkd", "result": "server answers on 11300"}

#reload

bash
aegis cubes beanstalkd reloadaegis --json cubes beanstalkd reload

Restarts the daemon. Jobs in the binlog survive; a stopped daemon fails with beanstalkd is not running.

text
✔ beanstalkd: stopped (pid 1901), started (pid 1920){"ok": true, "cube": "beanstalkd", "result": "stopped (pid 1901), started (pid 1920)"}

#status

bash
aegis cubes beanstalkd statusaegis --json cubes beanstalkd status
text
✔ beanstalkd: running (pid 1901){"ok": true, "cube": "beanstalkd", "result": "running (pid 1901)"}

#start

bash
aegis cubes beanstalkd startaegis --json cubes beanstalkd start
text
✔ beanstalkd: started (pid 1901){"ok": true, "cube": "beanstalkd", "result": "started (pid 1901)"}

#stop

bash
aegis cubes beanstalkd stopaegis --json cubes beanstalkd stop
text
✔ beanstalkd: stopped (pid 1901){"ok": true, "cube": "beanstalkd", "result": "stopped (pid 1901)"}

#restart

bash
aegis cubes beanstalkd restartaegis --json cubes beanstalkd restart
text
✔ beanstalkd: stopped (pid 1901), started (pid 1944){"ok": true, "cube": "beanstalkd", "result": "stopped (pid 1901), started (pid 1944)"}

#expose

bash
aegis cubes beanstalkd exposeaegis --json cubes beanstalkd expose
text
cube           beanstalkdinstalled      /aegis/apps/data/beanstalkd/1.13configuration  /aegis/config/beanstalkdstate          running (pid 1901)pid            1901log            /aegis/logs/beanstalkd/beanstalkd.logoptions        /aegis/config/beanstalkd/aegis-beanstalkd.envbinlog         /aegis/data/beanstalkdport           11300published      /aegis/bin/beanstalkd
text
{"ok": true, "cube": "beanstalkd", "installed": "/aegis/apps/data/beanstalkd/1.13", "configuration": "/aegis/config/beanstalkd", "state": "running (pid 1901)", "pid": "1901", "log": "/aegis/logs/beanstalkd/beanstalkd.log", "options": "/aegis/config/beanstalkd/aegis-beanstalkd.env", "binlog": "/aegis/data/beanstalkd", "port": "11300", "published": "/aegis/bin/beanstalkd"}

#help

bash
aegis cubes beanstalkd helpaegis cubes help beanstalkd
text
ℹ Beanstalkd — Beanstalkd job queueCommands  validate   Check the configuration  reload     Reload the running daemon  configure  Write the options and validate them  start      Start the daemon  stop       Stop the daemon  status     Show whether the daemon runs  restart    Restart the daemon  expose     Show where it is installed and how it runs  help       Show every command with examples

The examples block follows.