# Copyright (C) Inverse inc.
[Unit]
Description=PacketFence PFSSO Service
Wants=packetfence-base.target packetfence-config.service packetfence-iptables.service
After=packetfence-base.target packetfence-config.service packetfence-iptables.service
Before=packetfence-httpd.portal.service
Before=packetfence-docker-iptables.service
Requires=packetfence-docker-iptables.service
PartOf=packetfence-docker-iptables.service

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

[Install]
WantedBy=packetfence.target
