"destroy-environment" and /var/log/juju*

John Meinel john at arbash-meinel.com
Mon Mar 24 05:48:24 UTC 2014


I just did a "juju destroy-environment -y local" and it did kill the
agents, but it left the /var/log/juju-jameinel-local directory lying around.
It also left ~/.juju/local/ (with storage and db dirs), though the log dir
is gone.

Just to be sure, I went ahead and bootstrapped again to see what would
happen.
I was a bit surprised to see lots of stuff in ~/.juju/local owned by root:

$ ll ~/.juju/local
drwxr-xr-x 3 root     root     4096 Mar 24 09:36 agents/
drwx------ 4 jameinel jameinel 4096 Mar 24 09:36 db/
drwxr-xr-x 2 root     root     4096 Mar 24 09:36 locks/
drwxr-xr-x 2 jameinel jameinel 4096 Mar 24 09:36 log/
-rw------- 1 root     root     1718 Mar 24 09:36 server.pem
drwxr-xr-x 3 jameinel jameinel 4096 Mar 24 09:36 storage/
-rw------- 1 root     root     1676 Mar 24 09:36 system-identity
drwxr-xr-x 3 root     root     4096 Mar 24 09:36 tools/
$ ll ~/.juju/local/log/
total 68
lrwxrwxrwx 1 root root    45 Mar 24 09:36 all-machines.log ->
/var/log/juju-jameinel-local/all-machines.log
-rw-r--r-- 1 root root  2103 Mar 24 09:36 cloud-init-output.log
-rw-r--r-- 1 root root 61955 Mar 24 09:38 machine-0.log


$ ll /var/log/juju-jameinel-local
total 76
-rw-r--r-- 1 syslog adm    63502 Mar 24 09:37 all-machines.log
-rw------- 1 syslog syslog   883 Mar 24 09:36 ca-cert.pem
lrwxrwxrwx 1 root   root      44 Mar 24 09:36 machine-0.log ->
/home/jameinel/.juju/local/log/machine-0.log
-rw------- 1 syslog syslog   830 Mar 24 09:36 rsyslog-cert.pem
-rw------- 1 syslog syslog   887 Mar 24 09:36 rsyslog-key.pem

It means that it is actually kind of hard to clean these things up, since
half of the things need sudo access.

The second time I did "juju destroy-environment -y local" I ended up
without ~/.juju/local (good), but also it left /var/log/juju-jameinel-local
around (bad). Even doing "juju destroy-environment -y --force local" still
left /var/log/juju-jameinel-local around.

I tried running: "strace -f juju destroy-environment -y local" after
bootstrapping, but that gave:
$ strace -o destroy-strace.txt -f juju destroy-environment -y local
sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the
'nosuid' option set or an NFS file system without root privileges?
ERROR failed to destroy environment "local"

It looks like you cannot "sudo" inside a "strace" process?

I'll privately send you the logs for strace destroy and regular destroy
--debug.

John
=:->
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-dev/attachments/20140324/daefd0d0/attachment.html>


More information about the Juju-dev mailing list