DirectAdmin dead but subsys locked Error
In this tutorial, we will explore how to fix the “DirectAdmin deceased but subsys locked” error.
DirectAdmin is a web-based hosting management panel designed to simplify administration. DirectAdmin is compatible with constantly evolving hosting environments. It is often referred to as DA for short. DirectAdmin runs on any system with minimal configurations and uses port 2222 by default.
Check DA status
This will help determine if your DirectAdmin is currently running. To check the current status of your DirectAdmin, execute the command below. Make sure you are logged in as the root user.
# service directadmin status
Deceased but subsys locked
If you encounter the status ‘DirectAdmin deceased but subsys locked’, it means that DirectAdmin is not currently running on your server, but the ‘pid’ file is present. PID refers to the process identification number, which uniquely identifies each process in a system. If you receive this status message, you will not be able to access your DirectAdmin control panel. This can be a significant issue as it hampers your ability to manage your server. To regain access to your control panel, you need to restart the DirectAdmin service. Restarting the service may be a bit challenging in this scenario, but I can provide guidance to help you get your DirectAdmin service up and running again. This will enable you to regain access to your DirectAdmin control panel.
How to resolve it?
Confirm DirectAdmin is deceased
Before restarting the service, you must ensure that DirectAdmin is no longer running. You can check this using the ‘ps’ command. The ‘ps’ command provides information about currently running processes, including their process identification numbers (PIDs). By utilizing ‘grep’, a powerful pattern matching tool used in all Unix/Linux-based systems, you can print only the information relevant to DirectAdmin. Make sure you are logged in as the root user when performing this check.
# ps -aux | grep directadmin
root 22755 0.0 0.0 6444 692 pts/0 S+ 06:51 0:00 grep directadmin
If this command displays a ‘grep’ line, it indicates that there are no DirectAdmin processes currently running on your system. You can now verify that DirectAdmin is indeed deceased.
Kill the process
If the above command displays any lines other than the ‘grep’ line, it means that DirectAdmin processes are present in the system. These processes have no effect as the DirectAdmin service is inactive. However, they will hinder the start/restart operations on the DirectAdmin service. To restart your DirectAdmin service, you must kill these processes using their process ID. The ‘kill’ command terminates a process using the specified process ID provided by the user. You can obtain the process ID from the output of the ‘ps’ command. To kill a process, use the ‘kill’ command followed by the process ID.
# kill <pid>
where <pid> represents the number displayed in the second column of the ‘ps’ output.
After following the previous method, check the ‘ps’ line again. This is to ensure that all DirectAdmin processes have been terminated by now.
# ps waux | grep directadmin
If the output still displays any lines other than the ‘grep’ line, you need to force kill all the existing processes with their respective process IDs. There are two ways to force kill a process using the process ID in Unix/Linux-based systems.
# kill -9 <pid>
# kill -SIGKILL <pid>
Use either method to force kill all the existing DirectAdmin processes.
Remove pid file
A Pid-File is a file that stores the process identification number (PID) at a well-defined location in the filesystem. This allows other programs to retrieve the PID of a running script. Once all instances of DirectAdmin are stopped, verify if there is a file located at /var/run/directadmin.pid. If you find this file, remove it using the ‘rm’ command.
# rm /var/run/directadmin.pid
Finally, restart the DirectAdmin service. You can do this by executing the following command:
# service directadmin restart