# Copyright (C) Inverse inc.
[Unit]
Description=PacketFence Connector Server
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]
LimitNOFILE=infinity
ExecStartPre=/bin/perl -I/usr/local/pf/lib -I/usr/local/pf/lib_perl/lib/perl5 '-Mpf::services::manager::pfconnector_server' -e 'pf::services::manager::pfconnector_server->new()->generateConfig()'
ExecStart=/usr/local/pf/sbin/pfconnector-server-docker-wrapper
ExecStop=/bin/bash -c "docker stop pfconnector-server ; echo Stopped"
Restart=on-failure
Slice=packetfence.slice
PIDFile=/usr/local/pf/var/run/pfconnector-server-systemd-notify.pid

[Install]
WantedBy=packetfence.target
