You have to schedule a maintenance reboot of a host but want running services to stop cleanly in the right order. How?
BeginnerScenarioProcesses, services and systemd
Answer
Situation read → Use systemd shutdown, not a hard reset.
What I'd do →
sudo shutdown -r 02:00 "Kernel patching"
# check / cancel
shutdown --show 2>/dev/null; sudo shutdown -c
Drain the host from load balancers first, and make sure units have correct After= ordering, since systemd stops units in reverse start order.
Why → A clean shutdown runs ExecStop and lets databases flush.
Interview tip → Mention draining traffic before rebooting; that's what separates ops from just commands.
More on Processes, services and systemd
Your team has a Python API that someone starts with `nohup python app.py &`. Make it a proper service running as a non-root user.BeginnerThe service you created must bind to port 443, but it runs as a non-root user. How?BeginnerYou need to change one setting (memory limit) in a vendor-supplied unit file without editing it. How?BeginnerA service depends on a database on the same host and fails at boot because the DB isn't ready. How do you fix the ordering?IntermediateA service keeps crashing and systemd stops restarting it after a few attempts. How do you tune this?IntermediateA long-running app must reload its config without dropping connections. How do you wire this into systemd?Intermediate