Tag Archives: Linux

Centos Service Cannot Start: Failed to start Login Service Failed to start Install ABRT coredump hook

Error information:

Failed to start Install ABRT coredump hook
Failed to start Login Service

Solution:

Use the U disk system, enter the system files, find the server’s hard disk, create a new folder new (if you don’t have permission, use sudo MKDIR new), mount the files to new mount/dev/mapper/CentOS root new , enter new, modify the config file VI etc/SELinux/config , and change SELinux = enforcing to SELinux = disable , Save the file and restart

[root@ny01 ~]# vi /etc/selinux/config 

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disable
# SELINUXTYPE= can take one of three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

Linux encountered a problem when installing RPM package error:Failed dependencies Solution method

Environment: CentOS 7.2 + mysql-server-5.5.31-2.el6.i686.rpm

Problems encountered:

[ root@sh158-xen data]#rpm -ivh MySQL-server-5.5.31-2.el6.i686.rpm

error: Failed dependencies:

        libaio.so.1 is needed by MySQL-server-5.5.31-2.el6.i686
        libaio.so.1(LIBAIO_ 0.1) is needed by MySQL-server-5.5.31-2.el6.i686
        libaio.so.1(LIBAIO_ 0.4) is needed by MySQL-server-5.5.31-2.el6.i686

 
After struggling for a long time, we finally found a solution: (thank you for providing relevant articles)

Add two parameters after the installation package, such as

[ root@VM_ 55_ 2_ centos mysql]#   rpm -ivh MySQL-server-5.5.31-2.el6.i686.rpm –nodeps –force
Preparing…                 ########################################### [ 100%]
   1:MySQL-server            ########################################### [ 100%]

 
The significance of adding those two parameters is that during installation,
the dependency relationship between packages is no longer analyzed and the package is installed directly,
there will be no error such as error: failed dependencies

How to Solve Error: failed dependencies error resolution

# rpm -ivh php-mbstring-5.3.3-3.el6_2.8.x86_64.rpm

warning: php-mbstring-5.3.3-3.el6_2.8.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY

error: Failed dependencies:

php-common = 5.3.3-3.el6_2.8 is needed by php-mbstring-5.3.3-3.el6_2.8.x86_64

When installing rpm, the error is error: Failed dependencies:.
This error is due to the problem of function dependencies, no dependencies, the installation failed
You can add the following parameter –nodeps –force

# rpm -ivh php-mbstring-5.3.3-3.el6_2.8.x86_64.rpm  –nodeps –force
warning: php-bcmath-5.2.17-1.el6.art.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5ebd2744: NOKEY
Preparing…                ########################################### [100%]
1:php-bcmath             ########################################### [100%]

Install Success

Makefile:xxx: recipe for target ‘xxx’ failed

When using makefile to run the executable file generated in the current directory: m akefile:3 : recipe for target 'test' failed similar error. It is very likely that the value returned to make after the program running is not 0.

1.test.c

#include<stdio.h>

int main(){
	
	printf("----------------\n");

	return 2;
}

2. Makefile
target: requests
[tab] command
must be preceded by the tab key

test : test.c
	clang test.c -o test 
	./test 

Command line running: make test

3. Modify the return value of the end of test. C program

#include<stdio.h>

int main(){
	
	printf("----------------\n");

	return 0;
}

4. Command line operation: make test

business as usual!

Failed to start docker.service: Unit not found(Docker service does not start)

Linux deployment docker appears: failed to start docker.service : unit not found
linux has deployed k8s and other projects before, Some of the remaining dockers are damaged
after re installation, the service always fails: failed to start docker.service : unit not found
warning: if applicable to my situation, it needs to be reinstalled

solution:
Direct Yum update
be sure to restart Linux
Yum install docker
systemctl start docker.service

Failed to restart network.service: Unit network.service not found

This problem occurs when you restart after configuring the network settings. The reason for this problem is due to the connection with the network manager   The solution is to shut down NetworkManager and restart the network service

service NetworkManager stop //关闭NetworkManager
service network restart //启动network服务 (vm 下安装 centos 可用 nmcli c reload 命令启动)

The difference between network and NetworkManager
Network: after the configuration information of network card and network control network interface is changed, the network service must be restarted to activate the new configuration of the network and make the configuration effective. This part of the operation is the same as starting the system again. Control (control) is the file/etc/init.d/network. You can use this file with the following parameters to operate network services

Network manager: it is a program to detect the network and automatically connect to the network. Whether it’s wireless or wired, it’s easy to manage. For wireless network, network manager can automatically switch to the most reliable wireless network. The program of network manager can switch between online mode and offline mode freely. Network manager can give priority to wired network and support VPN. The network manager was originally developed by RedHat and is now managed by gnome

Some commands about network manager are arranged as follows:

service NetworkManager stop //close NetworkManager
service NetworkManager status //check NetworkManager status
chkconfig NetworkManager off //Disable boot-up
chkconfig NetworkManager on //boot-up
service NetworkManager start //Temporarily start
chkconfig NetworkManager off // Permanently disable the NetworkManager hosting tool

VIM edit prompt swap file already exists solution

When editing an .ini file on a linux server, it gets stuck and when you close the connection tool and re-enter to work on the .ini file, you are prompted.

E325: ATTENTION
Found a swap file by the name “.xxx.ini.swp”

(1) Another program may be editing the same file. If this is the case,

be careful not to end up with two different instances of the same

file when making changes. Quit, or continue with caution.

(2) An edit session for this file crashed.

If this is the case, use “:recover” or “vim -r other.conf”

to recover the changes (see “:help recovery”).

If you did this already, delete the swap file “.other.conf.swp”

to avoid this message.

Swap file “.xxx.ini.swp” already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:

 

Solution.

Execute the following command in the directory where the file is located.

ls -a

Check the hidden files in the current directory and find the .xxx.ini.swap file

Delete the file by executing the delete command

rm -rf .xxx.ini.swap

Execute vim xxx.ini again and you will not be prompted.

Wait in Linux kernel_ event_ interruptible_ Analysis of timeout interface

1. Prototype

  #define wait_ event_ interruptible_ timeout(wq_ head, condition, timeout) \
  ({ \
    long __ ret = timeout; \
    might_ sleep(); \
    if (!___ wait_ cond_ timeout(condition)) \
      __ ret = __ wait_ event_ interruptible_ timeout(wq_ head, \
                    condition, timeout); \
      __ ret; \
  })

2. Use scenarios

Sleep to meet the conditions or time out of sleep

3. It supports interruptible sleep, which means that it can send a signal to the sleep process, and the process will respond to the signal

4. Return value analysis

4.1 when the return value is greater than 0, it means that the remaining time (in Jiffy unit) is returned. If the condition is satisfied, that is, it has not timed out, and the condition has been reached, it will wake up

4.2 when the return value is 0, it means timeout and Automatic wake-up. At this time, handle the error according to the situation