File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 1010 bash /opt/docker/bin/provision.sh entrypoint > /dev/null
1111fi
1212
13+ function createNamedPipe() {
14+ rm --force -- " $1 "
15+ mknod " $1 " p
16+ }
17+
18+
1319# ############################
1420# # COMMAND
1521# ############################
@@ -18,6 +24,12 @@ case "$1" in
1824
1925 # # Supervisord (start daemons)
2026 supervisord)
27+
28+ # Create named pipes for direct log output
29+ createNamedPipe /tmp/php.slow.log
30+ createNamedPipe /tmp/php.error.log
31+ createNamedPipe /tmp/php.access.log
32+
2133 # # Register IP
2234 ETH0_IP=$( hostname -i)
2335 mkdir -p /data/dns/
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3+ trap ' echo sigterm ; exit' SIGTERM
4+ trap ' echo sigkill ; exit' SIGKILL
5+
36set -o pipefail # trace ERR through pipes
47set -o errtrace # trace ERR through 'time command' and other functions
58set -o nounset # # set -u : exit the script if you try to use an uninitialised variable
69set -o errexit # # set -e : exit the script if any statement returns a non-true return value
710
8- tail -F --quiet $2 | sed --unbuffered -e " s/^/\[$1 \] /"
11+ LOG_FACILITY=" $1 "
12+ LOG_FILE=" $2 "
13+
14+ # Create pipe
15+ if [ -f " ${LOG_FILE} " ]; then
16+ mknod " ${LOG_FILE} " p
17+ fi
18+
19+ # Output content
20+ while true ; do
21+ sed --unbuffered -e " s/^/\[${LOG_FACILITY} \] /" < " ${LOG_FILE} "
22+ done
You can’t perform that action at this time.
0 commit comments