Tag Archives: CentOS

Error reporting on CentOS startup: a solution to failed to start crash recovery kernel arming

After chopping hands, the fraud call came before the express delivery was received. How to improve the privacy and security of e-commerce>>>

about CentOS startup error: the solution of failed to start crash recovery kernel arming

Reference article:

(1) Error reporting on CentOS startup: a solution to failed to start crash recovery kernel arming

(2) https://www.cnblogs.com/albertrui/p/8127498.html

Let’s make a note.

CentOS starts nginx and prompts nginx: [emergency] still could not bind ()

Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>

[root@iZbp1aed32ln6eZ sbin]# netstat -ntlp|grep 80
tcp        0      0 127.0.0.1:8005          0.0.0.0:*               LISTEN      1501/java           
tcp        0      0 0.0.0.0:8009            0.0.0.0:*               LISTEN      1501/java           
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      7225/nginx: master  
tcp        0      0 0.0.0.0:8081            0.0.0.0:*               LISTEN      7036/java           
[root@iZbp1aed32ln6eZ sbin]# kill -9 7225
[root@iZbp1aed32ln6eZ sbin]# ./nginx -s reload
nginx: [alert] kill(7225, 1) failed (3: No such process)
[root@iZbp1aed32ln6eZ sbin]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
[root@iZbp1aed32ln6eZ sbin]# netstat -ntlp|grep 80
tcp        0      0 127.0.0.1:8005          0.0.0.0:*               LISTEN      1501/java           
tcp        0      0 0.0.0.0:8009            0.0.0.0:*               LISTEN      1501/java           
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      7276/nginx: worker  
tcp        0      0 0.0.0.0:8081            0.0.0.0:*               LISTEN      7036/java           
[root@iZbp1aed32ln6eZ sbin]# killall -9 nginx
[root@iZbp1aed32ln6eZ sbin]# systemctl restart nginx
Failed to restart nginx.service: Unit not found.
[root@iZbp1aed32ln6eZ sbin]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
[root@iZbp1aed32ln6eZ sbin]# ./nginx -s reload

Bug [virtual machine error reporting]: summary of RM: cannot remove X: read only file system in CentOS

This article gives you a comprehensive understanding of Java object serialization and deserialization>>>

Problem Description: when I finished the test on the virtual machine, in the process of clearing the project in the environment, the file system was damaged due to misoperation. Some log files became read-only files and could not be deleted. This error was reported. The specific cause of misoperation will be analyzed later

The problem is: RM: cannot remove ` 03/03a707c4dce673e63218917d710388. Cache ‘: read only file system

Solution:

DF - M ᦇ to view the file system partition, the biggest one is the file system used by the system DF – M ᦇ to view the file system partition

mount # or view the file system partition in this way

fsck - Y/dev/mapper/volgroup00-logvol00 ᦇ perform repair of file system

shutdown - r now ᦇ restart the system after repair

Then run RM - RF again, and you won't be prompted to read only file system

Unknown file system type ‘NTFS’ on NTFS U disk mounted by CentOS

mount: unknown filesystem type ‘ntfs’

This is because NTFS formatted partitions are not recognized on CentOS

solution:
it can be solved by using ntfs-3g
open the download point of ntfs-3g http://www.tuxera.com/community/ntfs-3g-download/

Compile and install:

Storage location of source code

cd /usr/local/src/

Download the latest version of the source code package

wget https://tuxera.com/opensource/ntfs-3g_ ntfsprogs-2017.3.23.tgz

Unzip source code package

tar -zxvf ntfs-3g_ ntfsprogs-2017.3.23.tgz

Enter the extracted package directory

cd ntfs-3g_ ntfsprogs-2017.3.23

Generate configuration file

./configure

Compile

make

Installation

make install

This is the end of the installation

Then hang up the disk, this time hang up the U disk

mount -t ntfs-3g /dev/sdb1 /mnt/usb

Why do I use/dev/sdb1 here to see it with fdisk – L

I have the following information on my side

Disk /dev/sdb: 31.0 GB, 31029460992 bytes
255 heads, 63 sectors/track, 3772 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 * 104 3716 29014016 7 HPFS/NTFS
/dev/sdb2 3716 3773 458751+ 1b Hidden W95 FAT32

So I hung sdb1, which is the NTFS

Unload U disk: after using U disk, you need to type the unload U disk command before unplugging it
the command is as follows: umount/MNT/USB

Before unloading, do not mount the current path on the U disk, but switch to another directory to unload normally

In addition, if you want to mount the sdb2 listed above, the command is as follows

mount /dev/sdb2 /mnt/usb

I did the whole test under CentOS 6.10

My wechat: my QQ:

Centos7 Install virtualenv Error bash: virtualenv: command not found…

After installing python3

1. Install virtualenv with PIP3

pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple virtualenv

The above image has been installed successfully

2. Virtualenv: command not found

3. Add environment variable to solve the problem

(1) Using find/- name ‘ virtualenv.py ‘does it exist

It can be found in the figure below

(2) Add environment variable

Steps:

vim /etc/profile
# Add the following to the bottom of the file
PATH=$PATH:/usr/local/python3/bin

# is the command added to take effect
source /etc/profile

# Finally, check if the file was added successfully
echo $PATH

Example card:

(3)Reuse virtual env

# Use virtualenv to create a python3 environment with the command demo1
virtualenv --python=/usr/bin/python3 demo1
# Go to /demo1/bin under the virtual slow directory and start the virtual environment with the command
source activate

How to Solve dracut-initqueue Warning: dracut-initqueue timeout – starting timeout scripts

Presumably, many people encounter the problem of dracut initqueue: warning: dracut initqueue timeout – starting timeout scripts when installing centos7 or clearos7 on USB flash disk

To tell you the truth, I had a headache for half a month when I met him. I checked a lot of information on the Internet. I really want to greet those crawler blogs and those XX that Baidu knows.

There are two solutions

1. Use DVD to install. (it’s not nonsense. What else can I do with a USB flash drive if I can use a DVD.).

You can’t use DVD to watch it

2. This problem is easy to solve. Some people say that DD is used to install the USB flash disk, and another blog says that he used a fake USB flash disk… In fact, the real cause of the problem is the path problem, repair this problem super simple, simple to cry!!! Well, enough crying, again to those XX, Sb two words, next talk about how to solve.

Solution 1: modify the U disk label! You don’t believe it.

Solution 2: modify the Startup menu. You don’t believe it when you say it

You can open ISO to see, in/isolinux/ isolinux.cfg Find install CentOS 7

Here inst.stage2=hd :LABEL=CentOS\x207\x20x86_ 64

That’s what caused the timeout, inst.stage2 This should point to a specific address. If it is a DVD, its label is “CentOS 7 x86″_ 64 “, and the USB flash disk may be your own label. As a result, DVD can be installed normally, but USB flash disk can’t. So the two solutions mentioned above are actually modifying the same reason.

Therefore, there are two specific operations

1. Modify/isolinux directly/ isolinux.cfg Lihd: label = the specific label of the USB flash disk, or change the label of the USB flash disk to “CentOS 7 x86″_ 64 “, install according to the normal process. If you are afraid of the influence of space, put it isolinux.cfg At the same time, the U disk label also removes the space.

2. When you choose to install CentOS, select Install CentOS 7, and then modify it. Press e to enter the modification status. Change HD: label = to the label of the USB flash disk, or to the specific path of the current USB flash disk in the installation machine, which is generally/dev/hda1, etc. Chestnut: “HD: label =/dev/hda1”, and then press Ctrl + X to start the installation.

Of course, I still recommend modifying the label.

If you don’t know the path of your USB flash drive, you can change it to DD liunx first. After execution, a list will appear to judge the specific path of your USB flash drive according to the label

When the install CentOS 7 option appears after startup, select “install CentOS 7” and press e to enter editing“ inst.stage2=hd :LALBEL=Centos\x207\x20x86_ 64 “to” DD Linux “, then press Ctrl + X to execute, and the list will appear later. Remember the path, restart, and edit the menu changes as well“ inst.stage2=hd :/dev/sda1 “(/ dev/sda1 is the path of the list). Press Ctrl + X again to install it normally

Finally, I wish you a smooth installation.

Solution of welcome to emergency mode! When CentOS 7 starts up

Centos7.3 was used well yesterday, but the boot prompt today is as follows (as shown in the figure):
welcome to emergency mode! after logging in ,type “journalctl -xb” to view system logs,“systemctl reboot” to reboot ,“systemctl default” to try again to boot into default mode。
give root password for maintenance
(?? Control-D???) :

After checking, it is because I wrote the CD in/etc/fstab to mount automatically, but the boot is not successful.

Solution: there is a problem with the fstab file that is automatically mounted, you can directly enter the password in this interface, and then delete the one you added, and restart OK
1: log in to the root garbled code, and also enter the password
2: VIM/etc/fstab, check the disk mounting information
3: comment out the content you added, and delete it if you are sure you are not using it
4: restart OK.

This error is mostly due to the error in the/etc/fstab file. Pay attention to whether the external hard disk, memory or network commons are loaded and not loaded during restart.

How to Enable EPEL Repository for CentOS 7.x/6.x/5.x

What is EPEL

EPEL(Extra Packages for Enterprise Linux) is open source and free community based repository project from Fedora team which provides 100% high quality add-on software packages for Linux distribution including RHEL (Red Hat Enterprise Linux), CentOS, and Scientific Linux. Epel project is not a part of RHEL/Cent OS but it is designed for major Linux distributions by providing lots of open source packages like networking, sys admin, programming, monitoring and so on. Most of the epel packages are maintained by Fedora repo.

Why we use EPEL repository?

Provides lots of open source packages to install via Yum.

Epel repo is 100% open source and free to use.

It does not provide any core duplicate packages and no compatibility issues.

All epel packages are maintained by Fedora repo.

How To Enable EPEL Repository in RHEL/CentOS 7/6/5?

First, you need to download the file usingWgetand then install it usingRPMon your system to enable the EPEL repository. Use below links based on your Linux OS versions. (Make sure you must berootuser).

RHEL/CentOS 7 64 Bit

##RHEL/CentOS764-Bit###wgethttp://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
#rpm-ivhepel-release-7-5.noarch.rpm

RHEL/CentOS 6 32-64 bit

##RHEL/CentOS632-Bit###wgethttp://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
#rpm-ivhepel-release-6-8.noarch.rpm##RHEL/CentOS664-Bit###wgethttp://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
#rpm-ivhepel-release-6-8.noarch.rpm

RHEL/CentOS 5 32-64 bit

##RHEL/CentOS532-Bit###wgethttp://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
#rpm-ivhepel-release-5-4.noarch.rpm##RHEL/CentOS564-Bit###wgethttp://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
#rpm-ivhepel-release-5-4.noarch.rpm

RHEL/CentOS 4 32-64 bit

##RHEL/CentOS432-Bit###wgethttp://download.fedoraproject.org/pub/epel/4/i386/epel-release-4-10.noarch.rpm
#rpm-ivhepel-release-4-10.noarch.rpm##RHEL/CentOS464-Bit###wgethttp://download.fedoraproject.org/pub/epel/4/x86_64/epel-release-4-10.noarch.rpm
#rpm-ivhepel-release-4-10.noarch.rpm

How Do I Verify EPEL Repo?

You need to run the following command to verify that the EPEL repository is enabled. Once you ran the command you will see epel repository.

#yumrepolist

Sample Output

Loadedplugins:downloadonly,fastestmirror,priorities
Loadingmirrorspeedsfromcachedhostfile
*base:centos.aol.in
*epel:ftp.cuhk.edu.hk
*extras:centos.aol.in
*rpmforge:be.mirror.eurid.eu
*updates:centos.aol.in
ReducingCentOS-5Testingtoincludedpackagesonly
Finished
1469packagesexcludedduetorepositorypriorityprotections
repoidreponamestatus
baseCentOS-5-Base2,718+7epelExtraPackagesforEnterpriseLinux5-i3864,320+1,408extrasCentOS-5-Extras229+53
rpmforgeRedHatEnterprise5-RPMforge.net-dag11,251
repolist:19,075

How Do I Use EPEL Repo?

You need to useYUMcommand for searching and installing packages. For example we search forZabbixpackage using epel repo, lets see it is available or not under epel.

#yum--enablerepo=epelinfozabbix

Sample Output

AvailablePackages
Name:zabbix
Arch:i386
Version:1.4.7
Release:1.el5
Size:1.7MRepo:epelSummary:Open-sourcemonitoringsolutionforyourITinfrastructure
URL:http://www.zabbix.com/
License:GPL
Description:ZABBIXissoftwarethatmonitorsnumerousparametersofanetwork.

Let’s installZabbixpackage using epel repo option�enablerepo=epelswitch.

#yum--enablerepo=epelinstallzabbix

Note: The epel configuration file is located under/etc/yum.repos.d/epel.repo.

This way you can install as many as high standard open source packages usingEPELrepo.