Ask Your Question
0

shutdown and SIGTERM question

asked 2017-10-25 11:11:04 -0600

toddandmargo gravatar image

updated 2017-10-25 11:12:30 -0600

Hi All,

Am I correct that when your shutdown/poweroff/reboot, that the OS sends a blanket SIGTERM to all running programs?

And, this does not necessarily apply to programs running in the background that were started by systemd?

Many thanks, -T

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-10-26 18:31:14 -0600

Zan Lynx gravatar image

systemd runs the "stop" action on each unit as it shuts down. This is usually sending it SIGTERM and waiting for it to exit. It can be customized for each unit. If a unit does not shut down it waits for a timeout and then does SIGKILL which stops the process no matter what.

edit flag offensive delete link more

Comments

Thank you!

In the situation I am facing, a database is not shutdown by the systemd script that started it at boot. There is no "ExecStop" exec line. (NO, IT WAS NOT MY DOING !!! There is politics involved.) Does the general shutdown take care of this issue as you described? I am thinking there is a possibility of data corruptions.

toddandmargo gravatar imagetoddandmargo ( 2017-10-27 14:29:26 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-10-25 11:11:04 -0600

Seen: 84 times

Last updated: Oct 26 '17