Skip to content
This repository has been archived by the owner on Mar 8, 2019. It is now read-only.

Commit

Permalink
Better diagnostics in the check-init.log file.
Browse files Browse the repository at this point in the history
Better diagnostics in update-config.php
Disabled apcu due to owncloud/core#18285
  • Loading branch information
jnweiger committed Aug 13, 2015
1 parent 38c41fe commit 63a54b8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
18 changes: 5 additions & 13 deletions vagrant/oc8ce/build-ubuntu-vm.sh
Expand Up @@ -83,26 +83,18 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
cd /var/www/owncloud/apps
curl -sL localhost/owncloud/ | grep login || { curl -sL localhost/owncloud; exit 1; } # did not start at all??
# prepare https
sudo a2enmod ssl headers
sudo a2dissite default-ssl
sudo bash /vagrant/self-signed-ssl.sh
# hook our scripts. Specifically the check-init.sh upon boot.
sudo mkdir -p /var/scripts
sudo cp /vagrant/*.{php,sh} /var/scripts
chmod a+x /var/scripts/*.{php,sh}
sudo sed -i -e 's@exit@bash /var/scripts/check-init.sh; exit@' /etc/rc.local
sudo sed -i -e 's@exit@bash -x /var/scripts/check-init.sh; exit@' /etc/rc.local
echo >> /home/admin/.profile 'test -f /var/scripts/setup-when-root.sh && sudo bash /var/scripts/setup-when-root.sh'
## FIXME: welcome.sh should definitly not be called here.
## It will get most credentials wrong.
## Not sure about setup-when-root.sh, though.
## NOTE: vagrant user is deprecated. This account will not exist in production.
# run the setup scripts (based on that user logs in with vagrant user and then becomes root)
# sudo bash /vagrant/welcome.sh
# sudo bash /vagrant/setup-when-root.sh
# prepare https
sudo a2enmod ssl headers
sudo a2dissite default-ssl
sudo bash /var/scripts/self-signed-ssl.sh
# "zero out" the drive...
$DEBUG || sudo dd if=/dev/zero of=/EMPTY bs=1M
Expand Down
3 changes: 2 additions & 1 deletion vagrant/oc8ce/check-init.sh
Expand Up @@ -40,7 +40,8 @@ rm $oc/data/owncloud.log

## install memcahed
# check if apt-get install php5-apcu was done at build time!
php -m | grep -q apcu && php /var/scripts/update-config.php $oc/config/config.php 'memcache.local' '\\OC\\Memcache\\APCu'
# FIXME: fails with 8.1.1 https://github.com/owncloud/core/issues/18285

This comment has been minimized.

Copy link
@enoch85

enoch85 Aug 13, 2015

owncloud/core#14386 (comment)

Install 4.0.6 or later

# php -m | grep -q apcu && php /var/scripts/update-config.php $oc/config/config.php 'memcache.local' '\OC\Memcache\APCu'

## list of all addresses in case it is a multihomed host.
declare -a ADDRESSES=($(ip r | grep src | cut -d' ' -f12))
Expand Down
4 changes: 4 additions & 0 deletions vagrant/oc8ce/update-config.php
Expand Up @@ -18,6 +18,8 @@
{
# do not create the file, if missing.
# Wrong permissions are deadly for owncloud.
## FIXME: get some proper errno or strerror() please?
print($argv[1] . ": \$CONFIG cannot be loaded?\n");
return;
}

Expand All @@ -42,5 +44,7 @@
}

$text = var_export($CONFIG, true);
## A warning is printed, if argv[1] is not writable.
## PHP does not issue proper errno or strerror() does it?
file_put_contents($argv[1], "<?php\n\$CONFIG = $text;\n");
?>

0 comments on commit 63a54b8

Please sign in to comment.