Job for supervisord.service failed because the control process exited with error code. See "systemctl status supervisord.service" and "journalctl -xe" for deta

created at 10-21-2021 views: 112

background

my machine suddenly not work, can not start mysqld or supervisord etc.

whenever I try to run a command like

sudo systemctl restart [application]

it just reports error:

Job for supervisord.service failed because the control process exited with error code. See "systemctl status supervisord.service" and "journalctl -xe" for deta

reason

this problem is often caused by 100% use of our disk

solution

In linux, check the disk usage:

sudo df -h

Linux disk occupation: /dev/nvme0n1p1 occupies 100%:

[user@localhost ~]$ sudo df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        3.7G     0  3.7G   0% /dev
tmpfs           3.7G  8.0K  3.7G   1% /dev/shm
tmpfs           3.7G   17M  3.7G   1% /run
tmpfs           3.7G     0  3.7G   0% /sys/fs/cgroup
/dev/nvme0n1p1  8.0G  8.0G  0      100% /

note the last line in the above example, some may be named as /dev/vda1 or /dev/xvda1

the problem is obvious: we have no more free disk

and I would guess we can solve this problem by clear some logs 

here is the result after clearing some logs:

[user@localhost ~]$ sudo df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        3.7G     0  3.7G   0% /dev
tmpfs           3.7G  8.0K  3.7G   1% /dev/shm
tmpfs           3.7G   17M  3.7G   1% /run
tmpfs           3.7G     0  3.7G   0% /sys/fs/cgroup
/dev/nvme0n1p1  8.0G  7.9G  156M  99% /

at this time I could start all my applications without problem.

how to clear logs

to clear some heavy logs, we can use command like:

truncate -s 0 name.log

this command would clear the content of the log named name without deleting the file itself.

or in a directory with multiple logs, we call clear contents for all .log files

truncate -s 0 *.log

start * matches all files end with .log.

created at:10-21-2021
edited at: 10-21-2021: