Skip to content

Instantly share code, notes, and snippets.

@polonskiy
Created February 12, 2015 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save polonskiy/2c72dc9e02804912777c to your computer and use it in GitHub Desktop.
Save polonskiy/2c72dc9e02804912777c to your computer and use it in GitHub Desktop.
forward signals
#!/bin/bash
#enable job control
set -m
#propagate INT/TERM signals
trap 'kill -TERM $(jobs -p); wait' TERM
trap 'kill -INT $(jobs -p); wait' INT
#services
rsyslogd -n &
cron -f &
#wait for all children
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment