DHCP Client Error mv cannot move - Fix this error now

This article covers how to fix DHCP Client Error: mv cannot move. This DHCP error indicate that dhclient (Dynamic Host Configuration Protocol Client) is not able to update your name resolution configuration file /etc/resolv.conf. 


To fix this DHCP error:

1. Run dhclient as root user

Use sudo command to run dhclient, enter:

$ sudo dhclient eth0

2. Make sure /etc/resolv.conf is not write protected

Use lsattr, command to view file attributes:

$ lsattr /etc/resolv.conf

Clear i attribute, enter:

$ sudo chattr -i /etc/resolv.conf

3. Now run dhclient again to update file and to obtained new IP address.

Read More




dhclient to persistently look for an IP address lease - Configure it Now

This article covers how to use dhclient command. Basically, Linux dhclient command can provide an IP lease until DHCP Server/Router grants one.

With this guide, you can easily configure Linux dhclient command to continuously requests an IP lease until one is granted by DHCP Server / Router.

Read More




restorecond Will not restore a file with more than one hard link - How to resolve this issue

This article covers Tips to fix 'restorecond: Will not restore a file with more than one hard link' error.

To fix this problem type the following commands:

# rm /etc/sysconfig/networking/profiles/default/resolv.conf

# restorecon /etc/resolv.conf

# ln /etc/resolv.conf /etc/sysconfig/networking/profiles/default/resolv.conf

Read More




Files and Processes in SELinux on CentOS 7 - More information

This article covers Files and Processes in SELinux. Basically, managing file and process context are at the heart of a successful SELinux implementation.

With SELinux, a process or application will have only the rights it needs to function and NOTHING more. The SELinux policy for the application will determine what types of files it needs access to and what processes it can transition to. 

SELinux policies are written by app developers and shipped with the Linux distribution that supports it. A policy is basically a set of rules that maps processes and users to their rights.


SELinux enforces something we can term as “context inheritance”. What this means is that unless specified by the policy, processes and files are created with the contexts of their parents.

So if we have a process called “proc_a” spawning another process called “proc_b”, the spawned process will run in the same domain as “proc_a” unless specified otherwise by the SELinux policy.


SELinux in Action: Testing a File Context Error

1. First, let's create a directory named www under the root. We will also create a folder called html under www:

mkdir -p /www/html

 

2. If we run the ls -Z command, we will see these directories have been created with the default_t context:

ls -Z /www/

drwxr-xr-x. root root unconfined_u:object_r:default_t:s0 html


3. Next we copy the contents of the /var/www/html directory to /www/html:

cp /var/www/html/index.html /www/html/

 

The copied file will have a context of default_t. That's the context of the parent directory.


We now edit the httpd.conf file to point to this new directory as the web site's root folder. 

i. We will also have to relax the access rights for this directory.

vi /etc/httpd/conf/httpd.conf

ii. First we comment out the existing location for document root and add a new DocumentRoot directive to /www/html:

# DocumentRoot "/var/www/html"

DocumentRoot "/www/html"

iii. We also comment out the access rights section for the existing document root and add a new section:

#<Directory "/var/www">

#    AllowOverride None

    # Allow open access:

#    Require all granted

#</Directory>


<Directory "/www">

    AllowOverride None

    # Allow open access:

    Require all granted

</Directory>


We leave the location of the cgi-bin directory as it is. We are not getting into detailed Apache configuration here; we just want our site to work for SELinux purposes.


iv. Finally, restart the httpd daemon:

service httpd restart

 

Once the server has been restarted, accessing the web page will give us the same “403 Forbidden” error (or default “Testing 123” page) we saw before.

The error is happening because the index.html file's context changed during the copy operation. It needs to be changed back to its original context (httpd_sys_content_t).

Read More




isc-dhcp-server Job failed to start - Resolve it now

This article covers method to resolve DHCP 'isc-dhcp-server: Job failed to start' error. Basically, 'isc-dhcp-server: Job failed to start' error can happen if there is any issues with the commands that we run.


You can try to restart the service; if it really is an issue with the service starting before the network is up restarting it once the network is up should work:

$ sudo systemctl start restart isc-dhcp-server.service


If that doesn't work then try and investigate further why it's not starting by first getting the current status of the service:

$ sudo systemctl status isc-dhcp-server.service


That should also give you a PID for which you can further investigate with journaltctl where XXXX is the PID of the service:

$ journalctl _PID=XXXXX


Also, what caused/led you to do the following? Perhaps try undoing those changes as I'm not sure if that's helping or hurting. Was the /etc/init/isc-dhcp-server.conf file already there or did you manually create it?

So add a "Sleep 30" to the /etc/init/isc-dhcp-server.conf file. Also add " up service dhcp3-server restart " to my  /etc/network/interfaces file. 

Read More




ERROR: PleskDBException: Unable to connect to database - Fix it now

This article covers methods to resolve error: pleskdbexception: unable to connect to database which triggers as a result of various reasons that include InnoDB engine corruption, disk space full, data directory not completely restored or recovered, and so on. 

The reason of this error is due to disk full and you need to delete extra file from my linux Server.

fslint is a Linux utility to remove unwanted and problematic cruft in files and file names and thus keeps the computer clean. A large volume of unnecessary and unwanted files are called lint. fslint remove such unwanted lint from files and file names.


To Clear RAM Memory Cache, Buffer and Swap Space on Linux:

1. Clear PageCache only. # sync; echo 1 > /proc/sys/vm/drop_caches.

2. Clear dentries and inodes. # sync; echo 2 > /proc/sys/vm/drop_caches.

3. Clear PageCache, dentries and inodes. # sync; echo 3 > /proc/sys/vm/drop_caches.

4. Sync will flush the file system buffer. Command Separated by “;” run sequentially.


To find largest files including directories in Linux is as follows:

1. Open the terminal application.

2. Login as root user using the sudo -i command.

3. Type du -a /dir/ | sort -n -r | head -n 20.

4. du will estimate file space usage.

5. sort will sort out the output of du command.


To uninstall an RPM package:

1. Execute the following command to discover the name of the installed package: rpm -qa | grep Micro_Focus. This returns PackageName , the RPM name of your Micro Focus product which is used to identify the install package.

2. Execute the following command to uninstall the product: rpm -e [ PackageName ]

Read More





Focus on your business, not your servers.

Click Here to Learn More




Recent Post