mirror of
https://github.com/Yubico/yubikey-val.git
synced 2025-02-27 06:54:16 +01:00
Only $req_answers sync peers would get polled. When $req_answers is less than $nr_servers, some servers (that return replayed counters) will get ignored, since retrieveURLasync() stops after $req_answers responses. The fix requires $nr_servers responses from retrieveURLasync, causing all sync peers to get polled and processed by sync(). This arrangement also allows a two-server sync pool to operate when one peer is gone or unreachable, something that cannot be done before these modifications. Set the sync_level to 0, which means "try everyone, but if you get no valid responses, it's okay to proceed". Prior to the modifications, it means "don't even try syncing". Also, added ykval-cron, which can be fired off from a cron job to make sure ykval-queue stays running. This is example code, as your enviroment and usernames may differ.
23 lines
299 B
Bash
Executable File
23 lines
299 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Something to keep ykval-queue going
|
|
# run this in cron
|
|
# restarts if necessary
|
|
|
|
RUNAS=ykval
|
|
|
|
function start
|
|
{
|
|
su -s /bin/bash -c '/usr/sbin/ykval-queue &>/dev/null &' - ${RUNAS}
|
|
exit 0
|
|
}
|
|
|
|
|
|
FOUND=$( ps -C ykval-queue | wc -l )
|
|
|
|
if [[ ${FOUND} -lt 2 ]]; then
|
|
start
|
|
fi
|
|
|
|
exit 0
|