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

[Install]
WantedBy=packetfence.target