mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2025-06-28 05:25:11 +00:00
Modify resources' directory structure
This commit is contained in:
6
supervisor/components/tfw_init.conf
Normal file
6
supervisor/components/tfw_init.conf
Normal file
@ -0,0 +1,6 @@
|
||||
[program:tfw_init]
|
||||
user=root
|
||||
directory=/tmp
|
||||
command=bash tfw_init.sh
|
||||
autorestart=false
|
||||
startsecs=0
|
13
supervisor/tfw_init.sh
Normal file
13
supervisor/tfw_init.sh
Normal file
@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
echo "export HISTFILE=\"${TFW_HISTFILE}\"" >> /tmp/bashrc &&
|
||||
cat /tmp/bashrc >> "/home/${AVATAO_USER}/.bashrc"
|
||||
|
||||
if [[ -z "${HOTRELOAD}" ]]; then
|
||||
for dir in "${TFW_LIB_DIR}/tfw" "/etc/nginx" "/etc/supervisor"; do
|
||||
chown -R root:root "${dir}" && chmod -R 700 "${dir}";
|
||||
done
|
||||
fi
|
||||
|
||||
rm -f bashrc requirements.txt tfw_init.sh
|
@ -1,17 +1,10 @@
|
||||
from sys import stderr
|
||||
|
||||
from tornado.ioloop import IOLoop
|
||||
|
||||
from tfw.main import TFWServer, setup_signal_handlers
|
||||
from tfw.config import TFWENV
|
||||
from tfw.logging import Log, Logger, LogFormatter, VerboseLogFormatter
|
||||
from tfw.main import TFWServer, setup_logger, setup_signal_handlers
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
Logger([
|
||||
Log(stderr, LogFormatter(20)),
|
||||
Log(TFWENV.LOGFILE, VerboseLogFormatter())
|
||||
]).start()
|
||||
setup_logger(__file__)
|
||||
TFWServer().listen()
|
||||
|
||||
setup_signal_handlers()
|
||||
|
Reference in New Issue
Block a user