Check for gitlab_user before trying to delete
This commit is contained in:
parent
ea2bc36da2
commit
c160045850
1 changed files with 3 additions and 5 deletions
8
debian/postrm
vendored
8
debian/postrm
vendored
|
@ -53,12 +53,10 @@ case "$1" in
|
||||||
rm -rf ${gitlab_log_dir}
|
rm -rf ${gitlab_log_dir}
|
||||||
rm -rf ${gitlab_cache_path}
|
rm -rf ${gitlab_cache_path}
|
||||||
rm -rf ${gitlab_pid_path}
|
rm -rf ${gitlab_pid_path}
|
||||||
# Don't fail if user is already removed
|
if [ ! -z "${gitlab_user}" ]; then
|
||||||
if [ -z "${gitlab_user}" ]; then
|
# Do only if gitlab_user is set
|
||||||
# If gitlab_user variable is unset or empty, use "gitlab" as default.
|
id -u ${gitlab_user} && userdel -r ${gitlab_user}
|
||||||
gitlab_user=gitlab
|
|
||||||
fi
|
fi
|
||||||
id -u ${gitlab_user} && userdel -r ${gitlab_user}
|
|
||||||
rm -rf ${gitlab_data_dir}
|
rm -rf ${gitlab_data_dir}
|
||||||
if [ -x /usr/bin/dropdb ]; then
|
if [ -x /usr/bin/dropdb ]; then
|
||||||
su ${gitlab_user} -c 'psql gitlab_production -c ""' && su postgres -c "dropdb gitlab_production"
|
su ${gitlab_user} -c 'psql gitlab_production -c ""' && su postgres -c "dropdb gitlab_production"
|
||||||
|
|
Loading…
Reference in a new issue