Home / Blog

VNC service is not working, status of the service shows a Selinux error

This solution applies to CentOS/AlmaLinux, Rocky Linux 7, 8, 9. Getting below error output while seeing the VNC service status of the command. systemd[1]: Starting Remote desktop service (VNC)... systemd[15253]: vncserver@:3.service: Failed to change SELinux context to system_u:system_r:vnc_session_t:s0: Operation not permitted [15253]: vncserver@:3.service: Failed at step SELINUX_CONTEXT spawning /usr/libexec/vncsession-start: Operation not permitted [1]: vncserver@:3.service: Control …

Read more

How to run the gcc preprocessor

In some cases it is required to have source code preprocessed by gcc without undergoing the full compilation process. e.g, this might be necessary when embedded SQL is included in C or C++ programs and the preprocesssed file will be passed on to another tool which will convert the SQL in native source code. To …

Read more

Configure rsync as a daemon

Typically, the rsync tool operates through the secure shell (SSH) protocol when synchronizing files between a client on a local system and a host situated remotely. Nevertheless, there is an alternative to execute it as a daemon if the user prefers not to utilize the ssh protocol. Due to the absence of encryption in the …

Read more

SELinux context is not preserved during rsync

The preservation of SELinux context is not maintained during a rsync operation due to the absence of the xattr feature on the target NFS file system. Running rsync with the options -X does not preserve SELinux context and observes apparent errors such as ** security.selinux failed: Operation not supported. Method 1 - Utilize the tar …

Read more

Why are scripts under /etc/sysconfig/network-scripts directory are gone on AlmaLinux 8/AlmaLinux 9?

Some of the issues faced by system engineers are; Why are files in /etc/sysconfig/network-scripts ignored? Where are interface configs now? I changed a config in an ifcfg-file in directory /etc/sysconfig/network-scripts. Why does the system ignore these changes? A configuration file for each interface should be placed in either the /etc/NetworkManager/system-connections or the /etc/sysconfig/network-scripts directory for …

Read more

How to backup old files before override them in rsync?

How to back up the old files on the target server before rsync replaces them with new ones? Use --backup option in rsync. For instance, # rsync -a --backup --backup-dir="/version2" /var/log/ root@192.168.122.246:/var-log-bk/ This command will copy files from local /var/log to root@192.168.1.100:/var-log-bk/ if rsync overrides some files in 192.168.1.100:/var-log-bk/. It will back up those files …

Read more

How to avoid password prompt input with rsync?

You are given a password input prompt when transferring files to a different server with rsync. $ rsync -avz /data root@srv::files Password: There are two ways to use the RSYNC_PASSWORD environment variable and the --password-file option. Using the environment variable $ export RSYNC_PASSWORD=secret $ rsync -avz /data root@srv::files or $ RSYNC_PASSWORD=secret rsync -avz /data root@srv::files …

Read more

How to avc_cache_threshold persistently in CentOS?

The current runtime is set by the following command. # echo 8192 > /sys/fs/selinux/avc/cache_threshold If you want to keep this change, you can run the two commands below to add them to startup. # echo "echo 8192 > /sys/fs/selinux/avc/cache_thresshold" >> /etc/rc.d/rc.local # chmod +x /etc/rc.d/rc.local   Purchase Dedicated Servers Select, configure, and buy! Click Here

Read more

Why CentOS ignore packets when the route for outbound traffic differs from the route of incoming traffic?

To resolve this issue, set the net.ipv4.conf.all.rp_filter kernel tunable parameter value to 2. sysctl -w net.ipv4.conf.all.rp_filter=2 To make this change persistent across reboots, add the tunable to the /etc/sysctl.conf file. Strict filtering means that when a packet comes into the system, the kernel looks up the source IP in its routing table to see if …

Read more

How to view the progress of an rsync job?

If you are running an rsync job that is backing up large amounts of data, you may want to make sure everything is proceeding normally by being able to view the progress of the rsync job. You need to add the progress option using either method. (--progress or -P) ~]# rsync -a --progress /tmp/ backup/ …

Read more