Tag Archives: linux

Nginx Startup Error: Job for nginx.service failed because the control process exited with error code

When we use systemctl     restart   When the nginx command restarts the service, an error is found as follows:

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

First, we can use systemctl     status   nginx   View current nginx status

systemctl status nginx
● nginx.service - nginx - high performance web server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Fri 2021-08-06 15:04:33 CST; 4min 10s ago
     Docs: http://nginx.org/en/docs/
  Process: 2099 ExecStop=/bin/sh -c /bin/kill -s TERM $(/bin/cat /var/run/nginx.pid) (code=exited, status=0/SUCCESS)
  Process: 2131 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=1/FAILURE)
 Main PID: 1498 (code=exited, status=0/SUCCESS)

Aug 06 15:04:33 localhost.localdomain systemd[1]: Starting nginx - high performance web s.....
Aug 06 15:04:33 localhost.localdomain nginx[2131]: nginx: [warn] the "ssl" directive is d...:5
Aug 06 15:04:33 localhost.localdomain nginx[2131]: nginx: [emerg] cannot load certificate...e)
Aug 06 15:04:33 localhost.localdomain systemd[1]: nginx.service: control process exited, ...=1
Aug 06 15:04:33 localhost.localdomain systemd[1]: Failed to start nginx - high performanc...r.
Aug 06 15:04:33 localhost.localdomain systemd[1]: Unit nginx.service entered failed state.
Aug 06 15:04:33 localhost.localdomain systemd[1]: nginx.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

The first method: we find that the port is occupied, and use the command to view the process of the occupied port: netstat – anltp |  grep   eighty

View the occupied process number   Then kill   – nine   Process number   Restart after killing the process

The second method: we may have configuration errors when modifying the/etc/nginx/conf.d/default.conf or/etc/nginx/nginx.conf file. Recheck the editing. If we really can’t find the error, we can enter the error log of nginx to check: Tail – F/var/log/nginx/error.log     Specific modifications can be made according to the error file of nginx

Troubleshooting of Ubuntu wrk installation error

Installation Preferences

https://blog.csdn.net/qq_41030861/article/details/90553510

git clone https://github.com/wg/wrk.git 

cd mrk
make
ln -s /xxx/mrk/mrk  /usr/local/bin

be careful

The compilation environment
needs to be installed, including C, C + +
related C libraries, Lua, etc

report errors

echo LuaJIT-2.1
LuaJIT-2.1
make: unzip: Command not found
Makefile:81: recipe for target ‘obj/LuaJIT-2.1’ failed
make: *** [obj/LuaJIT-2.1] Error 127

Error reporting solution

Linux system does not have its own compression and decompression tools; We need to install it ourselves; When Zip or unzip is used, unzip: command not found or zip: command not found will appear if it is not installed; This happens because unzip and zip are not installed;

sudo apt-get install zip

Vscode remote connection server reports an error: could not establish connection to “XXXXXX” [resolved]

Suppose you have made the following configuration and try

    install remote SSH in the extensions, add the IP address of the server you want to access, and have a config file (as shown in the figure below)
    please remember the path of this config file, which is generally “C: \ users \ user”_ Name \. SSH \ config “
    so you start trying to connect to the server. After selecting Linux/windows from the top drop-down menu, you unfortunately fail

    Error message:

    After the popup window of could not establish connection to “XXX” appears, check the error information below. If the error information contains:

    resolvent:

      Open extensions in the left column, find the installed remote SSH, right-click, select “extension settings”
      , enter the config file path in config file, and try to connect again. It is found that the connection is successful

Error: EACCES: permission denied, unlink ‘xxxx/xxxx/xxxx‘ [How to Solve]

Scenario: on the Mac, if you want to use the code command to open vs code, (CMD + Shift + P) search the shell, find this:

Results Click to find:

	Error: EACCES: permission denied, 
	unlink '/usr/local/bin/code'

In fact, I don’t have read-write permission, and it’s ineffective to search a lot on the Internet. However, I’m used to using the command line to open vs code. The final solution is:

Enter at the command line

sudo chown -R [yourusername] [filePath]

Yourusername: user preferences – & gt; Users and groups – & gt; Current user
filepath: the path displayed when an error is reported

Tips: if not, try to move the path forward. Take me as an example:

sudo chown -R xxx /usr/local/bin

Linux accesses the shared directory of windows, pysmb (parameter remote)_Name (defined)

Scheme I

net use this command is only available under windows.

Scheme II

sudo mount -t cifs -o username=administrator,password=password //remote_ share_ server_ ip/share_ Dir./data
this command must use root permission. It cannot be implemented for applications that cannot use root permission. If there is no sudo, an error will be reported:
mount: only root can use "-- options" option

Programme III

Python package pysmb

def check_unc_source(self, unc_path, username, password):
    conn = SMBConnection(username, password, '', remote_name, is_direct_tcp=True)
    result = conn.connect('remote_share_server_ip', 445)
    with open("local_file", "wb") as local_file:
        conn.retrieveFile("share_dir", "file", local_file)

The 4th parameter of SMBConnection, remote_name:

The NetBIOS machine name of the remote server.
On windows, you can find out the machine name by right-clicking on the “My Computer” and selecting “Properties”.
This parameter must be the same as what has been configured on the remote server, or else the connection will be rejected.

You can actually fill in the IP address of the server where the Windows remote shared directory is located, i.e. the same as the first parameter remote_share_server_ip of conn.connect, if it is empty, an error will be reported:
smb.smb_structs.OperationFailure: Failed to retrieve [file] on share_dir: Unable to connect to shared device

Ubuntu 20.04 GPG: KeyServer receive failed: connection timed out when installing ROS configuration key

GPG: KeyServer receive failed: connection timed out

Solution 1. Change your mobile hotspot

Solution 2 (switching network configuration):

Most of this is a network problem. If the virtual machine uses the bridge mode, it can access the Internet, but it may not be connected to these public networks. At this time, we can configure the network of the virtual machine to NAT mode( Try not to make the bridge mode automatic)

Solution 3 (modify network configuration):

sudo vi /etc/resolv.conf

Options edns0 trust-ad

[Solved] Exception in replication between CentOS virtual machine and host

Exception in replication between CentOS virtual machine and host

Question:

Error copying file from host to virtual machine:

Error when getting information for file “//tmp/VMwareDnD/p6v6B6/.”: No such file or directory

It was found that there was a problem with vmtools

resolvent:

1. Uninstalled packages

yum remove open-vm-tools

Prompt after success:

Delete:
  open-vm-tools.x86_64 0:11.0.5-3.el7                                           

Deleted as a dependency:
  open-vm-tools-desktop.x86_64 0:11.0.5-3.el7                                   

Done!

2. Restart

3. Install VMware Tools
return to the main interface of VMware application and click the “install VMware Tools” menu item in the “virtual machine” menu
4. Mount the CD-ROM to the specified directory

Usually, the device directory/dev/CDROM is mounted to the/MNT/CDROM directory.
if the CDROM directory does not exist in the/MNT directory, it is created

Check for CDROM

[root@centos7 /]# ll /mnt/cdrom/
Total 56849
-r-xr-xr-x. 1 xxxx xxxx     1976 3月  25 2020 manifest.txt
-r-xr-xr-x. 1 xxxx xxxx     4943 3月  25 2020 run_upgrader.sh
-r--r--r--. 1 xxxx xxxx     56414224 3月  25 2020 VMwareTools-10.3.22-15902021.tar.gz
-r-xr-xr-x. 1 xxxx xxxx     872044 3月  25 2020 vmware-tools-upgrader-32
-r-xr-xr-x. 1 xxxx xxxx     918184 3月  25 2020 vmware-tools-upgrader-64

Create if/MNT/CDROM does not exist

[root@centos7 /]# mkdir /mnt/cdrom

Mount directory

[root@centos7 /]# mount -t auto /dev/cdrom /mnt/cdrom
mount: /dev/sr0 Write-protected, will mount as read-only
mount: /dev/sr0 is mounted or /mnt/cdrom is busy
       /dev/sr0 has been mounted on /run/media/xxxx/VMware Tools
       /dev/sr0 is already mounted on /mnt/cdrom

Copy the installation package to the user’s home directory

[root@centos7 /]# cp /mnt/cdrom/VMwareTools-10.3.22-15902021.tar.gz /

Unmount

[root@centos7 /]# umount /dev/cdrom

Unzip the installation package

[root@centos7 /]# tar -zxvf VMwareTools-10.3.22-15902021.tar.gz

Installing VMware Tools

Enter the unzipped source directory

[root@centos7 /]# cd vmware-tools-distrib

run vmware-install.pl 文件

[root@centos7 vmware-tools-distrib]# ./vmware-install.pl

Then enter all the way and 0 yes
the last successful prompt

Generating the key and certificate files.
Successfully generated the key and certificate files.
The configuration of VMware Tools 10.3.22 build-15902021 for Linux for this 
running kernel completed successfully.

You must restart your X session before any mouse or graphics changes take 
effect.

To enable advanced X features (e.g., guest resolution fit, drag and drop, and 
file and text copy/paste), you will need to do one (or more) of the following:
1. Manually start /usr/bin/vmware-user
2. Log out and log back into your desktop session
3. Restart your X session.

Found VMware Tools CDROM mounted at /run/media/tong/VMware Tools. Ejecting 
device /dev/sr0 ...
Enjoy,

--the VMware team

[Solved] Snap Error: snap-confine has elevated permissions and is not confined but should be. Refusing to continue

I wanted to log in to the micro transmission point file with snap, but the error came suddenly. Baidu couldn’t find a solution.

Finally, I found a perfect solution on GitHub!!!

Just run the command. Note that you should use root permission!

systemctl enable --now apparmor.service

Note: if there is no AppArmor, use apt to install it!

Post the source of the solution:

https://github.com/ubuntu/microk8s/issues/249

Couldn‘t create temporary archive name. [How to Solve]

[root@HRBB03-PUB-UNDEFINED-26-ITC51 cmadmin]#
[root@HRBB03-PUB-UNDEFINED-26-ITC51 cmadmin]# vgcreate vg_data /dev/sdb
Couldn’t create temporary archive name.
[root@HRBB03-PUB-UNDEFINED-26-ITC51 cmadmin]#
[root@HRBB03-PUB-UNDEFINED-26-ITC51 cmadmin]#
[root@HRBB03-PUB-UNDEFINED-26-ITC51 cmadmin]# vgcreate vg_data /dev/sdb
Volume group “vg_data” successfully created
[root@HRBB03-PUB-UNDEFINED-26-ITC51 cmadmin]#

It could be that the , / root directory is running out of space and needs to be deleted.

[Solved] CUDA driver version is insufficient for CUDA runtime version

CUDA driver version is insufficient for CUDA runtime version

Question:

An error is reported when docker runs ONEFLOW code of insightface

 Failed to get cuda runtime version: CUDA driver version is insufficient for CUDA runtime version

reason:

1. View CUDA runtime version

cat /usr/local/cuda/version.txt

The CUDA version in my docker is 10.0.130

CUDA Version 10.0.130

2. The CUDA version has requirements for the graphics card driver version, see the following link.
https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html

CUDA Toolkit Linux x86 64 Driver Version Windows x86 and 64 Driver Version
CUDA 11.0.3 Update 1
CUDA 11.0.2 GA >= 450.51.05 >= 451.48
CUDA 11.0.1 RC >= 450.36.06 >= 451.22
CUDA 10.2.89 >= 440.33 >= 441.22
CUDA 10.1 (10.1.105 general release, and updates) >= 418.39 >= 418.96
CUDA 10.0.130 >= 410.48 >= 411.31
CUDA 9.2 (9.2.148 Update 1) >= 396.37 >= 398.26
CUDA 9.2 (9.2.88) >= 396.26 >= 397.44

cat /proc/driver/nvidia/version took a look at the server’s graphics card driver is 418.67, CUDA 10.1 should be installed, and I installed 10.0.130 cuda.

NVRM version: NVIDIA UNIX x86_64 Kernel Module  418.67  Sat Apr  6 03:07:24 CDT 2019
GCC version:  gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04)

solve:

Installing CUDA 10.1

(1) First in https://developer.nvidia.com/cuda-toolkit-archive According to the machine environment, download the corresponding cuda10.1 installation file. For the installer type, I choose runfile (local). The installation steps will be simpler.

wget https://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.243_418.87.00_linux.runsudo sh 

(2) Installation

sh cuda_10.1.243_418.87.00_linux.run

The same error occurred, unresolved
it will be updated when a solution is found later.