Recently on a VPS running Cyberpanel, MariaDB service failed with the error: Failed at step NAMESPACE spawning / bin / sh: Invalid argument
![How to fix Failed to start MariaDB error "Failed at step NAMESPACE spawning /bin/sh: Invalid argument" MobaXterm Personal 20.3 blIgpeMj5p - How to fix Failed to start MariaDB error "Failed at step NAMESPACE spawning /bin/sh: Invalid argument"](https://i0.wp.com/pcx3.com/wp-content/uploads/2021/11/MobaXterm_Personal_20.3_blIgpeMj5p.png?resize=736%2C223&ssl=1)
For VPS based on the openvz that are using old kernel you need to edit the service file to fix the problem:
nano /usr/lib/systemd/system/mariadb.service
Find the following value PrivateDevices = true and comment it by putting # before it so that it does not run.
![How to fix Failed to start MariaDB error "Failed at step NAMESPACE spawning /bin/sh: Invalid argument" MobaRTE MvUzCAjx5n - How to fix Failed to start MariaDB error "Failed at step NAMESPACE spawning /bin/sh: Invalid argument"](https://i0.wp.com/pcx3.com/wp-content/uploads/2021/11/MobaRTE_MvUzCAjx5n.png?resize=651%2C615&ssl=1)
Afterwards, run the following commands:
systemctl daemon-reload
and to start mariadb:
service mariadb stop service mariadb start
then check its status:
![How to fix Failed to start MariaDB error "Failed at step NAMESPACE spawning /bin/sh: Invalid argument" MobaXterm Personal 20.3 kTwOWgWAbG 1024x252 - How to fix Failed to start MariaDB error "Failed at step NAMESPACE spawning /bin/sh: Invalid argument"](https://i0.wp.com/pcx3.com/wp-content/uploads/2021/11/MobaXterm_Personal_20.3_kTwOWgWAbG.png?resize=736%2C181&ssl=1)