Broken GitLab 7.12 service
Created by: NuLL3rr0r
Hello today I did an upgrade from 7.11.4 to 7.12.2. When I did: service gitlab start I faced with a new shell instead of starting GitLab. In the new shell running whoami says it is git user.
I did a diff: +shell_path="/bin/bash"
Switch to the app_user if it is not he/she who is running the script.
if [ "USER" != "app_user" ]; then
- eval su - "$app_user" -c $(echo ")0 "@"$(echo "); exit;
- eval su - "$app_user" -s $shell_path -c $(echo ")0 "@"$(echo "); exit;
And found two changes: shell_path="/bin/bash" On FreeBSD systems there is no Bash by default and when you install it either from Ports or pkgng it resides in /usr/local/bin/bash. So I changed it to its correct value on FreeBSD. But, I believe the following is a cross platform way of accessing a shell: /usr/bin/env ${SHELL_NAME}, e.g.: /usr/bin/env bash
It did not solve the problem anyway, and the culprit was the second change. reverting to eval su - "$app_user" -c $(echo ")0 "@"$(echo "); exit; (without shell_path variable) solved the issue for me.