Interview Prep/Linux/Processes, services and systemd

A legacy app has no systemd unit and must survive SSH logout while you build one. What quick options do you have?

BeginnerScenarioProcesses, services and systemd
Answer

Situation read → Detach the process from the terminal for now.

What I'd do →

  1. tmux new -s legacy then run it; detach with Ctrl+b d.
  2. Or a transient systemd unit, which is better:
sudo systemd-run --unit=legacy-app --uid=appuser /opt/legacy/run.sh
journalctl -u legacy-app -f
  1. nohup ./run.sh > out.log 2>&1 & as a last resort.

Why → systemd-run gives logging and control (systemctl stop legacy-app) without writing a file.

Interview tip → Mention SIGHUP: closing the terminal sends it, which is why plain & processes die.

All Linux questions Roadmap: Linux

More on Processes, services and systemd