[kwlug-disc] Script gets executable flag unset every minute - why?
Khalid Baheyeldin
kb at 2bits.com
Sun Nov 20 10:27:20 EST 2022
On Sun, Nov 20, 2022 at 6:10 AM Ronald Barnes <ron at ronaldbarnes.ca> wrote:
>
> I've got a script in /root/backups which is owned by root and chmod 0700.
>
> Every time the seconds roll over to a new minute, all executable flags
> get reset.
>
> I even tried setting it to the ridiculous chmod of 0711 and all the
> executable bits are reset every minute.
>
I also have a directory /root/bin/ with lots of scripts in them. They are
set
to 755, and they remain that way.
This is Ubuntu Server 20.04 LTS by the way.
> What the heck could be causing this?
>
My first suspect would be systemd. Check the logs to see if there is
something there.
I say that because systemd often works against your back to do the opposite
of what
you want. Case in point: /etc/fstab had device /dev/foo mounting to a
directory called
/foo. That device was not plugged in when the server was booted. Then I
manually
mounted /dev/bar to /foo. The command exits successfully and does what you
wanted.
But systemd thinks it is smarter than the sysadmin, and unmounts it behind
your back
with no user feedback at all.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20221120/da85882b/attachment.htm>
More information about the kwlug-disc
mailing list