Skip to content

Commit e80c1e1

Browse files
authored
Docker: Ensure that cmd.sh terminates its child processes when the parent script closes photoprism#5172
* Scripts: Ensure that child processes are terminated when parent script closes * Scripts: Exclude pgrep process id from kill
1 parent c7e71bb commit e80c1e1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

scripts/dist/cmd.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/usr/bin/env bash
22

3+
# clean up child processes via trap
4+
trap 'ps -p $$ -o pgid= | xargs pgrep -A -g | xargs kill ;exit' EXIT
5+
36
# regular expressions
47
re='^[0-9]+$'
58

0 commit comments

Comments
 (0)