File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,6 +76,10 @@ redhat init.d or upstart depending on the service provider.
7676 The location of the uwsgi config file.
7777 Default: '/etc/uwsgi.ini'
7878
79+ * ` log_dir `
80+ The location of the uwsgi emperor log.
81+ Default: '/var/log/uwsgi/uwsgi-emperor.log'
82+
7983* ` app_directory `
8084 Vassal directory for application config files.
8185
Original file line number Diff line number Diff line change 4949# [*config_file*]
5050# The location of the uwsgi config file. Default: '/etc/uwsgi.ini'
5151#
52+ # [*log_file*]
53+ # The location of the uwsgi emperor log.
54+ # Default: '/var/log/uwsgi/uwsgi-emperor.log'
55+ #
5256# [*app_directory*]
5357# Vassal directory for application config files
5458#
8892 $service_provider = $uwsgi::params::service_provider,
8993 $manage_service_file = $uwsgi::params::manage_service_file,
9094 $config_file = $uwsgi::params::config_file,
95+ $log_file = $uwsgi::params::log_file,
9196 $app_directory = $uwsgi::params::app_directory,
9297 $install_pip = $uwsgi::params::install_pip,
9398 $install_python_dev = $uwsgi::params::install_python_dev,
Original file line number Diff line number Diff line change 1717 $config_file = ' /etc/uwsgi.ini'
1818 $install_pip = true
1919 $install_python_dev = true
20+ $log_file = ' /var/log/uwsgi/uwsgi-emperor.log'
2021 $python_pip = ' python-pip'
2122
2223 case $::osfamily {
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ emperor-tyrant = true
1111master = true
1212autoload = true
1313log-date = true
14- logto = /var/log/uwsgi/uwsgi-emperor.log
14+ logto = <%= @log_file %>
1515<%
1616if @emperor_options
1717 @emperor_options.sort.each do |key, value|
Original file line number Diff line number Diff line change 1818# Source function library.
1919. /etc/rc.d/init.d/functions
2020
21- OPTIONS= " --daemonize --die-on-term --ini <%= @config_file %>"
21+ UWSGILOG= " <%= @log_file %>"
2222UWSGIPID=" <%= @pidfile %>"
2323UWSGISOCKET=" <%= @socket %>"
2424
25+ OPTIONS=" --daemonize " ${UWSGILOG} " --die-on-term --ini <%= @config_file %>"
26+
27+ UWSGILOGDIR=" ${UWSGILOG%/* } "
2528UWSGIPIDDIR=" ${UWSGIPID%/* } "
2629UWSGISOCKETDIR=" ${UWSGISOCKET%/* } "
2730
2831[ -f /etc/sysconfig/uwsgi ] && . /etc/sysconfig/uwsgi
2932
33+ if [ ! -d " ${UWSGILOGDIR} " ]; then
34+ mkdir -p " ${UWSGILOGDIR} "
35+ [ -n " ${RUNAS} " ] && chown " ${RUNAS} :" " ${UWSGILOGDIR} "
36+ fi
37+
3038if [ ! -d " ${UWSGIPIDDIR} " ]; then
3139 mkdir -p " ${UWSGIPIDDIR} "
3240 [ -n " ${RUNAS} " ] && chown " ${RUNAS} :" " ${UWSGIPIDDIR} "
Original file line number Diff line number Diff line change @@ -10,12 +10,14 @@ stop on runlevel [!2345]
1010respawn
1111
1212pre-start script
13+ uwsgilog="<%= @log_file %> "
1314 uwsgipid="<%= @pidfile %> "
1415 uwsgisocket="<%= @socket %> "
16+ uwsgilogddir="${uwsgilogd%/*}"
1517 uwsgipiddir="${uwsgipid%/*}"
1618 uwsgisocketdir="${uwsgisocket%/*}"
1719 mkdir -p "$uwsgipiddir"
1820 mkdir -p "$uwsgisocketdir"
19- mkdir -p /var/log/uwsgi
21+ mkdir -p "$uwsgilogdir"
2022end script
2123exec uwsgi --die-on-term --ini <%= @config_file %>
You can’t perform that action at this time.
0 commit comments