# Steps to reproduce
1.) Clean Ubuntu 18.04 install + Jenkins + lxd snap.
2.) su - Jenkins
3.) lxc list
Above fails with readonly filesystem error because by default Jenkins' homedir is /var/lib/jenkins.
# Workaround
1.) Shutdown Jenkins
2.) mv /var/lib/jenkins /home/jenkins
3.) edit /etc/password and change jenkins users homedir (or use usermod)
4.) edit /etc/default/jenkins and change $JENKINS_HOME to match (ie JENKINS_HOME=/home/$NAME)
Adding a file /etc/apparmor.d/tunables/home.d/jenkins with the @{HOMEDIRS} as suggested above didn't work for me either.
I would have thought using lxc containers to perform automated builds and testing with jenkins is a fairly common & practical use case, so it would be good to figure out a reliable fix for this.
+1
# Steps to reproduce
1.) Clean Ubuntu 18.04 install + Jenkins + lxd snap.
2.) su - Jenkins
3.) lxc list
Above fails with readonly filesystem error because by default Jenkins' homedir is /var/lib/jenkins.
# Workaround jenkins and change $JENKINS_HOME to match (ie JENKINS_ HOME=/home/ $NAME)
1.) Shutdown Jenkins
2.) mv /var/lib/jenkins /home/jenkins
3.) edit /etc/password and change jenkins users homedir (or use usermod)
4.) edit /etc/default/
Adding a file /etc/apparmor. d/tunables/ home.d/ jenkins with the @{HOMEDIRS} as suggested above didn't work for me either.
I would have thought using lxc containers to perform automated builds and testing with jenkins is a fairly common & practical use case, so it would be good to figure out a reliable fix for this.