Stoping or rebooting ocserv and Radius Accounting
Description of problem:
After ocserv is stopped or rebooted, no messages with "Acct-Status-Type = Stop" are sent to Radius server
Version of ocserv used:
ocserv 1.2.2
Additional information
I had to make a script to solve this problem for systemd ExecStop=/etc/ocserv/shutdown_ocserv.sh $MAINPID like this:
#!/bin/bash
users=(`/usr/bin/occtl show sessions all | grep -v "session user vhost ip user agent created status" | awk '{print $2}'`)
VAR1='xxxx'
for userNum in ${users[@]}; do
if [[ $userNum != $VAR1 ]]
then
/usr/bin/occtl disconnect user $userNum
fi
done
sleep 15
/bin/kill -s 15 $1
Edited by Алексей Краснощёков