Bird
0
0

You executed nohup myscript.sh & but the script terminates after logout. What is the most probable cause?

medium📝 Debug Q6 of 15
Linux CLI - Process Management
You executed nohup myscript.sh & but the script terminates after logout. What is the most probable cause?
AYou did not redirect output, causing failure
BYou forgot to make the script executable
CThe shell does not support nohup
DThe script requires an active terminal session
Step-by-Step Solution
Solution:
  1. Step 1: Check nohup behavior

    nohup prevents hangup signals but cannot keep processes alive if they depend on terminal input.
  2. Step 2: Script requiring terminal

    If myscript.sh needs terminal interaction, it will stop after logout despite nohup.
  3. Final Answer:

    The script requires an active terminal session -> Option D
  4. Quick Check:

    Does script need terminal input? If yes, nohup won't help [OK]
Quick Trick: Scripts needing terminal input stop despite nohup [OK]
Common Mistakes:
  • Assuming nohup fixes all logout issues
  • Ignoring script permissions
  • Believing output redirection affects process survival

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes