Showing posts with label Linux OS. Show all posts

Saturday, May 2, 2026

Installing cPanel DNSOnly on AlmaLinux 10 in Proxmox LXC

With AlmaLinux 10 now officially supported by cPanel & WHM, many of us are moving our DNS clusters to the latest base. However, if you are performing a clean install inside a Proxmox LXC container, you might still run into a frustrating "Fatal Error 127" during the installation of universal hooks. This usually happens because the container environment is too minimal for the installer's scripts, or the specific AlmaLinux 10 hook repository isn't being reached correctly by the installation script.

After some testing, I found a specific sequence of commands that bypasses the "The background process Install [YUM universal hooks] failed with a fatal error: The subprocess reported error number 127 when it ended." and allows the DNSOnly installer to complete successfully on AlmaLinux 10.

1. Create a dummy fstab

Many cPanel scripts check for `/etc/fstab` to verify disk mounts. Since Proxmox LXC containers often don't have this file by default, we need to create it manually:

# touch /etc/fstab

2. Install Yum Utilities

Even though AlmaLinux 10 uses DNF, `yum-utils` provides essential compatibility tools required by the cPanel installation wrapper:

# yum -y install yum-utils

3. Manually Inject the Universal Hooks

This is the "secret sauce." If the automated installer fails to fetch the hooks, you can manually install the version 9 RPM. It is currently compatible enough with version 10 to satisfy the installer's requirements:

# rpm -ivh http://httpupdate.cpanel.net/cpanelsync/repos/CentOS/9/EA4/x86_64/yum-plugin-universal-hooks-0.1-15.21.1.cpanel.x86_64.rpm

4. Run the DNSOnly Installer

Now that the environment is prepared, you can pull the latest installer and run it. The error 127 should no longer appear.

# cd /home

# curl -o latest-dnsonly -L https://securedownloads.cpanel.net/latest-dnsonly

# sh latest-dnsonly

The Error 127 specifically refers to a "Subprocess reported error" because a hook script tried to call a binary that wasn't found in the minimal LXC template. By manually installing the `universal-hooks` RPM and creating the `fstab` file, you ensure all the paths and dependencies expected by cPanel are present before the main script starts.

While AlmaLinux 10 is the future, minimal container templates sometimes need a little manual help to work with enterprise software like WHM. Using this method, I was able to get my DNS cluster up and running on Proxmox in minutes.

Monday, July 10, 2023

Proxmox 7 LXC Backup Failed (exit code 23)

One of my Proxmox CT backup has been unable to be saved for several days, and I'm unsure about the reason. Based on my testing, the Stop-mode backup operates effectively, while the Suspend mode does not function as intended.

Here is the log of attempted vzdump:

INFO: starting final sync /proc/180682/root/ to /mnt/storage/dump/vzdumptmp209244_1006/

INFO: resume vm

INFO: guest is online again after 3 seconds

ERROR: Backup of VM 1006 failed - command 'rsync --stats -h -X -A --numeric-ids -aH --delete --no-whole-file --inplace --one-file-system --relative '--exclude=/var/lib/php/sessions/?*' '--exclude=/tmp/?*' '--exclude=/var/tmp/?*' '--exclude=/var/run/?*.pid' /proc/180682/root//./ /mnt/storage/dump/vzdumptmp209244_1006/' failed: exit code 23

INFO: Failed at 2023-07-10 22:10:06

INFO: Backup job finished with errors

job errors

By default, for systems based on Bullseye, the 'fs.protected_regular' sysctl is set to '2' instead of the previous value of '0'. This change poses a problem for rsync's `--inplace` mode when dealing with protected files, as even the root user cannot open them with O_CREAT.

An example of this issue can be observed in Debian (or Debian-based) containers that use PHP. In these containers, the session directory '/var/lib/php/sessions' has sticky permissions, is world-writable, owned by root, and contains session files typically owned by www-data. If any of these session files are modified between the first and second rsync runs, the second run and consequently the backup operation will fail.

The solution is set fs.protected_regular in Proxmox before backup LXC (or make it permanent in /etc/sysctl.conf):

# sysctl fs.protected_regular=0

Saturday, July 1, 2023

How to Change and Move a User's Home Directory in Linux

Linux offers a robust command-line interface (CLI) with powerful tools for managing user accounts. One such command is `usermod`, which we'll focus on today. We will specifically explore how you can use it to change and move a user's home directory, ensuring a seamless transition of files.

Understanding the `usermod` Command

The `usermod` command in Linux is a utility for modifying existing user accounts. It allows you to alter various user details, including home directories, login names, and more.

Steps to Change and Move a User's Home Directory

Here's how to change a user's home directory and move its contents to the new location.

  1. Open the Terminal: This can be done by searching for 'Terminal' in your applications menu or by using the keyboard shortcut `Ctrl + Alt + T`.
  2. Switch to the root user: Type `su -` and enter your root password when prompted. Alternatively, you can prepend `sudo` to the `usermod` command if your user account is in the sudoers file.
  3. Use the `usermod` command: You can change the user's home directory and move the contents to the new directory using the following command:

usermod -m -d /newhome/username username

Here:

  • `usermod` is the command we use to modify an existing user's information.
  • `-m` (or `--move-home`) is an option that moves the contents of the user's current home directory to the new home directory.
  • `-d` (or `--home`) is the option that changes the home directory.
  • `/newhome/username` is the path to the new home directory.
  • `username` is the name of the user whose home directory you want to modify.

Remember:

  • You need to have superuser (root) permissions to use the `usermod` command.
  • Always exercise caution when making changes to system settings.
  • Also, be aware that any absolute path references in scripts or configuration files will not be updated automatically, so these may need to be changed manually.

With this knowledge, you can efficiently change and move a user's home directory in Linux, ensuring data consistency.