When relating wordpress to nfs charm the nfs-relation-changed hook fails, the relevant portion of the logs is:
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.juju-log server.go:268 nfs:3: Installing PHP apc.ini ...
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 Usage: mount -V : print version
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 mount -h : print this help
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 mount : list mounted filesystems
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 mount -l : idem, including volume labels
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 So far the informational part. Next the mounting.
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 The command is `mount [-t fstype] something somewhere'.
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 Details found in /etc/fstab may be omitted.
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 mount -a [-t|-O] ... : mount all stuff from /etc/fstab
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 mount device : mount device at the known place
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 mount directory : mount known device here
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 mount -t type dev dir : ordinary mount command
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 Note that one does not really mount a device, one mounts
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 a filesystem (of the given type) found on the device.
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 One can also mount an already visible directory tree elsewhere:
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 mount --bind olddir newdir
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 or move a subtree:
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 mount --move olddir newdir
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 One can change the type of mount containing the directory dir:
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 mount --make-shared dir
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 mount --make-slave dir
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 mount --make-private dir
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 mount --make-unbindable dir
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 One can change the type of all the mounts in a mount subtree
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 containing the directory dir:
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 mount --make-rshared dir
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 mount --make-rslave dir
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 mount --make-rprivate dir
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 mount --make-runbindable dir
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 A device can be given by name, say /dev/hda1 or /dev/cdrom,
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 or by label, using -L label or by uuid, using -U uuid .
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 Other options: [-nfFrsvw] [-o options] [-p passwdfd].
unit-wordpress-0[2993]: 2015-12-11 15:20:54 INFO unit.wordpress/0.nfs-relation-changed logger.go:40 For many more details, say man 8 mount .
unit-wordpress-0[2993]: 2015-12-11 15:20:54 ERROR juju.worker.uniter.operation runhook.go:107 hook "nfs-relation-changed" failed: exit status 1
The reason for this failure is that this charm writes /var/lib/juju/agents/unit-wordpress-0/charm/.nfs-mount file which contains the information about the mountpoint, this file is later sourced by inc/common, but the value assigned to MOUNT_OPS is splited by bash after the first space as can be seen here:
# bash -xc "source .nfs-mount"
+ source .nfs-mount
++ MOUNT_TYPE=nfs
++ MOUNT_OPS=-o
++ rsize=8192,wsize=8192
++ MOUNT_SERVER=192.168.122.105
++ MOUNT_PATH=/srv/data/wordpress
bundle to reproduce the issue:
kvm:
relations:
- - nfs
- wordpress
- - mysql
- wordpress
services:
mysql:
charm: cs:trusty/mysql
num_units: 1
nfs:
charm: cs:trusty/nfs
num_units: 1
wordpress:
charm: cs:trusty/wordpress
num_units: 1
This bug is blocked by bug #1433036