chiark / gitweb /
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.