I am running a Redis server on a RHEL system that requires processes to update their AFS authentication tokens every 24 hours.
In the client-side code that posts data to the database, I can update the AFS token by calling a shell command every N POST requests (e.g. echo PASSWORD | kinit && aklog
.
I would like to achieve something similar in the server process, but am not sure how to do so. Are there any "post-receive-data" callback style hooks that one can use to run a shell command from within a Redis server process? I would be very grateful for any advice others can offer on this question.
No - the Redis server isn't designed for that and is not intended for this purpose. If you really insist on using an event from the Redis server to trigger a shell command, you could hack by:
EVAL
with a script that invokes the redis.log
Lua function.redis-cli
) that BRPOP
s from a queue, does the work and repeatsNote: WRT to "Redis server isn't designed for that" - if you do find some loophole that allows you to do what you're looking for, please report it as a severe security issue. In that sense, you may want to read http://antirez.com/news/96