Hello:
Yes, but the problem is not with the error message (sudo.log being RO)
As you point out, it's expected.
Good question ... =-/
You're quite right.
But the shutdown problem also occurred without the second sync and the machine shuts down even with the second sync in the script.
I had...