coova / coova-chilli

CoovaChilli is an open-source software access controller for captive portal hotspots.
Other
512 stars 258 forks source link

Chilli dose not update time/date after NTP sync #555

Closed momothefox closed 1 year ago

momothefox commented 1 year ago

I am using chilli on openwrt and i use external radius system for authentication and accounting.

The thing is i noticed that users from some of my APs showing that start session is wrong dated. so i looked up accounting packets. and i could see clearly that chilli is reporting accounting packets with wrong date/time. while the AP date/time is correct.

i posted this to openwrt issues and i got this replay https://github.com/openwrt/openwrt/issues/10147#issuecomment-1182849625

below sample accounting packet dated Sat Jun 25 10:26:02 2022 while chilli reporting Event-Timestamp = "May 17 2022 23:02:13 EEST"

what do you think ?

Sat Jun 25 10:26:02 2022
    ChilliSpot-Version = "1.6"
    Attr-26.14559.10 = 0x00000001
    Event-Timestamp = "May 17 2022 23:02:13 EEST"
    User-Name = "63578476"
    Acct-Status-Type = Start
    Acct-Session-Id = "165614193900000004"
    Class = 0x61693a3761363432373831363038363930333836633838656131616539663638386261
    Framed-IP-Address = 192.168.182.3
    NAS-Port-Type = Wireless-802.11
    NAS-Port = 4
    NAS-Port-Id = "00000004"
    Calling-Station-Id = "XX-XX-XX-XX-XX-XX"
    Called-Station-Id = "XX-XX-XX-XX-XX-XX"
    NAS-IP-Address = 192.168.182.1
    NAS-Identifier = "XX-XX-XX-XX-XX-XX"
    WISPr-Location-ID = "<XXXXX>"
    WISPr-Location-Name = "<XXXXXX>"
    FreeRADIUS-Acct-Session-Start-Time = "Jun 25 2022 10:26:02 EEST"
    Tmp-String-9 = "ai:"
    Acct-Unique-Session-Id = "789071c12892308bfc34c2e4e4f265a3"
    Timestamp = 1656141962

Have a look here https://github.com/openwrt/packages/issues/18925

momothefox commented 1 year ago

Solution for this is to disable chilli autostart @ boot and create file /etc/hotplug.d/ntp/90-chilli

#!/bin/sh
    /etc/init.d/chilli start

This makes Chilli starts after NTP Sync.