From ae820c4aebb2c706f7e987ba3db03ed88fbc38aa Mon Sep 17 00:00:00 2001 From: Praveen Arimbrathodiyil Date: Thu, 18 Feb 2016 19:04:50 +0530 Subject: [PATCH] check for .secret existence before creating --- debian/postinst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/debian/postinst b/debian/postinst index 7cd9a4f9f7..d77b231cf0 100755 --- a/debian/postinst +++ b/debian/postinst @@ -134,9 +134,12 @@ case "$1" in # Create Gemfile.lock and .secret in /var/lib/gitlab su ${gitlab_user} -s /bin/sh -c "touch ${gitlab_data_dir}/Gemfile.lock" - su ${gitlab_user} -s /bin/sh -c "touch ${gitlab_data_dir}/.secret" ln -s ${gitlab_data_dir}/Gemfile.lock ${gitlab_app_root}/Gemfile.lock - ln -s ${gitlab_data_dir}/.secret ${gitlab_app_root}/.secret + + if ! [ -f "${gitlab_app_root}" ]; then + su ${gitlab_user} -s /bin/sh -c "touch ${gitlab_data_dir}/.secret" + ln -s ${gitlab_data_dir}/.secret ${gitlab_app_root}/.secret + fi echo "Verifying we have all required libraries..." su ${gitlab_user} -s /bin/sh -c 'bundle install --local'