Topic: iRedAdmin w/ nginx not working, uwsgi config issue (includes solution)
======== Required information ====
- iRedMail version: 0.9.1
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Linux/BSD distribution name and version: CentOS 6.6
====
Hello. I have setup iRedMail on a clean server install. On my first try I got a warning during the installation.
cp: cannot create regular file `/etc/uwsgi/iredadmin.ini': No such file or directory
The service uwsgi was not able to start and without further research I have restored a backup of the server. The webmail client worked, but I also want iRedAdmin.
I then created the directory /etc/uwsgi/ manually. iRedMail setup then went through without the warning and the iredadmin.ini was also copied in its location during setup.
But still I cannot run uwsgi (I have rebooted the server). When I try to I get a long error message. At some point it says something about permission denied, but I don't understand what permission where is denied, since there is nothing irregular to be found in the system logs.
# service uwsgi start
Starting uwsgi Fast, self-healing, application container server: [uWSGI] getting INI configuration from /etc/uwsgi.ini
setting capability setgid [6]
setting capability setuid [7]
*** Starting uWSGI 2.0.9 (32bit) on [Mon May 25 19:06:10 2015] ***
compiled with version: 4.4.7 20120313 (Red Hat 4.4.7-11) on 23 April 2015 19:31:06
os: Linux-2.6.32-042stab103.6 #1 SMP Wed Jan 21 13:07:39 MSK 2015
nodename: <<<removed>>>
machine: i686
clock source: unix
pcre jit disabled
detected number of CPU cores: 2
current working directory: /
writing pidfile to /run/uwsgi/uwsgi.pid
detected binary path: /usr/sbin/uwsgi
setgid() to 494
setuid() to 494
your processes number limit is 2062030
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
your mercy for graceful operations on workers is 60 seconds
*** Operational MODE: no-workers ***
spawned uWSGI master process (pid: 2904)
bind(): Permission denied [core/socket.c line 230]
waiting for Emperor death...
The Emperor has been buried (pid: 2905)
...brutally killing workers...
[FEHLGESCHLAGEN]
I have also noticed that the socket and pid file specified in /etc/uwsgi/iredmail.ini does not exist. Well, obvious since it doesn't run properly, but in the error message I can see a default .ini file is loaded. So I have tried to replace this file with the iredmail.ini file. I have actually created a symlink.
ln -s /etc/uwsgi.ini /etc/uwsgi/iredadmin.ini
Now uwsgi starts, however it switches to some dynamic mode and it seems it is running on the console and only as long as the console stays open. iRedAdmin works now however.
# service uwsgi start
Starting uwsgi Fast, self-healing, application container server: [uWSGI] getting INI configuration from /etc/uwsgi.ini
*** Starting uWSGI 2.0.9 (32bit) on [Mon May 25 19:12:36 2015] ***
compiled with version: 4.4.7 20120313 (Red Hat 4.4.7-11) on 23 April 2015 19:31:06
os: Linux-2.6.32-042stab103.6 #1 SMP Wed Jan 21 13:07:39 MSK 2015
nodename: <<<removed>>>
machine: i686
clock source: unix
pcre jit disabled
detected number of CPU cores: 2
current working directory: /
writing pidfile to /var/run/uwsgi_iredadmin.pid
detected binary path: /usr/sbin/uwsgi
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 2062030
your memory page size is 4096 bytes
detected max file descriptor number: 1024
VirtualHosting mode enabled.
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to UNIX address /var/run/uwsgi_iredadmin.socket fd 3
setgid() to 2001
setuid() to 2001
Python version: 2.6.6 (r266:84292, Jan 22 2014, 09:37:14) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)]
Python main interpreter initialized at 0x8af2128
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 63988 bytes (62 KB) for 1 cores
*** Operational MODE: single process ***
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 3008, cores: 1)
WSGI app 0 (mountpoint='<<<removed>>>|/iredadmin') ready in 0 seconds on interpreter 0x8af2128 pid: 3008
<<<removed>>> [pid: 3008|app: 0|req: 1/1] 62.157.68.96 () {50 vars in 790 bytes} [Mon May 25 19:12:53 2015] GET /iredadmin/ => generated 4821 bytes in 743 msecs (HTTP/1.1 200) 1 headers in 111 bytes (3 switches on core 0)
So the only question that remains is, how do I get to run uwsgi to run as a regular service now?
Edit: After a second reboot uwsgi started as a service with the symlinked config . Yeah! So consider this a problem report AND solution.
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.