Eu esbarrei em um problema semelhante há um tempo atrás em lxc com o Ubuntu 14.04 como sistema operacional convidado. Eu fiz algumas pesquisas e descobriu-se que a diretiva limit nofile ...
no trabalho upstart do mongodb de alguma forma fazia com que a chamada dpkg --configure
no pacote mongodb-server saísse com falha durante o processo de pós-instalação do mongodb. Comentar a linha permite que o processo de instalação continue e seja concluído com êxito.
root@mongodb:~# apt install mongodb
...
Setting up mongodb-server (1:2.4.9-1ubuntu2) ...
start: Job failed to start
invoke-rc.d: initscript mongodb, action "start" failed.
dpkg: error processing package mongodb-server (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mongodb:
mongodb depends on mongodb-server (>= 1:2.4.1-2); however:
Package mongodb-server is not configured yet.
dpkg: error processing package mongodb (--configure):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
Processing triggers for ureadahead (0.100.0-16) ...
Errors were encountered while processing:
mongodb-server
mongodb
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@mongodb:~# sed -i -r 's/^limit nofile/#&/' /etc/init/mongodb.conf
root@mongodb:~# apt install mongodb
Reading package lists... Done
Building dependency tree
Reading state information... Done
mongodb is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
Setting up mongodb-server (1:2.4.9-1ubuntu2) ...
mongodb start/running, process 3447
Setting up mongodb (1:2.4.9-1ubuntu2) ...
root@mongodb:~# sed -i -r 's/^#limit nofile/limit nofile/' /etc/init/mongodb.conf
root@mongodb:~# initctl restart mongodb
mongodb start/running, process 3480