chiark / gitweb /
New notification mechanism 'userv'.
authorSimon Tatham <anakin@pobox.com>
Fri, 18 Dec 2015 17:23:59 +0000 (17:23 +0000)
committerSimon Tatham <anakin@pobox.com>
Fri, 18 Dec 2015 17:23:59 +0000 (17:23 +0000)
commita7b661486ddf65ef92f42941eec4d03e3be78875
treee3d45987c268667eba1ab8080fc96ded0dccc2dc
parentf1462909dd25c94e01c93f0b3de7c351fd3b59b2
New notification mechanism 'userv'.

This makes an ssh connection to a specified host, and then invokes a
specified userv service provided by a specified user. The recipient
configuration is of the form 'userv SSH_HOST_ARG USERV_USER SERVICE',
e.g. I've been testing it myself with the line
    userv sgtatham@chiark sgtatham post-pizza
which causes the first argument 'sgtatham@chiark' to be passed to ssh,
and then the service command 'userv sgtatham post-pizza' to be invoked
on the target host.

The notification message is passed to the userv service via standard
input, because that seemed slightly easier than doing it as a
command-line argument (the latter would be easy enough to get through
userv uncorrupted, but less easy to get through the ssh command line
mechanism).

The userv service is invoked with a 2-second timeout, so if it needs
to do anything potentially long (like trying to make a network
connection over a maybe-not-up-yet secnet tunnel) then it should close
file descriptors and fork.
via-userv [new file with mode: 0755]