My system reboots when i give the "date -s" command. I collected the log and it says this
Jan 18 13:27:46 watchdog[2421]: file /tmp/cmm/strobeWDT was not changed in 1 seconds.
Jan 18 13:27:46 watchdog[3303]: shutting down the system because of error 2
Jan 18 13:27:47 watchdog[2421]: stopping daemon (5.2)
My application run on the system writes into the file /tmp/cmm/strobeWDT. If it fails to write to the file periodically, the watchdog daemon sends a reboot command. That is understandable. But only when i give the "date -s" command to set a new date, the system logs the above message and reboots.
Where is the problem existing.
I dont know whether the above info is enough to solve the problem from your side. Kindly help
Adding more info
I am getting the above log message from the code in file_stat.c (file inside the source code for watchdog daemon)
file_stat.c
#if USE_SYSLOG
/* do verbose logging */
if (verbose && logtick && ticker == 1)
syslog(LOG_INFO, "file %s was last changed at %s.", file->name, ctime(&buf.st_mtime));
#endif
if (time(NULL) - buf.st_mtime > file->parameter.file.mtime) {
/* file wasn't changed often enough */
#if USE_SYSLOG
syslog(LOG_ERR, "file %s was not changed in %d seconds.", file->name, file->parameter.file.mtime);
#else /* USE_SYSLOG */
fprintf(stderr, "file %s was not changed in %d seconds.", file->name, file->parameter.file.mtime);
#endif /* USE_SYSLOG */
I think problem exits in this part of the code, bcause the the error comes from this code. parameter.file.mtime is configured in /etc/watchdog.conf as "change=1"
So you're setting the date when you run
date -s
. Are you setting the clock backwards or forwards? It sounds like when you set the system date the watchdog gets confused. The clock jumps and then the watchdog says 'hey, times up, let's reboot!'.Solution: don't run
date -s
? You should set up and run ntp instead to gradually slew the clock instead of making it jump via usingdate -s
. Here's an ntp setup howto for example.I'm not familiar with watchdog, but I want to give some ideas: - why did you want to send to watchdog a reboot command if your app failed? - did you check to see any command
date -s
alias to? - what value of your load average is?