Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
shib-sp/container_files/system/startup.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
27 lines (19 sloc)
1.09 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#for passed-in env vars, remove spaces and replace any ; with : in usertoken env var since we will use ; as a delimiter | |
export USERTOKEN="${USERTOKEN//;/:}" | |
export USERTOKEN="${USERTOKEN// /}" | |
export ENV="${ENV//;/:}" | |
export ENV="${ENV// /}" | |
# generic console logging pipe for anyone | |
mkfifo -m 666 /tmp/logpipe | |
cat <> /tmp/logpipe 1>&2 & | |
mkfifo -m 666 /tmp/logcrond | |
(cat <> /tmp/logcrond | awk -v ENV="$ENV" -v UT="$USERTOKEN" '{printf "crond;console;%s;%s;%s\n", ENV, UT, $0; fflush()}' 1>/tmp/logpipe) & | |
mkfifo -m 666 /tmp/loghttpd | |
(cat <> /tmp/loghttpd | awk -v ENV="$ENV" -v UT="$USERTOKEN" '{printf "httpd;console;%s;%s;%s\n", ENV, UT, $0; fflush()}' 1>/tmp/logpipe) & | |
mkfifo -m 666 /tmp/logsuperd | |
(cat <> /tmp/logsuperd | awk -v ENV="$ENV" -v UT="$USERTOKEN" '{printf "supervisord;console;%s;%s;%s\n", ENV, UT, $0; fflush()}' 1>/tmp/logpipe) & | |
mkfifo -m 666 /tmp/logshibd | |
(cat <> /tmp/logshibd | awk -v ENV="$ENV" -v UT="$USERTOKEN" '{printf "shibd;console;%s;%s;%s\n", ENV, UT, $0; fflush()}' 1>/tmp/logpipe) & | |
#launch supervisord | |
/usr/bin/supervisord -c /etc/supervisor/supervisord.conf | |