svc - Implement more features
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 12 Nov 2014 00:33:24 +0000 (16:33 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 12 Nov 2014 00:33:24 +0000 (16:33 -0800)
commit82f395276fa6ba7906ecc95917af85f30a54d7a1
tree7ee0ca69303f0d7060c93c079a7424c91ccaaa96
parent7ac8f1886e54ed9d768075ac64f289fc72fedeac
svc - Implement more features

* All stdout/stderr output now goes to a pipe and a pipe buffering thread
  to read it into a circular buffer as well as write it to the log file.

  The program is now able to retain ~8KB worth of output in its circular
  buffer whether there is a log file attached to the service or not.

* When /dev/null is specified as the log file, short-cut the descriptor to -1
  instead of actually writing to /dev/null.

* log, logf, and tailf directives now work.

* Properly escape '.' on a line by itself for all buffered data dumped
  over a remote link (allowing logs to contain our command response
  terminator).

* Implement -f (foreground option) and clean-up descriptor initialization.

* Implement -s (sync on exit)
sbin/svc/execute.c
sbin/svc/remote.c
sbin/svc/subs.c
sbin/svc/svc.c
sbin/svc/svc.h