# Copyright (C) Inverse inc.
[Unit]
Description=PacketFence FreeRADIUS multi-protocol accounting server
Documentation=man:radiusd(8) man:radiusd.conf(5) http://wiki.freeradius.org/ http://networkradius.com/doc/
Wants=packetfence-httpd.aaa.service
After=packetfence-httpd.aaa.service
Wants=packetfence-base.target packetfence-config.service packetfence-iptables.service
After=packetfence-base.target packetfence-config.service packetfence-iptables.service
Before=packetfence-docker-iptables.service
Requires=packetfence-docker-iptables.service
PartOf=packetfence-docker-iptables.service

[Service]
Type=notify
TimeoutStopSec=60
NotifyAccess=all
StartLimitBurst=3
StartLimitInterval=10
ExecStartPre=/usr/bin/perl -I/usr/local/pf/lib -I/usr/local/pf/lib_perl/lib/perl5 '-Mpf::services::manager::radiusd' -e 'pf::services::manager::radiusd->new()->generateConfig()'
ExecStart=/usr/local/pf/sbin/radiusd-acct-docker-wrapper
ExecStop=/bin/bash -c "docker stop radiusd-acct ; echo Stopped"
Restart=on-failure
Slice=packetfence.slice
PIDFile=/usr/local/pf/var/run/radiusd-acct-systemd-notify.pid

[Install]
WantedBy=packetfence.target
