diff options
author | Mark Longair <mhl@pobox.com> | 2013-11-01 12:09:40 +0000 |
---|---|---|
committer | Mark Longair <mhl@pobox.com> | 2013-11-07 15:46:55 +0000 |
commit | 9aec34062f813dd5593815e0ca83aac5ff6766af (patch) | |
tree | 2f11feabe269b41dd61cabcbd0fff8d00ffd3144 /script/site-specific-install.sh | |
parent | e36ce7ec64d1d8633444718d0c0a7c77ef36e576 (diff) |
Invoke commands as the unprivileged user in a login shell
On some setups, the unprivileged user's .bashrc file won't be
sourced unless you've started a login shell - we need that
to be sourced to add the gem's bin directory to the PATH,
or "bundle" won't be found, for example.
Diffstat (limited to 'script/site-specific-install.sh')
-rwxr-xr-x | script/site-specific-install.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/script/site-specific-install.sh b/script/site-specific-install.sh index da1b08b74..5fbab3322 100755 --- a/script/site-specific-install.sh +++ b/script/site-specific-install.sh @@ -116,7 +116,7 @@ install_website_packages add_postgresql_user --superuser export DEVELOPMENT_INSTALL -su -c "$BIN_DIRECTORY/install-as-user '$UNIX_USER' '$HOST' '$DIRECTORY'" "$UNIX_USER" +su -l -c "$BIN_DIRECTORY/install-as-user '$UNIX_USER' '$HOST' '$DIRECTORY'" "$UNIX_USER" # Now that the install-as-user script has loaded the sample data, we # no longer need the PostgreSQL user to be a superuser: @@ -131,7 +131,7 @@ fi cd "$REPOSITORY" echo -n "Creating /etc/cron.d/alaveteli... " -(su -c "cd '$REPOSITORY' && bundle exec rake config_files:convert_crontab DEPLOY_USER='$UNIX_USER' VHOST_DIR='$DIRECTORY' VCSPATH='$SITE' SITE='$SITE' CRONTAB=config/crontab-example" "$UNIX_USER") > /etc/cron.d/alaveteli +(su -l -c "cd '$REPOSITORY' && bundle exec rake config_files:convert_crontab DEPLOY_USER='$UNIX_USER' VHOST_DIR='$DIRECTORY' VCSPATH='$SITE' SITE='$SITE' CRONTAB=config/crontab-example" "$UNIX_USER") > /etc/cron.d/alaveteli # There are some other parts to rewrite, so just do them with sed: sed -r \ -e "/foi-purge-varnish/d" \ @@ -141,7 +141,7 @@ sed -r \ echo $DONE_MSG echo -n "Creating /etc/init.d/foi-alert-tracks... " -(su -c "cd '$REPOSITORY' && bundle exec rake config_files:convert_init_script DEPLOY_USER='$UNIX_USER' VHOST_DIR='$DIRECTORY' SCRIPT_FILE=config/alert-tracks-debian.ugly" "$UNIX_USER") > /etc/init.d/foi-alert-tracks +(su -l -c "cd '$REPOSITORY' && bundle exec rake config_files:convert_init_script DEPLOY_USER='$UNIX_USER' VHOST_DIR='$DIRECTORY' SCRIPT_FILE=config/alert-tracks-debian.ugly" "$UNIX_USER") > /etc/init.d/foi-alert-tracks chmod a+rx /etc/init.d/foi-alert-tracks echo $DONE_MSG |