[Unit]
Description=DirectoryWatcher Service for Anypoint Monitoring
Documentation=https://github.com/mulesoft-emu/dias-agent-installer
Wants=network-online.target
After=network-online.target

[Service]
Type=forking
PIDFile=/etc/directory-watcher/directory-watcher.pid
Environment=MULE_HOME=$muleHome$
Environment=AM_HOME=$muleHome$/am
Environment=JAVA_HOME=$javaHome$
ExecStart=/bin/bash $muleHome$/am/bin/am start-dw -s
ExecReload=/bin/bash $muleHome$/am/bin/am restart-dw -s
ExecStop=/bin/bash $muleHome$/am/bin/am stop-dw -s
StandardOutput=journal
StandardError=journal
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target 