Skip to content

Instantly share code, notes, and snippets.

@datenimperator
Last active September 7, 2016 09:47
Show Gist options
  • Save datenimperator/48a92edf035c37511ce2 to your computer and use it in GitHub Desktop.
Save datenimperator/48a92edf035c37511ce2 to your computer and use it in GitHub Desktop.
Temporary fix for Gitlab sockets not working inside a LXC container on Proxmox 4.1

This is a temporary fix for a problem running Gitlab on Proxmox 4.1 inside a LXC container. Symptom: UNIX sockets created inside containers get wrong permissions. This seems to be related to AppArmor and the Debian kernel used by Proxmox. See this thread on the Proxmox forum for details.

Run apt-get install inotify-tools if you haven't installed inotifywait yet.

Place the first file in /usr/local/sbin/fix_gitlab.sh and make it executable: chmod 755 /usr/local/sbin/fix_gitlab.sh. Edit etc/rc.local to include it during boot.

#!/bin/bash
while true
do
/usr/bin/inotifywait -e create /var/opt/gitlab/gitlab-rails/sockets /var/opt/gitlab/redis /var/opt/gitlab/gitlab-workhorse
chmod 777 /var/opt/gitlab/gitlab-rails/sockets/gitlab.socket
chmod 777 /var/opt/gitlab/redis/redis.socket
chmod 777 /var/opt/gitlab/gitlab-workhorse/socket
done
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/usr/local/sbin/fix_gitlab.sh 2>&1 | logger &
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment