Hello,

TL;DR: Fresh install of ReviewBoard 2.5.2 with uWSGI+NGINX on Debian 8.2.
If I run uWSGI from command line - everything works fine, but if uWSGI 
started from rc.local - 
after reboot I saw only "Data directory changes" message.
Few similar issues where related to SELinux usage - there is no one in my 
system.


System: Debian 8.2 
~# uname -a
Linux reviewboard 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u1 
(2015-12-14) x86_64 GNU/Linux

~# python --version
Python 2.7.9

~# rb-site --version
rb-site 2.5.2

~# /usr/local/bin/uwsgi --version
2.0.11.2
(installed system-wide)

~# ls -l /etc/uwsgi/vassals
total 4
-rw-r--r-- 1 root root 940 Dec 30 00:18 reviewboard_uwsgi.ini

Content of reviewboard_uwsgi.ini (borrowed from Internets):
==================================================
~# cat  /etc/uwsgi/vassals/reviewboard_uwsgi.ini
[uwsgi]

# Django-related settings
# the base directory (full path)
chdir           = /var/www/reviewboard/htdocs
pythonpath      = ..
env=DJANGO_SETTINGS_MODULE=reviewboard.settings
pymodule-alias=settings_local=/var/www/reviewboard/conf/settings_local.py
module = django.core.handlers.wsgi:WSGIHandler()

# process-related settings
# master
master          = true
# maximum number of worker processes
processes       = 10
# the socket (use the full path to be safe
socket          = /tmp/reviewboard.sock
# ... with appropriate permissions - may be needed
chmod-socket    = 664
chown-socket    = nginx:nginx

# clear environment on exit
vacuum          = true

static-safe=/usr/local/lib/python2.7/dist-packages/
daemonize = /var/log/uwsgi/reviewboard.log
==================================================


Content of reviewboard.wsgi (didn't change anything):
==================================================
~# cat /var/www/reviewboard/htdocs/reviewboard.wsgi
import __main__
__main__.__requires__ = ['ReviewBoard']
import pkg_resources

import os
import sys

os.environ['DJANGO_SETTINGS_MODULE'] = "reviewboard.settings"
os.environ['PYTHON_EGG_CACHE'] = "/var/www/reviewboard/tmp/egg_cache"
os.environ['HOME'] = "/var/www/reviewboard/data"
os.environ['PYTHONPATH'] = '/var/www/reviewboard/conf:' + 
os.environ.get('PYTHONPATH', '')

sys.path = ['/var/www/reviewboard/conf'] + sys.path

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
==================================================

My rc.local:
==================================================
~# cat  /etc/rc.local
#!/bin/sh -e

set -x; exec >/var/log/rc.local.log 2>&1

/usr/local/bin/uwsgi --emperor /etc/uwsgi/vassals --daemonize 
/var/log/uwsgi-emperor.log

exit 0
==================================================

After reboot there is a content of /var/log/uwsgi-emperor.log:
==================================================
~# cat  /var/log/uwsgi-emperor.log
*** Starting uWSGI 2.0.11.2 (64bit) on [Wed Dec 30 15:09:16 2015] ***
compiled with version: 4.9.2 on 27 December 2015 01:55:41
os: Linux-3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u1 (2015-12-14)
nodename: reviewboard
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 1
current working directory: /
detected binary path: /usr/local/bin/uwsgi
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 3909
your memory page size is 4096 bytes
detected max file descriptor number: 1024
*** starting uWSGI Emperor ***
*** has_emperor mode detected (fd: 6) ***
[uWSGI] getting INI configuration from reviewboard_uwsgi.ini
Wed Dec 30 15:09:17 2015 - [emperor] vassal reviewboard_uwsgi.ini has been 
spawned
Wed Dec 30 15:09:17 2015 - [emperor] vassal reviewboard_uwsgi.ini is ready 
to accept requests
==================================================

After reboot there is a content of /var/log/uwsgi/reviewboard.log:

==================================================
*** Starting uWSGI 2.0.11.2 (64bit) on [Wed Dec 30 00:18:56 2015] ***
compiled with version: 4.9.2 on 27 December 2015 01:55:41
os: Linux-3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u1 (2015-12-14)
nodename: reviewboard
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 1
current working directory: /etc/uwsgi/vassals
detected binary path: /usr/local/bin/uwsgi
chdir() to /var/www/reviewboard/htdocs
your processes number limit is 3909
your memory page size is 4096 bytes
detected max file descriptor number: 1024
building mime-types dictionary from file /etc/mime.types...547 entry found
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 inherited UNIX address /tmp/reviewboard.sock fd 3
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
Python version: 2.7.9 (default, Mar  1 2015, 13:01:26)  [GCC 4.9.2]
*** Python threads support is disabled. You can enable it with 
--enable-threads ***
Python main interpreter initialized at 0x1d99b40
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 800360 bytes (781 KB) for 10 cores
*** Operational MODE: preforking ***
added ../ to pythonpath.
mapped virtual pymodule "settings_local" to real pymodule 
"/var/www/reviewboard/conf/settings_local.py"
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x1d99b40 pid: 
457 (default app)
*** uWSGI is running in multiple interpreter mode ***
gracefully (RE)spawned uWSGI master process (pid: 457)
spawned uWSGI worker 1 (pid: 1025, cores: 1)
spawned uWSGI worker 2 (pid: 1026, cores: 1)
spawned uWSGI worker 3 (pid: 1027, cores: 1)
spawned uWSGI worker 4 (pid: 1028, cores: 1)
spawned uWSGI worker 5 (pid: 1029, cores: 1)
spawned uWSGI worker 6 (pid: 1030, cores: 1)
spawned uWSGI worker 7 (pid: 1031, cores: 1)
spawned uWSGI worker 8 (pid: 1032, cores: 1)
spawned uWSGI worker 9 (pid: 1033, cores: 1)
spawned uWSGI worker 10 (pid: 1034, cores: 1)
==================================================

Owner of the whole /var/www/reviewboard/ is nginx:
==================================================
~# ls -l /var/www/reviewboard/
total 20
drwxr-xr-x 2 nginx nginx 4096 Dec 27 02:38 conf
drwxr-xr-x 4 nginx nginx 4096 Dec 27 02:41 data
drwxr-xr-x 4 nginx nginx 4096 Dec 27 06:33 htdocs
drwxr-xr-x 2 nginx nginx 4096 Dec 27 02:41 logs
drwxrwxrwx 3 nginx nginx 4096 Dec 27 01:50 tmp

# ls -l /var/www/reviewboard/data/
total 4
drwxr-xr-x 2 nginx nginx 4096 Dec 30 14:30 search-index
==================================================

If I run uwsgi from command line:
~# uwsgi --emperor /etc/uwsgi/vassals
*** Starting uWSGI 2.0.11.2 (64bit) on [Wed Dec 30 14:34:30 2015] ***
compiled with version: 4.9.2 on 27 December 2015 01:55:41
os: Linux-3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u1 (2015-12-14)
nodename: reviewboard
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 1
current working directory: /root
detected binary path: /usr/local/bin/uwsgi
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 3909
your memory page size is 4096 bytes
detected max file descriptor number: 65536
*** starting uWSGI Emperor ***
*** has_emperor mode detected (fd: 6) ***
[uWSGI] getting INI configuration from reviewboard_uwsgi.ini
Wed Dec 30 14:34:30 2015 - [emperor] vassal reviewboard_uwsgi.ini has been 
spawned
Wed Dec 30 14:34:30 2015 - [emperor] vassal reviewboard_uwsgi.ini is ready 
to accept requests

And access to my site: http://192.168.88.125/rb/
I see RB dashboard.
But if I reboot system, I see only "Data directory changes" message.

What can cause this issue?
os.environ['HOME'] in reviewboard.wsgi set correctly.
Could it be that from command-line uwsgi starts from bash, whereas rc.local 
executed by sh?
Or other environment issues?

-- 
Supercharge your Review Board with Power Pack: 
https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: 
https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
--- 
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to