Motivation: core-dump might be very useful, and in this case there
are even very useful pointers on the C stack.
Each single query from watchdog must result in answer with
RCODE = NOERROR or NXDOMAIN. Any other result will terminate the resolver
-(with exit code 69) to allow the supervisor process to do cleanup and restart
-the resolver.
+(with SIGABRT) to allow the supervisor process to do cleanup, gather coredump
+and restart the resolver.
It is recommended to use a name with a very short TTL to make sure the watchdog
is testing all parts of resolver and not only its cache. Obviously this check
ffi.cdef([[
int sd_watchdog_enabled(int unset_environment, uint64_t *usec);
int sd_notify(int unset_environment, const char *state);
+ void abort(void);
]])
local watchdog = {}
end
function private.fail_callback()
- log('[watchdog] TERMINATING resolver, supervisor is expected to restart it')
- os.exit(69) -- unclean exit code = EX_UNAVAILABLE
+ log('[watchdog] ABORTING resolver, supervisor is expected to restart it')
+ ffi.C.abort()
end
-- logging
User=@user@
TimeoutStopSec=10s
WatchdogSec=10s
-RestartForceExitStatus=69
Restart=on-abnormal
LimitNOFILE=1048576
Sockets=kresd.socket