Exercise 2: Advising a Colleague Without reptyr or sudo — Possible Solution ============================================================================= Advice: 1. Press Ctrl-Z, then run bg, then disown %1 (Chapter 7). Don't disown before bg — a stopped pg_dump would never finish. 2. Before leaving, note the PID (jobs -l, before disowning) so they can check on it later with: pgrep -af pg_dump 3. Log out normally. What they'd lose: - Any way to see or interact with the job's terminal again. They can only check that the process still exists and that its output file is growing (for example with ls -l on the dump file). - Possibly the job itself, in two situations: * If pg_dump is writing to the terminal (for example its output wasn't redirected to a file, or it prints progress messages), those writes will fail once the terminal has gone, and it may stop. If it was started with -f file or > file, this is much less of a risk. * If the system has KillUserProcesses=yes (Chapter 7), logout kills it regardless. Alternative: if the dump has only just started, stopping it and restarting it inside screen may be the safer choice. For next time: start long jobs inside screen, and redirect output to a file. WHY THIS WORKS AS AN ANSWER ------------------------------ It gives a workable plan with only built-in tools, is honest about the real risks, and says how to check on the job afterwards instead of just hoping it worked.