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

Red Hat Linux Interview Series 14

 Q.)  How will you reboot a linux server when the “reboot” command or “shutdown” command is not working ?

 

Q.) Explain the command :

 

 

date;ps -ef | tail -n +2 | awk '{print $1}'| sort | uniq | wc -l >> file.log

 

 

 

Q.) SCP file transfer is really slow - what could be the reasons ( assume that network is sufficiently fast ). What alternative will you choose in its place and why ?

 

 

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.

10 Replies
Trevor
Starfighter Starfighter
Starfighter
  • 783 Views

On that first question, is this too simple:   #  systemctl reboot

 

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

That’s not working as well.
Trevor
Starfighter Starfighter
Starfighter
  • 743 Views

Well, here's a little something that I used to demonstrate quite frequently:

                   # init  6

 

Seems like it's been years since I've touched it, but I demonstrated it so much
when I did touch it, I could never forget it.   Anyway, l await your verdict

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

@Trevor init 6, reboot, and systemctl reboot should all behave the same as init and reboot are symbolic links to systemd/systemctl. This means all three commands are calling systemd/systemctl on rhel7+ systems. Now, if the binary is called "init" and it is not the first PID in the system , then for SysV compatibility, it will call telinit and see this :

Chetan_Tiwary__0-1728125877256.png

So, init 6 instructs the system's initialization process to perform a graceful shutdown. It sequentially stops all running processes and daemons according to the order specified in the system's initialization configuration files. Once all processes are terminated, the system is rebooted using the shutdown -r now command.

Hence given the scenario, this is also not working - now the original question has become Thanos and is telling : "You should have gone for the head" LOL!

0 Kudos
Emanuel_Haine
Flight Engineer
Flight Engineer
  • 695 Views

Question #1

What to you mean by "not working", is it hanging, the command execute but there no action?

"systemctl reboot -ff" could be an option?

Chetan_Tiwary_
Community Manager
Community Manager
  • 675 Views

Reboot binary is not working not even with systemctl too ( this is the scenario here )

0 Kudos
tripix1
Cadet
Cadet
  • 659 Views

For rebooting question, this might work?

echo b > /proc/sysrq-trigger
Chetan_Tiwary_
Community Manager
Community Manager
  • 651 Views

Bingo! Magic system request key! 
but it is either not enabled by default or always enabled via a kernel boot parameter "sysrq_always_enabled=1".

You can enable it via /proc/sys/kernel/sysrq though however the above kernel boot parameter overrides  the proc sysrq boolean.

0 Kudos
  • 542 Views

did you try to kill pid 0

Join the discussion
You must log in to join this conversation.