Creating a timer within a module
Alejandro Pérez Méndez
alex at um.es
Wed May 10 17:50:37 CEST 2017
> On 10 May 2017, at 16:39, Alejandro Pérez Méndez <alex at um.es> wrote:
>> It seems that an event loop do not serve my purposes, as it is not thread-safe and I will be inserting from the REQUEST thread pool, whereas consuming from the rekeyer thread (the one I create for my module). I can obviously add a mutex but then REQUESTS handling might be blocked for as long as a rekey can last (which is what I wanted to avoid in the first place).
> Instead of handling it on a built in timer, does it change things if you trigger it via the control socket?
> You could add some hooks so that radmin can trigger a rekey for a domain, then have an external process handle the timing.
I thought that at first, and indeed was my first approach. It was based
on special REQUESTS messages (using radtest) rather than control socket,
but after all pretty similar approach.
But it has the problem of requiring an external daemon to be up &
running, instead of being built-in. I had a conversation with Stefan and
he didn't like the idea of having an additional daemon (more hackish)...
and I agree. Furthermore, you loose some control over the whole process
(you need to somehow export which realms are dynamically created, when
they expire, etc.). Of course you can execvp() radmin from trustrouter.c
but that is quite ugly.
> Adam Bishop
> gpg: E75B 1F92 6407 DFDF 9F1C BF10 C993 2504 6609 D460
> Jisc is a registered charity (number 1149740) and a company limited by guarantee which is registered in England under Company No. 5747339, VAT No. GB 197 0632 86. Jisc’s registered office is: One Castlepark, Tower Hill, Bristol, BS2 0JA. T 0203 697 5800.
> Jisc Services Limited is a wholly owned Jisc subsidiary and a company limited by guarantee which is registered in England under company number 2881024, VAT number GB 197 0632 86. The registered office is: One Castle Park, Tower Hill, Bristol BS2 0JA. T 0203 697 5800.
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html
More information about the Freeradius-Devel