Weekend Assignment #16

Assignment Date:

January 20, 2023

 

Objective:

Configure server to send HUP signal to applications when logging off.

 

Overview:

When you SSH to a Linux server, BASH no longer (in most distros) sends a HUP signal when you disconnect. That means processes usually stay running if you started them during your session. Using the shopt command, however, you can configure BASH to send processes a HUP signal when you log out. Your assignment is to configure your server so that it sends HUP signals to processes when you log off.

Since the sleep program exits when it receives a HUP signal, it's the perfect process to use for testing. Basically, log into a server, type sleep 1000 &, and then log out. If you log back in and do ps aux | grep sleep, you'll probably see the process still running. Using the shopt command, configure your server so that when you log out, it sends HUP to the sleep command so that it terminates when you log out.

 

Notes:

The video on Kill Signals will be helpful for this assignment.

 

Due Date:

January 22, 2023 – 3PM EST (we'll cover the solution during the livestream)

 

Solution:

(I will try to clip out the section of the livestream which contains the solution, and put a link to that video here)