Thanks. Here’s an example where the locking prevented concurrent updates (the cru PID directly above “Acquired cru lock” is different from its own):I ran it from last night till now. Did "grep -a cru messages > cru1.txt". There was an auto-restart at 4:05am today. See the log.
Code:
Mar 8 04:07:04 RT-AC86U-9988 cru[9281]: Action: a, JobID: clearcache, Args: a clearcache 50 03 * * * /jffs/scripts/clearcache 2>&1 | /usr/bin/logger -t clearcache
Mar 8 04:07:04 RT-AC86U-9988 cru[9281]: Calling PID: 8413, CMD: /bin/sh /jffs/scripts/post-mount /tmp/mnt/spare
Mar 8 04:07:04 RT-AC86U-9988 cru[9281]: Acquired cru lock
Mar 8 04:07:04 RT-AC86U-9988 cru[9322]: Action: a, JobID: connmon, Args: a connmon */12 * * * * /jffs/scripts/connmon generate
Mar 8 04:07:04 RT-AC86U-9988 cru[9322]: Calling PID: 6062, CMD: /bin/sh /jffs/scripts/connmon startup /tmp/mnt/ac86u
Mar 8 04:07:05 RT-AC86U-9988 cru[9281]: Jobs before: 21, after: 21
Mar 8 04:07:05 RT-AC86U-9988 cru[9322]: Acquired cru lock
Mar 8 04:07:05 RT-AC86U-9988 cru[9410]: Action: a, JobID: temp, Args: a temp */15 * * * * /jffs/scripts/temp_check 2>&1 | tr -d '\n' | /usr/bin/logger -t Temp
Mar 8 04:07:05 RT-AC86U-9988 cru[9410]: Calling PID: 8413, CMD: /bin/sh /jffs/scripts/post-mount /tmp/mnt/spare
Mar 8 04:07:05 RT-AC86U-9988 cru[9322]: Jobs before: 21, after: 22
Mar 8 04:07:05 RT-AC86U-9988 cru[9410]: Acquired cru lock
Mar 8 04:07:05 RT-AC86U-9988 cru[9410]: Jobs before: 22, after: 22