Category Archives: Linux

Linux Log Error: cannot update mailbox /var/mail/root for user root. error writing messa ge: File too large

When checking the server in the morning, I accidentally found this log error in tail – F/var/log/message,

cannot update mailbox /var/mail/root for user root. error writing messa ge: File too large

Earlier today while looking into an issue on a CentOS Linux server I noticed an error message in the maillog file. The mail server running on this Linux server is Postfix and it appeared to have been complaining of the size of root’s mailbox located at /var/mail/root. When I first started investigating I figured I was going to see root’s mailbox at a size of 1GB or 2GB but I was surprised when looking into the issue that root’s mailbox was only about 48MB in size so at first I thought there might be another problem. After some digging around in /etc/postfix I figured out that Postfix limits the size of local mailboxes to 51200000 bytes or 48.8MB. Below is information on how I discovered the issue as well as how to modify the size that Postfix limits local mailboxes to.
You can use postconf -n to view the relevant configuration information, as follows;

[root@localhost ~]# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
html_directory = no
inet_interfaces = localhost
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
sample_directory = /usr/share/doc/postfix-2.10.1/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550

The main reason for this problem is that in the postfix configuration file main.cf.default

mailbox_size_limit = 51200000(50M)

That is, when the size of the user’s corresponding/var/mail/username file cannot exceed 50m, if it exceeds this value, it may be unacceptable to send.

Solution:

Yes, reset  postfix main.cf.default the corresponding mailbox in the configuration file_size_limit=51200000

If change to mailbox_size_imit = 0, there is no limit

Or:

[root@localhost ~]# postconf -e mailbox_size_limit=0

After modifying postfix maincf You need to reload postfix # service # postfix # reload when deafault configuration file is

[Solved] Nginx: [error] open() "/usr/local/Nginx/logs/Nginx.pid

Restart the server, access the web service and find that you can’t browse! After logging in to the server, I went to nginx and used. /nginx -s reload to re-read the configuration file, and found that nginx: [error] open() “/usr/local/nginx/logs/nginx.pid” failed (2: No such file or directory), went to the logs file and found that there was no nginx.pid file
[root@localhost sbin]# . /nginx -s reload
nginx: [error] open() “/usr/local/nginx/logs/nginx.pid” failed (2: No such file or directory)

Solution:
[root@localhost nginx]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
Use the nginx -c argument to specify the location of the nginx.conf file
[root@localhost nginx]# cd logs/
[root@localhost logs]# ll
Total usage 12
-rw-r–r– 1 root root 1246 Dec 9 18:10 access.log
-rw-r–r– 1 root root 516 Dec 10 15:39 error.log
-rw-r–r– 1 root root 5 Dec 10 15:38 nginx.pid
Look at the nginx.pid file already.

[Solved] Emqx – /usr/lib/emqx/bin/cuttlefish: error while loading shared libraries: libtinfo.so.5: cannot ope

linux Install EMQX error: error while loading shared libraries: libtinfo.so.5
/usr/lib/emqx/bin/cuttlefish: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory

When we installed Emqx on Linux, we found that always at boot time (. /emqx console), it reported an error: /usr/lib/emqx/bin/cuttlefish: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory; at first I thought it was a version problem, I tried various versions on the EMQ website, as well as binary packages and zip packages, but there was no way to avoid the above error message, and the startup failed.

Solution:
# find/-name libtinfo.so
/usr/lib64/libtinfo.so
# ll /usr/lib64/ |grep libtinfo.so
-rwxr-xr-x  1 root root   179264 Sep 19  2019 libtinfo.so.6.0
# sudo ln -s /usr/lib64/libtinfo.so.6.0 /usr/lib64/libtinfo.so.5
lrwxrwxrwx  1 root root       26 Oct 26 07:32 libtinfo.so.5 -> /usr/lib64/libtinfo.so.6.0

[Solved] ADB Connect Error: failed to start daemon

Generally, the port is occupied. Find the process occupying the port and kill the process

1.netstat -ano | findstr :5037

Find the port occupation according to the log prompt (my prompt here is 5037, which depends on your own situation)

Most of them are 5037. It is estimated that the port is not normally released due to the previous abnormal exit of ADB, so it cannot be started normally

2. Tasklist | findstr 5756 (in this step, you can view the process information of the specific occupied port)

3. Kill the process occupying the port

Taskkill – F – PID 5756 (sometimes it cannot be killed directly in the windows task manager. It is recommended to use this command to kill)

Start virtual device

adb devices

You can query the equipment

How to Solve Disk Unmount Error: device is busy

# umount /dev/sda2

umount: /: target is busy.

perhaps

umount: /dev/sda2: device is busy

This is because some users are using files on the current disk. There are two solutions:

① Force uninstall (not recommended)

umount -l /dev/sda2

② After confirming with the user, close the processes related to these open files

see:

lsof /dev/sda2

Kill program:

lsof /dev/sda2 | awk ‘{print $2}’ | xargs kill -9

Uninstall:

umount /dev/sda2

[Solved] Linux: file name is garbled and cannot be deleted

Phenomenon:

As shown in the figure, use ls to view the files in the directory. It is found that the file name has garbled codes and strange symbols, which cannot be deleted by RM command;

Solution:

At this time, the file can be deleted through the inode of the file

Operation process:

Use LS – Il to view the file inode

Use the command find- Inum XXXX – delete delete delete file

End

Linux Configure Redis make Commands Error [Solved]

An error is reported in the make command for configuring redis on Linux

1. After decompressing the redis file, execute the make command and an error is reported:

Solution:

The reason is that the GCC version of Linux system is too low, and the GCC installed by Yum is 4.8.5.GCC needs to be upgraded

Command line input:

yum -y install centos-release-scl
yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils
scl enable devtoolset-9 bash
echo "source /opt/rh/devtoolset-9/enable" >> /etc/profile
gcc -v

Decompress the redis file again

Execute the make command, as shown in the following figure, OK!

[Solved] Linux Start solr Error: Your Max Processes Limit is currently 31202. It should be set to 65000 to avoid operational disruption.

Execute the startup specification after entering the bin directory

./solr start

report errors

What should I do?

View system limits

 ulimit -a

Now you need to change the system limit and log in to the root account

Locate the file/etc/security/limits At the end of conf, add the following two lines [added by default in some systems]

* soft nofile 65535
* hard nofile 65535

Then locate the file/etc/security/limits d/20-nproc.conf

Change 4096 to 65535

Login again and take effect after modification

docker pull Error: Get https://hub.xxx.com/v1/_ping: dial tcp 192.168.1.8:443: getsockopt: connection refused

This problem is encountered when building your own docker warehouse on the intranet because docker does not support HTTP registry by default,

vim /etc/docker/daemon.JSON {“secure registers”: [“hub.Zuobiao.Com”]}

Restart docker

systemctl restart docker. service

Harbor pull code, and you need to log in first:

docker login http://192.168.1.191/ -u username -p password

[Solved] “/usr/local/bin/docker-compose: Permission denied”

Because the task needs to deploy the docker compose tool environment in the server, I reported the error “/usr/local/bin/docker compose: permission denied” when viewing the version. This error message should be due to insufficient permissions

Authorize at this time:

chmod +x /usr/local/bin/docker-compose

Then check the version and it will be normal