FATAL -> Failed to fork – Digital Ocean – Debian – Docker

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

When you are trying to install a package inside a debian Docker container you get the following error message:

Solution

This is an indication of ‘out of memory’ so add a swap partition if it does not exist, on the host with the following:

(Thanks Valent)

Docker – Debian – Kernel panick – Automatic restart

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

You have a remote server (Debian) running some Docker containers and you want to make sure that they all restart in the event of a kernel panick.

solution

  • Add an automatic restart after a kernel panick by running:

  • Emulate a kernel panick by running the following (SysRq more info here :

  • Check that the containers have restarted again with docker ps (NOTE: the containers should have been enabled to autorestart)

Docker Debian locales installation

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

You want to install some default locales in a Docker image, and the suggestion is to use locale-gen to do so, but it does not work as expected.

Solution

In order to be able to use the locale-gen and install the locales you need you will have to uncomment the ones needed from /etc/locale.gen first and then use the locale-gen. Example below:

bash: warning: setlocale: LC_ALL: cannot change locale (en_GB.UTF-8)

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

When trying to connect with ssh to a linux (debian- ubuntu) server you get the following error:

Solution

The reason is that the server is missing the en_US locale that your client is trying to use to connect to the server.
Login to the server and by using sudo (or su) run the following to install the missing en_US locale and make sure that you leave default to ‘None’ as described here:

Passenger (mod_rails) gem installation – Apache2 – Debian – rvm

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem
You would like to (re)-install passenger after a system wide rvm installation, but you only have the mod_passenger.c file and not the .so after the gem installation.

Solution
Make sure that after using gem install passenger you also use the command to install the apache2 passenger module:

passenger-install-apache2-module

you should then be able to see the .so file and add it to your /etc/apache2/mods-available/passenger.load

ImageMagick, RMagick, Debian installation

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem
You want to use the rmagick gem in your ruby on rails project, but you need to install the imagemagick first.

Solution
If Imagemagick is not already installed, use the following to install it:
$ sudo apt-get install imagemagick$ sudo apt get install libmagick-dev libmagickwand-dev

You should then be able to install and use the rmagick gem

Gitweb access to gitolite repository

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem
You are trying to set up gitolite access through gitweb but the gitweb page, shows ‘no projects avaiable’ even though you have repositories available.

Solution
Try to follow the guide here.
Some of tthe most important steps for having the right access permissions are:

  • Add the www-data user in the gitolite group by:
    $ sudo usermod -a -G gitolite www-data
  • Add the paths to the repositories and the projects list:
    $ sudo vi /etc/gitweb.conf
    $projectroot ="/var/lib/gitolite/repositories";
    $projects_list="/var/lib/gitolite/projects.list";
  • Change the permissions in the repositories:
    $ sudo chmod g+r /var/lib/gitolite/projects.list
    $ sudo chmod -R g+rx /var/lib/gitolite/repositories
  • Change permissions in the /var/lib/gitolite/.gitolite.rc file to allow access to the repositories:
    $REPO_UMASK = 0027;
  • Finally change the git-daemon to run with the gitolite group permissions in the file /etc/sv/git-daemon/run:
    exec chpst -ugitdaemon:gitolite