I'm working on getting the Snort++ (Snort3) package compiled and running - and have - under a mips64 build.
When I run the snort
command from the console, it runs fine. If I call it via the service snort start
, nothing happens.
I've even updated the /etc/init.d/snort
to reflect strictly call the command line without the uci variables. The change to the LUA_PATH was intentional and is correct.
Again, calling the command directly works fine (or at least, works).. Any suggestions?
#!/bin/sh /etc/rc.common
START=99
STOP=10
USE_PROCD=1
PROG=/usr/bin/snort
validate_snort_section() {
uci_validate_section snort snort "${1}" \
'config_dir:string' \
'alert_module:string' \
'interface:string' \
'daq:string'
}
start_service() {
local config_file interface
validate_snort_section snort || {
echo "validation failed"
return 1
}
procd_open_instance
procd_set_param command $PROG -Q -v --daq afpacket --daq-dir /usr/lib/daq/ -i eth0:br-lan -c /etc/snort/snort.lua -A alert_full -D
procd_set_param env SNORT_LUA_PATH="$config_dir"
procd_set_param env LUA_PATH="/usr/lib/lua/?.lua;;"
procd_set_param file $CONFIGFILE
procd_set_param respawn
procd_close_instance
}
stop_service()
{
service_stop ${PROG}
}
service_triggers()
{
procd_add_reload_trigger "snort"
procd_add_validation validate_snort_section
}