This bug is old but I'm going to un-duplicate it. I don't believe it is fixed.
I've got a cron script on focal (cron 3.0pl1-136ubuntu1) which is indirectly running `lxc` from a snap (/snap/bin/lxc).
I found the following in mail though:
/home/ubuntu/autopkgtest/tools/autopkgtest-build-lxd: 139: lxc: not found
/home/ubuntu/autopkgtest/tools/autopkgtest-build-lxd: 1: lxc: not found
crontab(5) mentions the default as being "/usr/bin:/bin", and how it does NOT come from /etc/environment. What you have to do is set "PATH=/snap/bin:/usr/bin:/bin" at the top of the crontab file if you want to be able to use snaps. (You can't do "PATH=/snap/bin:$PATH"...)
pathnames.h has a #define for _PATH_DEFPATH where AFAICS this comes from. Maybe it's that which we would want to modify to fix this for cron in Ubuntu.
This bug is old but I'm going to un-duplicate it. I don't believe it is fixed.
I've got a cron script on focal (cron 3.0pl1-136ubuntu1) which is indirectly running `lxc` from a snap (/snap/bin/lxc).
I found the following in mail though:
/home/ubuntu/ autopkgtest/ tools/autopkgte st-build- lxd: 139: lxc: not found autopkgtest/ tools/autopkgte st-build- lxd: 1: lxc: not found
/home/ubuntu/
crontab(5) mentions the default as being "/usr/bin:/bin", and how it does NOT come from /etc/environment. What you have to do is set "PATH=/ snap/bin: /usr/bin: /bin" at the top of the crontab file if you want to be able to use snaps. (You can't do "PATH=/ snap/bin: $PATH". ..)
pathnames.h has a #define for _PATH_DEFPATH where AFAICS this comes from. Maybe it's that which we would want to modify to fix this for cron in Ubuntu.