Skip to content

Commit 4c5adb7

Browse files
committed
Specify shell while run me as git user
Some users disabled "git" user's shell after finished installation, this will lead to "This account is currently not available" and could not run /etc/init.d/gitlab, this dirty trick fix it. Signed-off-by: Drunkard Zhang <[email protected]>
1 parent 704922c commit 4c5adb7

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/support/init.d/gitlab

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@ pid_path="$app_root/tmp/pids"
3535
socket_path="$app_root/tmp/sockets"
3636
web_server_pid_path="$pid_path/unicorn.pid"
3737
sidekiq_pid_path="$pid_path/sidekiq.pid"
38+
shell_path="/bin/bash"
3839

3940
# Read configuration variable file if it is present
4041
test -f /etc/default/gitlab && . /etc/default/gitlab
4142

4243
# Switch to the app_user if it is not he/she who is running the script.
4344
if [ "$USER" != "$app_user" ]; then
44-
eval su - "$app_user" -c $(echo \")$0 "$@"$(echo \"); exit;
45+
eval su - "$app_user" -s $shell_path -c $(echo \")$0 "$@"$(echo \"); exit;
4546
fi
4647

4748
# Switch to the gitlab path, exit on failure.

lib/support/init.d/gitlab.default.example

+6
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,9 @@ web_server_pid_path="$pid_path/unicorn.pid"
2929
# sidekiq_pid_path defines the path in which to create the pid file for sidekiq
3030
# The default is "$pid_path/sidekiq.pid"
3131
sidekiq_pid_path="$pid_path/sidekiq.pid"
32+
33+
# shell_path defines the path of shell for "$app_user" in case you disabled
34+
# shell of "$app_user" by commands like `usermod -s /sbin/nologin $app_user"
35+
# for security decision.
36+
# The default is "/bin/bash"
37+
shell_path="/bin/bash"

0 commit comments

Comments
 (0)