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 no longer a duplicate of bug 1771858
   /snap/bin not in default PATH for units, snapd should ship 
system-environment-generators to inject /snap/bin into $PATH

** Changed in: cron (Ubuntu)
     Assignee: Dimitri John Ledkov (xnox) => (unassigned)

** Tags removed: rls-ee-incoming
** Tags added: rls-ff-incoming rls-hh-incoming

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to cron in Ubuntu.
https://bugs.launchpad.net/bugs/1779767

Title:
  Default cron PATH does not include /snap/bin

Status in cron package in Ubuntu:
  Confirmed

Bug description:
  I recently changed from a .deb install of LXD to a snap, and was
  surprised that one of my crontab scripts stopped working.

  I see that $PATH in a cron script only contains "/usr/bin:/bin",
  whereas my default shell also includes "/snap/bin".

  It seems to me that for the best user experience with snaps,
  "/snap/bin" should be part of the default $PATH in cron.

  ProblemType: Bug
  DistroRelease: Ubuntu 18.04
  Package: cron 3.0pl1-128.1ubuntu1
  ProcVersionSignature: Ubuntu 4.15.0-20.21-generic 4.15.17
  Uname: Linux 4.15.0-20-generic x86_64
  NonfreeKernelModules: kpatch_livepatch_Ubuntu_4_15_0_20_21_generic_40 
kpatch_livepatch_Ubuntu_4_15_0_20_21_generic_39 
livepatch_livepatch_Ubuntu_4_15_0_20_21_generic_ zfs zunicode zavl icp zcommon 
znvpair
  ApportVersion: 2.20.9-0ubuntu7.2
  Architecture: amd64
  CurrentDesktop: ubuntu:GNOME
  Date: Mon Jul  2 14:30:06 2018
  InstallationDate: Installed on 2017-12-20 (194 days ago)
  InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Alpha amd64 (20171219)
  ProcEnviron:
   TERM=xterm-256color
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: cron
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cron/+bug/1779767/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to