Open TheFlipside opened 1 year ago
@TheFlipside What does your crontab look like?
/etc/cron.daily/autopostgresqlbackup:
#!/bin/sh
if [ -x /usr/sbin/autopostgresqlbackup ]; then
/usr/sbin/autopostgresqlbackup
fi
To work around this issue I guess you could fix this crontab like this:
#!/bin/sh
if [ -x /usr/sbin/autopostgresqlbackup ]; then
/bin/bash --noprofile /usr/sbin/autopostgresqlbackup
fi
I tried multiple workarounds using env -i /bin/bash --norc --noprofile /usr/sbin/autopostgresqlbackup
and also exec env TMOUT=0 /bin/bash /usr/sbin/autopostgresqlbackup
as i found as answer somewhere
When the session variable is "Read Only" you have to replace the current shell process with the command by "exec"
But unfortunately none of the attempts changed the behaviour and I still get the error message in the email sent after the cronjob
I guess that /bin/sh is a symlink to /bin/bash. Another proposal, change the shebang with another posix compatible shell (like zsh, dash or another one)
#!/bin/zsh
if [ -x /usr/sbin/autopostgresqlbackup ]; then
/bin/bash --noprofile /usr/sbin/autopostgresqlbackup
fi
Another one with bash only:
#!/bin/bash --noprofile
if [ -x /usr/sbin/autopostgresqlbackup ]; then
/bin/bash --noprofile /usr/sbin/autopostgresqlbackup
fi
i tried both solutions, unfortunately none changed the problem
I'm using autopostgresqlbackup on multiple Rocky Linux 8.7 systems and I always set the following in /etc/profile:
TMOUT=300 readonly TMOUT export TMOUT
This is not an uncommon practice and a recommendation by many hardening guides.
For autopostgresqlbackup though it leads to multiple warnings/errors in the report: /etc/profile: line 88: TMOUT: readonly variable
The backup is done correctly though so I wondered if there is a workaround for this message not to appear in the reports?