cancel
Showing results for 
Search instead for 
Did you mean: 
Chetan_Tiwary_
Community Manager
Community Manager
  • 225 Views

Red Hat Linux Interview Series 12

Q.) How can we configure and  ensure that a specific process or service starts after all other service scripts and systemd init tasks have  been completed ?

 

Q.) I am using nfs shares for my kickstart configuration:

inst.repo=nfs:nfsvers=4:10.16.192.151:/var/www/html/rhel8 inst.ks=http://10.16.192.151/var/www/html/rhel8/rhel8.cfg inst.sshd

but getting this error later :

dracut-initqueue[1021]: anaconda: found /run/install/repo//images/install.img
kernel: loop: module loaded
dracut-initqueue[1021]: anaconda: kickstart locations are: nfs:nfsvers=4:10.16.192.151:/rhel8/rhel8.cfg
dracut-initqueue[1021]: anaconda: fetching kickstart from nfs:nfsvers=4:10.16.192.151:/rhel8/rhel8.cfg
dracut-initqueue[1021]: cp: cannot stat '/run/install/repo/isolinux/rhel8/rhel8.cfg': No such file or directory
dracut-initqueue[1021]: Warning: anaconda: failed to fetch kickstart from nfs:nfsvers=4:10.16.192.151:/rhel8/rhel8.cfg

How will you address this issue ?

 

Q.) yum update fails with the following error : What would you do to resolve this :

[root@rhel9 ~]# yum update
rpmdb: PANIC: fatal region error detected; run recovery
error: db3 error(-30974) from dbenv->open: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 -  (-30974)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:

 

 

Level - L2 and above.

 

I'll be posting a series of Linux-related questions covering various skill levels. Feel free to share your insights and expertise. Your contributions will benefit learners at all stages, from those in current roles to those preparing for Linux interviews.

3 Replies
Trevor
Starfighter Starfighter
Starfighter
  • 170 Views

 

Question 3:  "yum update fails with the following error : What would you do to resolve this?"

My research shows that ths is because the rpm database is corrupt on the local system. To resolve the issue, the repo on the system will require cleaning and rebuilding.  Perform the following commands to achieve this:

# yum clean all

# rm -f /var/lib/rpm/__db*

The above commands will remove rpm database packages, and clean the yum cache. Removing the rpm database packages won’t affect the current rpm’s installed.

 

Now, rebuild the rpm database with command below:

       #  rpm –rebuilddb

 

Now, update the rpm database with the command below, and life should be good - at least as far as this issue is concerned!

       #  yum update –y

 

Trevor "Red Hat Evangelist" Chandler
Chetan_Tiwary_
Community Manager
Community Manager
  • 107 Views

@Trevor You are on a ROLL!  

Trevor
Starfighter Starfighter
Starfighter
  • 14 Views

No one has weighed in on that first question, so I guess I'll stick my toe in the water:

Q1:  How can we configure and  ensure that a specific process or service starts after all other service scripts and systemd init tasks have  been completed ?

 

Here's my approach:

Step 1:   Create a service unit file for that process or service, in the 
                  /etc/systemd/system directory

Step 2:   Enable that new service

Step 3:   Reload the systemd daemon

 

Here's an example, with a little bit more detail of the steps I mentioned above.  
For my example, I will assume that the process that will be launched after
everything else has started, will be based on a shell script named "tlc.sh", that
resides in the /tmp/ directory.   Also, I will assume that the name of my service
unit file is "lastone.service".

 

Step 1:  The content of the service unit file - could contain more, but this is the bare
                minimum.

[ Unit ]
After=default.target

[Service]
Type=simple
ExecStart=/usr/bin/bash  /tmp/tlc.sh

Step 2:    #  systemctl  enable   lastone.service

Step 3:    #  systemctl  daemon-reload

 

This is one approach to ensuring that a specific process or service will start  after
all other service scripts and systemd init tasks have  been completed.

Trevor "Red Hat Evangelist" Chandler
0 Kudos
Join the discussion
You must log in to join this conversation.