rpcbind.socket failed to listen on sockets: Address family not supported by protocol

Registered Authentication Agent for unix-process:7378:6269460 (system bus name :1.2653 [/usr/bin/pkttyagent –notify-fd 5 –fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)

rpcbind.socket failed to listen on sockets: Address family not supported by protocol

Failed to listen on RPCbind Server Activation Socket.

I stumbled upon this error on a CentOS 7.7 freshly installed server today. Funny thing is that i set up 2 servers via ansible and this issue happened only on 1 of them when i was trying to set up the NFS mounts.

Fixing is fairly easy:

sudo systemctl enable rpcbind.socket

sudo systemctl restart rpcbind.socket

sudo systemctl start rpcbind.service

sudo systemctl start rpc-statd.service

After this, mount your NFS share away. Should work just fine

Raspberry pi expand sdcard rootfs

raspi-config –expand-rootfs

If using the official Raspian images released by the Raspberry Pi Foundation, you can use the raspi-config utility to resize the main partition to fill the SD card. Instructions are on the RPi raspi-config page. Read on if you want to know if you should use it.

The raspi-config tool is fully automatic. All you have to do is launch it, select the option expand_rootfs in the raspi-config menu, and reboot the Raspberry Pi. It takes some time for the changes to be made. Once it’s finished, the Pi returns to a command-line or graphical login prompt.

Alternatively, you can just run raspi-config –expand-rootfs to make it a completely non-interactive process.

Windows 10 hosts file – entries commented out

I thought i was going crazy yesterday when some of my Windows 10 entries in C:\Windows\System32\drivers\etc\hosts file were being commented out after a while.

Turns out this happens because Bitdefender Antivirus has an option to keep resetting the hosts file, to prevent session hijacking.

To fix this, go to:

General Settings > Advanced tab > “Scan hosts file” and disable it’s scanning.

ERROR ==> Invalid kernel settings. Elasticsearch requires at least: vm.max_map_count = 262144

ERROR ==> Invalid kernel settings. Elasticsearch requires at least: vm.max_map_count = 262144

If the error above pops in Docker for windows or the Docker Toolbox, (happened to me while installing the bitnami docker image for Magento2) what you have to do is change the docker-machine sysctl settings as follows:

docker-machine ssh
sudo sysctl -w vm.max_map_count=262144

Enjoy!

Resize VirtualBOX drive

Command below would resize to 30GB. Just set the correct path to where your .vdi file is.

Also you have to cd to c:\program files\oracle\virtualbox first or where your Virtualbox installation is, in order to be able to use VBoxManage.exe.

VBoxManage.exe modifyhd F:\VMs\dockerDebian10\dockerDebian10\dockerDebian10.vdi –resize 30000

could not link file “pg_xlog/xlogtemp.20” to “pg_xlog/000000010000000000000001” (initialization of log file): Operation not permitted

I am doing a Docker training session and the container uses PostgreSQL for database needs. On doing docker-compose up, i got the error in the title.

postgres_1 |
postgres_1 | Data page checksums are disabled.
postgres_1 |
postgres_1 | fixing permissions on existing directory /var/lib/postgresql/data … ok
postgres_1 | creating subdirectories … ok
postgres_1 | selecting default max_connections … 100
postgres_1 | selecting default shared_buffers … 128MB
postgres_1 | selecting dynamic shared memory implementation … posix
postgres_1 | creating configuration files … ok
postgres_1 | creating template1 database in /var/lib/postgresql/data/base/1 … LOG: could not link file “pg_xlog/xlogtemp.20” to “pg_xlog/000000010000000000000001” (initialization of log file): Operation not permitted
postgres_1 | FATAL: could not open file “pg_xlog/000000010000000000000001”: No such file or directory
postgres_1 | child process exited with exit code 1

As i use Docker Toolbox, apparently if you create the volume in Windows, there will be permission issues that can’t be fixed.

A relatively easy solution is to create the volume through Docker:

docker volume create psql

then grab the path:

docker volume inspect psql
[
{
“CreatedAt”: “2019-07-09T09:14:01Z”,
“Driver”: “local”,
“Labels”: {},
“Mountpoint”: “/mnt/sda1/var/lib/docker/volumes/psql/_data”,
“Name”: “psql”,
“Options”: {},
“Scope”: “local”
}
]

And then use that path in your docker-compose.yml file:

postgres:
image: postgres:9.4.5
environment:
POSTGRES_USER: mobydock
POSTGRES_PASSWORD: yourpassword
ports:
– ‘5432:5432’
volumes:
– /mnt/sda1/var/lib/docker/volumes/psql/_data:/var/lib/postgresql/data

After this change, everything will work like a charm.

The system received an error from the “MySQL” database “mysql”: ER_PASSWORD_NO_MATCH

The system could not perform “GRANT” statements for the user “username” due to errors: (XID cw2xap) The system received an error from the “MySQL” database “mysql”: ER_PASSWORD_NO_MATCH (Can’t find any matching row in the user table), (XID yhghf3) The system received an error from the “MySQL” database “mysql”: ER_PASSWORD_NO_MATCH (Can’t find any matching row in the user table) at /usr/local/cpanel/Cpanel/DBAdmin.pm

I was upgrading a customer today from SQL 5.5 to MariaDB 10 and when he was trying to add users to a db from cPanel it wasn’t working.

cPanel error logs showed the thing above and apparently this is triggered by having “skip-name-resolve” enabled in my.cnf. Disable it, and run /scripts/restartsrv_mysql

Voila!

yml Quality of life – change nano tabs space

So i recently had to start working with yml files and that stuff needs to use “spaces” as indentation.

In order to stop with Heroes of clickers, i needed to have tab just do 2 spaces on a press instead of the default 8.

To get that done, you have to edit the “nanorc” file, usually in /etc/nanorc and change the variables below to your liking:

## Use this tab size instead of the default; it must be greater than 0.
set tabsize 2

## Convert typed tabs to spaces.
set tabstospaces

Install custom updated Perl

If you need a second perl installation, without messing up the system perl, there’s a fairly easy way:

mkdir /usr/local/perls;cd /usr/local/perls
wget https://www.cpan.org/src/5.0/perl-5.26.1.tar.gz
tar -xzf perl-5.26.1.tar.gz
cd perl-5.26.1
./Configure -des -Dusethreads -Dprefix=/usr/local/perls/perl-5.26.1
make;make test;make install
cd /usr/local/perls/
rm -f /usr/local/perls/perl-5.26.1.tar.gz

Enjoy!

Migrate/clone WHM settings between cPanel/WHM servers

If you want to clone or migrate between cPanel/WHM servers, the cpconftool is available and should make life a little bit easier unless you automated configuring all the options through the cPanel/WHM api.

As far as usage goes, it’s fairly standard: check what modules are tracked

[root@test ~]# /usr/local/cpanel/bin/cpconftool –list-modules
cpanel::easy::apache
cpanel::smtp::exim
cpanel::system::backups
cpanel::system::mysql
cpanel::system::whmconf
cpanel::ui::themes

Backup the modules and then restore them on the target server.

/usr/local/cpanel/bin/cpconftool [–restore=file|–backup|–list-modules|–query-module-info] –modules=MODULE,MODULE,MODULE [–prerestore_backup] [–verbose]
[root@test ~]# /usr/local/cpanel/bin/cpconftool –modules=cpanel::easy::apache,cpanel::smtp::exim,cpanel::system::backups,cpanel::system::mysql,cpanel::system::whmconf,cpanel::ui::themes –backup
Backup Successful
/home/whm-config-backup-cpanel__easy__apache-1.0.0_cpanel__smtp__exim-10.990000_cpanel__system__backups-11.76.0.10_cpanel__system__mysql-11.76.0.10_cpanel__system__whmconf-11.76.0.10_cpanel__ui__themes-1.0.1-1543688144.tar.gz

Restoration goes like this:

/usr/local/cpanel/bin/cpconftool –modules=cpanel::easy::apache,cpanel::smtp::exim,cpanel::system::backups,cpanel::system::mysql,cpanel::system::whmconf,cpanel::ui::themes –restore /home/whm-config-backup-cpanel__easy__apache-1.0.0_cpanel__smtp__exim-10.990000_cpanel__system__backups-11.76.0.10_cpanel__system__mysql-11.76.0.10_cpanel__system__whmconf-11.76.0.10_cpanel__ui__themes-1.0.1-1543688144.tar.gz

If you came to this page and you’re looking for someone to make all your server related problems go away, feel free to drop us a message and we’ll get back to you asap.