Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Red Hat 9 dependency check - mailx #4570

Open
danatinflux opened this issue May 5, 2024 · 2 comments
Open

[Bug]: Red Hat 9 dependency check - mailx #4570

danatinflux opened this issue May 5, 2024 · 2 comments

Comments

@danatinflux
Copy link

User story

Red Hat 9 no longer installs mailx. However, whenever I start Rust, it checks for it and tries to install it. This is making it more difficult to run commands in crontab, as it always asks for the sudo password when restarting or checking for updates.

Game

Rust

Linux distro

RedHat 9

Command

command: backup

Further information

When using the 'rustserver' command, it always checks for the mailx package, which is no longer installed on RH9.

 [rustserver@REDACT~]$ /home/rustserver/rustserver backup
[ WARN ] Backing up rustserver: Missing dependencies: mailx[sudo] password for rustserver:
Information! Automatically installing missing dependencies.
Updating Subscription Management repositories.
Last metadata expiration check: 0:46:28 ago on Sun 05 May 2024 08:14:36 AM PDT.
No match for argument: mailx
Error: Unable to find a match: mailx 

This makes it a challenge to use the 'rustserver' command for crontab commands like backup, update, et. al.

Relevant log output

No response

Steps to reproduce

  1. Use the 'rustserver' command to attempt a backup.
  2. The dependency will fail and the user will be asked for the sudo password to install the dependency (which it cannot).
@dgibbs64
Copy link
Member

dgibbs64 commented May 5, 2024

Probably this line causing the issue https://github.com/MicLieg/LinuxGSM/blob/b3e40a59e994df6ea42d781a938522affc785b75/lgsm/modules/check_deps.sh#L116-L117

This will need to be updated to reflect changes in dependency names. I belive the replacement is s-nail

@danatinflux
Copy link
Author

Fantastic! Thanks so much----I hadn't thought of grepping the 'modules' dir.

Changes made:

fn_deps_email() {
        # Adds postfix to required dependencies if email alert is enabled.
        if [ "${emailalert}" == "on" ]; then
                if [ -f /usr/bin/mailx ]; then
                        if [ -d /etc/exim4 ]; then
                                array_deps_required+=(exim4)
                        elif [ -d /etc/sendmail ]; then
                                array_deps_required+=(sendmail)
                        elif [ "$(command -v yum 2> /dev/null)" ] || [ "$(command -v dnf 2> /dev/null)" ]; then
                                array_deps_required+=(s-nail postfix)
                        elif [ "$(command -v apt 2> /dev/null)" ]; then
                                array_deps_required+=(mailutils postfix)
                        fi
                else
                        if [ "$(command -v yum 2> /dev/null)" ] || [ "$(command -v dnf 2> /dev/null)" ]; then
                                array_deps_required+=(s-nail postfix)
                        elif [ "$(command -v apt 2> /dev/null)" ]; then
                                array_deps_required+=(mailutils postfix)
                        fi
                fi
        fi
}

Seems to be working perfectly, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🆕 New Issues
Development

No branches or pull requests

2 participants