# Copyright (C) Inverse inc.
[Unit]
Description=PacketFence Connector Client
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_client' -e 'pf::services::manager::pfconnector_client->new()->generateConfig()'
ExecStart=/usr/local/pf/sbin/pfconnector-client-docker-wrapper
ExecStop=/bin/bash -c "docker stop pfconnector-client ; echo Stopped"
Restart=always
Slice=packetfence.slice
PIDFile=/usr/local/pf/var/run/pfconnector-client-systemd-notify.pid

[Install]
WantedBy=packetfence.target
