Hello!
I has installed Snort and Barnyard2 on my Ubuntu 20.04.1. They work normally, but when I try to make Barnyard2 as service, I will get error "barnyard2.service: Main process exited, code=exited, status=1/FAILURE". I will get this error, when i reboot my system. But if I executing the command "sudo systemctl start barnyard2" and check status service, I will have "active (running) service".
My barnyard2.service file:
[Unit]
Description=Barnyard2 Daemon
After=syslog.target network.target
[Service]
Type=simple
#User=snort
#Group=snort
PermissionsStartOnly=true
#ExecStartPre=/bin/rm -R /var/run/snort
ExecStartPre=/bin/mkdir /var/run/snort
ExecStartPre=/bin/chown -R snort:snort /var/run/snort/
ExecStart=/usr/local/bin/barnyard2 -c /etc/snort/barnyard2.conf -d /var/log/snort -f snort.u2 -q -w /var/log/snort/barnyard2.waldo -g snort -u snort >
[Install]
WantedBy=multi-user.target
Error:
How fix this problem? Can you help me, pls?