diff --git a/debian/gitlab.postinst b/debian/gitlab.postinst index 8ce440fcfd..6b3d3bad52 100755 --- a/debian/gitlab.postinst +++ b/debian/gitlab.postinst @@ -93,9 +93,8 @@ case "$1" in # Create directories and change ownership echo "Creating runtime directories for gitlab..." # Setup ssh key file - mkdir -p ${gitlab_data_dir}/.ssh - touch ${gitlab_data_dir}/.ssh/authorized_keys - chown -R ${gitlab_user}: ${gitlab_data_dir}/.ssh + runuser -u ${gitlab_user} -- sh -c "mkdir -p ${gitlab_data_dir}/.ssh" + runuser -u ${gitlab_user} -- sh -c "touch ${gitlab_data_dir}/.ssh/authorized_keys" # Create .bundle for .bundle/config mkdir -p ${gitlab_data_dir}/.bundle chown -R ${gitlab_user}: ${gitlab_data_dir}/.bundle