[Unit]
Description=pmie farm service
Documentation=man:pmie_check(1)
Before=pmie_farm_check.timer
BindsTo=pmie_farm_check.timer
PartOf=pmie.service

[Service]
Type=@SD_SERVICE_TYPE@
Restart=always
# long (but not infinite) start timeout - for pmie farms
TimeoutStartSec=4h
TimeoutStopSec=120
# the pmie_farm service manages all pmie instances except the primary
Environment="PMIE_CHECK_PARAMS=--skip-primary"
EnvironmentFile=-@PCP_SYSCONFIG_DIR@/pmie_timers
ExecStart=@PCP_BINADM_DIR@/pmie_farm $PMIE_CHECK_PARAMS
WorkingDirectory=@PCP_VAR_DIR@
Group=@PCP_GROUP@
User=@PCP_USER@

[Install]
RequiredBy=pmie.service
