I’ve created this snapcraft config file with strict confinement and kernel-module-control/kernel-module-observe plugs but still I can’t load modules from the terminal interface or get the modinfo command output.
I’ve tried the classic confinement and of course it worked. But it does not look possible to publish the project like this.
So what could be the problem? I need to be able to load modules and get modinfo command output in my project. But all I got is execution errors and permission failures with the current version of the snap.
Mar 31 20:19:10 arch sudo[107796]: pam_unix(sudo:session): session opened for user root by (uid=0)
Mar 31 20:19:11 arch systemd-udevd[107822]: Using default interface naming scheme 'v245'.
Mar 31 20:19:11 arch systemd-udevd[107830]: Using default interface naming scheme 'v245'.
Mar 31 20:19:11 arch upowerd[49303]: treating change event as add on /sys/devices/pci0000:00/0000:00:14.0/usb2
Mar 31 20:19:11 arch systemd-udevd[107833]: regulatory.0: Process '/usr/bin/crda' failed with exit code 234.
Mar 31 20:19:11 arch upowerd[49303]: treating change event as add on /sys/devices/pci0000:00/0000:00:14.0/usb2/2-4
Mar 31 20:19:11 arch upowerd[49303]: treating change event as add on /sys/devices/pci0000:00/0000:00:14.0/usb3
Mar 31 20:19:11 arch upowerd[49303]: treating change event as add on /sys/devices/pci0000:00/0000:00:14.0/usb2/2-6
Mar 31 20:19:11 arch upowerd[49303]: treating change event as add on /sys/devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4:1.0
Mar 31 20:19:11 arch upowerd[49303]: treating change event as add on /sys/devices/pci0000:00/0000:00:14.0/usb3/3-0:1.0
Mar 31 20:19:11 arch upowerd[49303]: treating change event as add on /sys/devices/pci0000:00/0000:00:14.0/usb2/2-0:1.0
Mar 31 20:19:11 arch systemd-udevd[107818]: Using default interface naming scheme 'v245'.
Mar 31 20:19:11 arch systemd-udevd[107820]: Using default interface naming scheme 'v245'.
Mar 31 20:19:11 arch systemd-udevd[107831]: Using default interface naming scheme 'v245'.
Mar 31 20:19:11 arch upowerd[49303]: treating change event as add on /sys/devices/pci0000:00/0000:00:14.0/usb2/2-6/2-6:1.0
Mar 31 20:19:11 arch upowerd[49303]: treating change event as add on /sys/devices/pci0000:00/0000:00:14.0/usb2/2-6/2-6:1.1
Mar 31 20:19:11 arch upowerd[49303]: treating change event as add on /sys/devices/pci0000:00/0000:00:1d.0/usb1
Mar 31 20:19:11 arch upowerd[49303]: treating change event as add on /sys/devices/pci0000:00/0000:00:1d.0/usb1/1-0:1.0
Mar 31 20:19:11 arch upowerd[49303]: treating change event as add on /sys/devices/pci0000:00/0000:00:1d.0/usb1/1-1
Mar 31 20:19:11 arch upowerd[49303]: treating change event as add on /sys/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1:1.0
Mar 31 20:19:11 arch sudo[107796]: pam_unix(sudo:session): session closed for user root
Mar 31 20:19:14 arch sudo[107873]: orhun : TTY=pts/1 ; PWD=/home/orhun ; USER=root ; COMMAND=/usr/bin/snap connect kmon:kernel-module-observe
Mar 31 20:19:14 arch sudo[107873]: pam_unix(sudo:session): session opened for user root by (uid=0)
Mar 31 20:19:15 arch sudo[107873]: pam_unix(sudo:session): session closed for user root
Mar 31 20:19:21 arch sudo[107894]: orhun : TTY=pts/1 ; PWD=/home/orhun ; USER=root ; COMMAND=/var/lib/snapd/snap/bin/kmon
Mar 31 20:19:21 arch sudo[107894]: pam_unix(sudo:session): session opened for user root by (uid=0)
Mar 31 20:20:01 arch sudo[107894]: pam_unix(sudo:session): session closed for user root
Executing the modprobe [module_name] with this function. Also the same function is used for the other calls like modinfo [module_name] which also fails to retrieve the module information.
seeing that you execute your snap from /var/lib/snapd/snap looks like you are not using some ubuntu based os over there … what is the output of snap version ?
I’ve created another snap for running the trace since it’s a TUI app and the trace logs just flood.
It tries to execute modinfo then exists immediately.
Here’s the full trace logs: https://paste.ubuntu.com/p/VkbcWX8MwF/
Here’s the interesting part:
[pid 132762] execve("/snap/kmon/x1/usr/sbin/modinfo", ["modinfo", "tun"], 0x7ffe45c1adb8 /* 36 vars */) = -1 ENOENT (No such file or directory)
[pid 132762] execve("/snap/kmon/x1/usr/bin/modinfo", ["modinfo", "tun"], 0x7ffe45c1adb8 /* 36 vars */) = -1 ENOENT (No such file or directory)
[pid 132762] execve("/snap/kmon/x1/sbin/modinfo", ["modinfo", "tun"], 0x7ffe45c1adb8 /* 36 vars */) = -1 ENOENT (No such file or directory)
[pid 132762] execve("/snap/kmon/x1/bin/modinfo", ["modinfo", "tun"], 0x7ffe45c1adb8 /* 36 vars */) = -1 ENOENT (No such file or directory)
[pid 132762] execve("/usr/local/sbin/modinfo", ["modinfo", "tun"], 0x7ffe45c1adb8 /* 36 vars */) = -1 ENOENT (No such file or directory)
[pid 132762] execve("/usr/local/bin/modinfo", ["modinfo", "tun"], 0x7ffe45c1adb8 /* 36 vars */) = -1 ENOENT (No such file or directory)
[pid 132762] execve("/usr/sbin/modinfo", ["modinfo", "tun"], 0x7ffe45c1adb8 /* 36 vars */) = -1 ENOENT (No such file or directory)
[pid 132762] execve("/usr/bin/modinfo", ["modinfo", "tun"], 0x7ffe45c1adb8 /* 36 vars */) = -1 ENOENT (No such file or directory)