Fixes for lxd snap daemon

This commit is contained in:
Milan Meduna 2019-08-08 16:17:27 +02:00
parent 926da85c67
commit 8a1ecbf5cd

View file

@ -50,9 +50,8 @@ zfs create crypt/lxd/dir
zfs create crypt/lxd/storage
echo "Stopping and disabling lxd"
systemctl disable snap.lxd.daemon
systemctl disable snap.lxd.daemon.unix.socket
systemctl stop snap.lxd.daemon
snap stop lxd.daemon
snap stop --disable lxd.daemon
echo "Deleting everything in /var/snap/lxd/common/lxd/*"
rm /var/snap/lxd/common/lxd/* -r
@ -116,13 +115,13 @@ echo "echo \"Passwords not match!\"" >> /root/onstart
echo "exit 1" >> /root/onstart
echo "fi" >> /root/onstart
echo "echo \"Stopping LXD snap daemon and deleting /var/snap/lxd/common/lxd/*\"" >> /root/onstart
echo "systemctl stop snap.lxd.daemon" >> /root/onstart
echo "snap stop lxd.daemon" >> /root/onstart
echo "rm /var/snap/lxd/common/lxd/* -rf" >> /root/onstart
echo "echo \"Opening encrypted partition\"" >> /root/onstart
echo "echo \$pass_var | cryptsetup open $PARTITION crypt -c -" >> /root/onstart
echo "partprobe" >> /root/onstart
echo "zpool import -d /dev/mapper crypt -f -m" >> /root/onstart
echo "systemctl start snap.lxd.daemon" >> /root/onstart
echo "snap start lxd.daemon" >> /root/onstart
chmod +x /root/onstart
read -p "Press any key for reboot"
@ -131,7 +130,8 @@ reboot
post_reboot_script () {
echo "Stopping lxd and delete /var/snap/lxd/common/lxd/*"
systemctl stop snap.lxd.daemon
snap stop lxd.daemon
snap stop --disable lxd.daemon
rm /var/snap/lxd/common/lxd/* -r
echo "Executing /root/onstart"