mirror of
https://github.com/falcosecurity/falco.git
synced 2026-01-15 14:55:42 +00:00
Add a signal handler for SIGHUP that sets a global variable g_restart. All the real execution of falco was already centralized in a standalone function falco_init(), so simply exit on g_restart=true and call falco_init() in a loop that restarts if g_restart is set to true. Take care to not daemonize more than once and to reset the getopt index to 1 on restart. This fixes https://github.com/falcosecurity/falco/issues/432.