I am experimenting with starting Suricata using systemd. It starts correctly when I issue a command line directly; it does not start correctly using that same command as the value for ExecStart.
2024-05-19T15:03:02-07:00 sma-station14l systemd[1]: Starting Suricata Intrusion Detection Service...
2024-05-19T15:03:02-07:00 sma-station14l systemd[1]: Started Suricata Intrusion Detection Service.
2024-05-19T15:03:02-07:00 sma-station14l systemd[1]: suricata.service: Main process exited, code=exited, status=203/EXEC
2024-05-19T15:03:02-07:00 sma-station14l systemd[1]: suricata.service: Failed with result 'exit-code'.
I have searched Suricata docs and cannot find any mention of the program’s return codes. The man page is silent as well.
The 203 exit code:
" The actual process execution failed (specifically, the execve(2) system call). Most likely this is caused by a missing or non-accessible executable file."
The use of a variable like that is not supported in systemd. The EnvironmentFile is usually used to provide runtime variables, for instance your value of --pidfile could be specified
PIDFILE=/data01/var/run/suricata.pid
This, as it happens, is true.
I modified ExecStart to usr/local/bin/suricata $JMM_SURIOPT which is the path to Suricata + options. And it started properly. Yay!