lxc / incus

Powerful system container and virtual machine manager
https://linuxcontainers.org/incus
Apache License 2.0
2.5k stars 203 forks source link

incus-lxcfs can't find /usr/bin/mkdir #352

Closed hanskuhn closed 8 months ago

hanskuhn commented 8 months ago

Hi! Thanks for the awesome work to keep my favorite container software alive. I've started to migrate from LXD to Incus and ran into a hiccup. I was able to work around my problem, but wanted to share my experience in case it's useful. Let me know if more information is needed.

Thanks!


Required information

Issue description

This is a conversion from LXD -> Incus using the lxd-to-incus script. The incus-lxcfs.service fails to start because 'mkdir' isn't found.

I confirmed that a symlink from /bin/mkdir to /usr/bin/mkdir fixes the problem and allows the incus-lxcfs.service to start.

I looked at the coreutils pkg and it appears that /bin/mkdir is the expected location for this binary.

Steps to reproduce

  1. Install incus from the zabbly repo
  2. Run lxd-to-incus
  3. journalctl -u incus-lxcfs.service to see the error when mkdir isn't found.

Information to attach

$ journalctl -u incus-lxcfs

Dec 31 02:50:11 lxd0 systemd[1]: Starting Incus - LXCFS daemon...
Dec 31 02:50:11 lxd0 systemd[995124]: incus-lxcfs.service: Executable /usr/bin/mkdir missing, skipping: No such file or directory
Dec 31 02:50:11 lxd0 systemd[1]: Started Incus - LXCFS daemon.
Dec 31 02:50:11 lxd0 lxcfs[995125]: Running constructor lxcfs_init to reload liblxcfs
Dec 31 02:50:11 lxd0 lxcfs[995125]: mount namespace: 4
Dec 31 02:50:11 lxd0 lxcfs[995125]: hierarchies:
Dec 31 02:50:11 lxd0 lxcfs[995125]:   0: fd:   5:
Dec 31 02:50:11 lxd0 lxcfs[995125]:   1: fd:   6: name=systemd
Dec 31 02:50:11 lxd0 lxcfs[995125]:   2: fd:   7: freezer
Dec 31 02:50:11 lxd0 lxcfs[995125]:   3: fd:   8: cpuset
Dec 31 02:50:11 lxd0 lxcfs[995125]:   4: fd:   9: net_cls,net_prio
Dec 31 02:50:11 lxd0 lxcfs[995125]:   5: fd:  10: pids
Dec 31 02:50:11 lxd0 lxcfs[995125]:   6: fd:  11: memory
Dec 31 02:50:11 lxd0 lxcfs[995125]:   7: fd:  12: rdma
Dec 31 02:50:11 lxd0 lxcfs[995125]:   8: fd:  13: perf_event
Dec 31 02:50:11 lxd0 lxcfs[995125]:   9: fd:  14: cpu,cpuacct
Dec 31 02:50:11 lxd0 lxcfs[995125]:  10: fd:  15: devices
Dec 31 02:50:11 lxd0 lxcfs[995125]:  11: fd:  16: hugetlb
Dec 31 02:50:11 lxd0 lxcfs[995125]:  12: fd:  17: misc
Dec 31 02:50:11 lxd0 lxcfs[995125]:  13: fd:  18: blkio
Dec 31 02:50:11 lxd0 lxcfs[995125]: Kernel supports pidfds
Dec 31 02:50:11 lxd0 lxcfs[995125]: Kernel supports swap accounting
Dec 31 02:50:11 lxd0 lxcfs[995125]: api_extensions:
Dec 31 02:50:11 lxd0 lxcfs[995125]: - cgroups
Dec 31 02:50:11 lxd0 lxcfs[995125]: - sys_cpu_online
Dec 31 02:50:11 lxd0 lxcfs[995125]: - proc_cpuinfo
Dec 31 02:50:11 lxd0 lxcfs[995125]: - proc_diskstats
Dec 31 02:50:11 lxd0 lxcfs[995125]: - proc_loadavg
Dec 31 02:50:11 lxd0 lxcfs[995125]: - proc_meminfo
Dec 31 02:50:11 lxd0 lxcfs[995125]: - proc_stat
Dec 31 02:50:11 lxd0 lxcfs[995125]: - proc_swaps
Dec 31 02:50:11 lxd0 lxcfs[995125]: - proc_uptime
Dec 31 02:50:11 lxd0 lxcfs[995125]: - proc_slabinfo
Dec 31 02:50:11 lxd0 lxcfs[995125]: - shared_pidns
Dec 31 02:50:11 lxd0 lxcfs[995125]: - cpuview_daemon
Dec 31 02:50:11 lxd0 lxcfs[995125]: - loadavg_daemon
Dec 31 02:50:11 lxd0 lxcfs[995125]: - pidfds
Dec 31 02:50:11 lxd0 lxcfs[995125]: ../src/lxcfs.c: 1152: set_pidfile: PID file '/run/lxcfs.pid' is already locked
Dec 31 02:50:11 lxd0 lxcfs[995125]: Running destructor lxcfs_exit
Dec 31 02:50:12 lxd0 systemd[1]: incus-lxcfs.service: Main process exited, code=exited, status=1/FAILURE
Dec 31 02:50:12 lxd0 fusermount[995152]: /bin/fusermount: failed to unmount /var/lib/incus-lxcfs: No such file or directory
Dec 31 02:50:12 lxd0 systemd[1]: incus-lxcfs.service: Failed with result 'exit-code'.
Dec 31 02:50:12 lxd0 systemd[1]: incus-lxcfs.service: Scheduled restart job, restart counter is at 1.
Dec 31 02:50:12 lxd0 systemd[1]: Stopped Incus - LXCFS daemon.
stgraber commented 8 months ago

Ah, your system but be an old Ubuntu release which was updated to Ubuntu 20.04 as Ubuntu 20.04 ships with /bin being a symlink to /usr/bin so this wouldn't have been a problem.

Anyway, as /bin is a symlink to /usr/bin on all modern systems, there's no real harm in using /bin/mkdir so I'll be doing that now.

stgraber commented 8 months ago

Fix pushed to daily and stable packaging repos (zabbly/incus), it will take a few days before it rolls out to users.

hanskuhn commented 8 months ago

Ah, your system but be an old Ubuntu release which was updated to Ubuntu 20.04 as Ubuntu 20.04 ships with /bin being a symlink to /usr/bin so this wouldn't have been a problem.

Anyway, as /bin is a symlink to /usr/bin on all modern systems, there's no real harm in using /bin/mkdir so I'll be doing that now.

Yep! The VM was an 18.04 that got upgraded to 20.04. Good sleuthing. Thanks for all the great work!