119 votes
Accepted

Create a directory under /var/run at boot

There are two alternatives to have systemd create directories under /var/run / /run. Typically the easiest is to declare a RuntimeDirectory in the unit file of your service. Example: RuntimeDirectory=...
HBruijn's user avatar
  • 80.3k
95 votes
Accepted

How to manage DNS in NetworkManager via console (nmcli)?

Here is the command to modify an existing connection. nmcli con mod "$connectionName" ipv4.dns "8.8.8.8 8.8.4.4" connectionName can be found by command: nmcli con. In the question ...
lauc.exon.nod's user avatar
75 votes
Accepted

How to shrink /home and add more space on CentOS7

As others have pointed out, XFS filesystem cannot be shrunk. So your best bet is to backup /home, remove and recreate its volume in a smaller size and give the rest to your /root volume just as Koen ...
Ari's user avatar
  • 866
71 votes
Accepted

Install a newer version of Git on CentOS 7

You could use a IUS repository (https://ius.io/) as provided on Git official site here or here. It contains prebuilt binaries for x86_64. To do that, run (as root): yum install epel-release yum remove ...
lospejos's user avatar
  • 906
57 votes
Accepted

Permanently enable a SCL

using scl enable actually opens a new shell inside your current one, which is quite unclean, especially if done from a login script. You should place, instead, in your ~/.bash_profile: source /opt/...
l3g3nd4ryf0x's user avatar
48 votes
Accepted

How to remove access to a port using firewall on Centos7?

Solution: Do not forget the --runtime-to-permanent $ firewall-cmd --zone=public --remove-port=10050/tcp $ firewall-cmd --runtime-to-permanent $ firewall-cmd --reload
mcv's user avatar
  • 955
44 votes

Centos 7 Extend partition with unallocated space

You can do this without rebooting in CentOS 7. Assuming your disk is /dev/vda and standard RHEL/CentOS partitioning: Extend partition # fdisk /dev/vda Enter p to print your initial partition table....
Aner's user avatar
  • 601
41 votes
Accepted

Low-end hardware RAID vs Software RAID

A 10-20$ "hardware" RAID card is nothing more than a opaque, binary driver blob running a crap software-only RAID implementation. Stay well away from it. A 200$ RAID card offer proper hardware ...
shodanshok's user avatar
  • 50.7k
40 votes
Accepted

Could not resolve host: mirrorlist.centos.org Centos 7

Could not resolve host: mirrorlist.centos.org; Unknown error This indicates that you either (a) don't have a properly configured DNS server or (b) your network configuration isn't correct and you can'...
Andrew's user avatar
  • 2,172
37 votes

Systemd Environment and EnvironmentFile not working

Environment and EnvironmentFile set the variables, usable by the unit, but like the sh command, does not export it to child processes. For that, you also need to list it in PassEnvironment, just as ...
Cameron Kerr's user avatar
  • 4,109
36 votes

How can I run a shell as a user that has no shell access?

Just run a shell under the user. sudo -u www bash
Gerald Schneider's user avatar
34 votes
Accepted

Centos 7 Extend partition with unallocated space

There are three steps to make: alter your partition table so sda2 ends at end of disk reread the partition table (will require a reboot) resize your LVM pv using pvresize Step 1 - Partition table ...
Andreas Rogge's user avatar
29 votes
Accepted

Proper way to deal with corrupt XFS filesystems

If you're attempting to run xfs_repair, getting the error message that suggests mounting the filesystem to replay the log, and after mounting still receiving the same error message, you may need to ...
brendonofficial's user avatar
29 votes
Accepted

long delay when logging in with CentOS7

In your /etc/ssh/sshd_config on the remote server you should change the option GSSAPIAuthentication to no. Restart sshd and you should be good to go. edit: GSSAPI (Generic Security Service ...
Brett Levene's user avatar
29 votes

How can I add a default gateway with the ip command, not the route command?

Try ip route add default via <host> dev <dev>, e.g.: ip route add default via 192.0.2.2 dev eth0 Or you can replace the existing default route: ip route replace default via 192.0.2.1 ...
user9517's user avatar
  • 116k
27 votes
Accepted

CentOS 7 - end of life in 2024, then what

If RHEL binary compatibility is not strictly required and if using in-tree kernel modules only (i.e.: no out-of-tree kmods are required), CentOS Stream should remain a viable option. Otherwise you can ...
shodanshok's user avatar
  • 50.7k
26 votes

Permanently enable a SCL

Redhat proposes placing a file in /etc/profile.d, i.e. for python: $ cat /etc/profile.d/enablepython33.sh #!/bin/bash source scl_source enable python33 As this works for the devtools under centos ...
ted's user avatar
  • 363
23 votes

php-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream

If I could downvote the answer from @Artsiom forever, I would. pm.max_children = 4000 means up to 4K worker processes. If traffic flows in very fast and together with pm.max_requests = 0, the workers ...
Danila Vershinin's user avatar
23 votes
Accepted

I updated my CentOS 7 system. Why is Meltdown/Spectre only partially mitigated?

As noted in https://access.redhat.com/articles/3311301 CVE-2017-5715 (variant #2/Spectre) is an indirect branching poisoning attack that can lead to data leakage. This attack allows for a ...
user9517's user avatar
  • 116k
21 votes

Accidentally deleted python and yum is not working in centos7

You can simply download the packages and install them again with rpm , without having python on your system and a broken yum. Find the version you had installed rpm -qf /usr/bin/python Then find a ...
HBruijn's user avatar
  • 80.3k
20 votes

systemd : how to get the running target

In systemd, there may be more than one active target at a time. To inspect the list of all currently active targets: systemctl list-units --type target --state active To quickly find out whether a ...
Amir's user avatar
  • 883
20 votes
Accepted

Authentication is required to manage system services or units.

Your system is using the polkit Authorization Manager and the message is from the file /usr/share/polkit-1/actions/org.freedesktop.systemd1.policy. polkit can be configured in /etc/polkit-1 and /usr/...
Johan Myréen's user avatar
20 votes

safely upgrade glibc on CentOS 7

Check it is actually needed Firstly check the python application as it could be out of date and is probably misreading the glibc version. CentOS shows the base version as installed and is patched to ...
Simon Greenwood's user avatar
20 votes
Accepted

Postfix error, SASL authentication failed; cannot authenticate to server, no mechanism available

In case you couldn't solve this error yet, my setup is 99% similar to yours except it uses Ubuntu, and I had all configured as per it but just pointing to GMAIL SMTP endpoint. Do take a look at this ...
Marcos Soutullo's user avatar
20 votes

Disadvantages of running an AWS worker server at 100% CPU

So long as the system is doing what you need and is responsive to logins and changes, running 100% CPU is no problem, that's what it's for. Nice only changes the relative priority of processes. In AWS ...
Tim's user avatar
  • 32.8k
19 votes

Install a newer version of Git on CentOS 7

I have this approach for CentOS 7.2: rpm -U http://opensource.wandisco.com/centos/7/git/x86_64/wandisco-git-release-7-2.noarch.rpm \ && yum install -y git At the moment I have 2.10.0 GIT ...
Kirby's user avatar
  • 1,069
19 votes

Centos 7 Extend partition with unallocated space

Check this out — everything on a single line, no questions: parted ---pretend-input-tty /dev/vda resizepart 2 100%; partx -u /dev/vda; pvresize /dev/vda2; lvextend -r centos/var /dev/vda2 Here: ...
Hix's user avatar
  • 191
19 votes
Accepted

selinux is preventing from execute access on the file centos

The SELinux restricts binaries that can be used in ExecStart to paths that has system_u:object_r:bin_t:s0 attribute set. Typically those are /usr/bin /usr/sbin /usr/libexec /usr/local/bin directories. ...
kofemann's user avatar
  • 4,886
18 votes

Force chrony time check

If chronyd isn't already running, a command similar to 'ntpdate pool.ntp.org' could be (since version 1.30): chronyd -q 'server pool.ntp.org iburst' If it's already running and it has some servers ...
Arlion's user avatar
  • 628
18 votes

Cannot conect MySQL (error 2026) after upgrade to Ubuntu 20.04

As a temporary solution you could disable ssl from the command line $ mysql -h <myserver> -u <myuser> -p --ssl-mode=DISABLED password: or by creating a my.cnf file $ cat /etc/my.cnf [...
Mohammed Lubbad's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible