ERROR: problem running ufw-init Could not find /lib/ufw/ufw-init-functions (aborting) with snap under LXD
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ufw |
Fix Released
|
High
|
Jamie Strandboge |
Bug Description
On fresh 18.04 lxc, I run the following series of commands
1. apt purge ufw
2. snap install ufw
3. /snap/bin/ufw enable
ERROR: problem running ufw-init
Could not find /lib/ufw/
>find / -name ufw-init-functions
/var/snap/
/snap/ufw/
>ufw --version
ufw 0.36rc
>snap version
snap 2.36.2
snapd 2.36.2
series 16
ubuntu 18.04
kernel 4.15.0-42-generic
>snap info ufw
name: ufw
summary: ufw - Uncomplicated Firewall
publisher: Canonical✓
contact: https:/
license: unset
description: |
ufw is a program for managing a netfilter firewall and aims to provide an easy to use experience
for the user.
commands:
- ufw.conntrack
- ufw.doc
- ufw.init
- ufw.ipset
- ufw
services:
ufw.srv: oneshot, enabled, inactive
snap-id: Jb8klqgs5djfejP
tracking: stable
refresh-date: today at 02:18 UTC
channels:
stable: 0.36rc (120) 737kB -
candidate: 0.36rc (120) 737kB -
beta: 0.36rc (95) 733kB -
edge: 0.36rc (200) 737kB -
installed: 0.36rc (120) 737kB -
Thank you for filing a bug. I'm unable to reproduce:
$ sudo dpkg -l|grep ufw
$ sudo iptables -L -n
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
$ sudo snap install ufw
ufw 0.36rc from Canonical✓ installed
$ sudo ufw enable /bugs.launchpad .net/ufw/ +filebug 5egB9Za8KYVK686 Pe
Command may disrupt existing ssh connections. Proceed with operation (y|n)? y
Firewall is active and enabled on system startup
jamie@server:~$ snap info ufw
name: ufw
summary: ufw - Uncomplicated Firewall
publisher: Canonical✓
contact: https:/
license: unset
description: |
ufw is a program for managing a netfilter firewall and aims to provide an easy
to use experience for the user.
commands:
- ufw.conntrack
- ufw.doc
- ufw.init
- ufw.ipset
- ufw
services:
ufw.srv: oneshot, enabled, inactive
snap-id: Jb8klqgs5djfejP
tracking: stable
refresh-date: today at 08:49 CST
channels:
stable: 0.36rc (120) 737kB -
candidate: 0.36rc (120) 737kB -
beta: 0.36rc (95) 733kB -
edge: 0.36rc (200) 737kB -
installed: 0.36rc (120) 737kB -
The snap should never be looking for /lib/ufw/ ufw-init- functions because we are specifying --rootdir and --datadir in /snap/ufw/ current/ bin/cli, which is what is invoked by /snap/bin/ufw.
Can you retry your reproducer, ideally as a separate user, to see if you are seeing it? If so, can you provide more details on your environment and anything you might have done to make snaps work in general, etc? If as a separate user you don't see it, but as your user you do, can you examine any shell aliases, local-to-your-user wrapper commands or your shell's environment to try to determine the cause?