$SIG{HUP} = \&reload; $SIG{TERM} = \&terminate; sub reload { # do whatever needs doing to restart } sub terminate { # terminate database connection, etc... }