To add to the issue, `/etc/environment` has one line setting `PATH` and
throwing out any old versions of `PATH` (it doesn't contain `$PATH`).
Changing that changed my `PATH` consistently on reboot:

    $ cat /etc/environment
    
PATH="/opt/ghc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
    $ printenv PATH
    
/home/ubuntu/.cargo/bin:/home/ubuntu/bin:/opt/ghc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

I tried adding a line to `/etc/environment.d/60-haskell.conf` setting
`ZOMG=zomg`, but it wasn't picked up on reboot, so it appears that files
in `/etc/environment.d` do nothing at all, not that they're just
overwritten by `/etc/environment`.

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

Title:
  /etc/environment.d cannot be used to add to PATH

Status in systemd package in Ubuntu:
  New

Bug description:
  I've added an executable file `/etc/environment.d/60-haskell.conf`
  with the following contents:

      PATH=/opt/ghc/bin:$PATH

  According to `man environment.d`, this is a proper procedure for
  altering the PATH variable via systemd. However, it does not work on
  Ubuntu. The PATH on reboot does not include `/opt/ghc/bin`.

  This is due to `/etc/profile` incorrectly overwriting the PATH
  according to comment #10 on
  https://github.com/systemd/systemd/issues/6414.

  There is a Debian bug at https://bugs.debian.org/cgi-
  bin/bugreport.cgi?bug=869144 that was prematurely closed because on
  the Debian side **because it was a Debian issue** rather than a
  systemd issue, which seems quite nonsensical. Perhaps that issue can
  be reopened or another can be opened.

  ======

  Description:    Ubuntu 18.04.3 LTS
  Release:        18.04

  systemd:
    Installed: 237-3ubuntu10.33
    Candidate: 237-3ubuntu10.33
    Version table:
   *** 237-3ubuntu10.33 500
          500 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 
Packages
          100 /var/lib/dpkg/status
       237-3ubuntu10.29 500
          500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 
Packages
       237-3ubuntu10 500
          500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages

  ProblemType: Bug
  DistroRelease: Ubuntu 18.04
  Package: systemd 237-3ubuntu10.33
  ProcVersionSignature: Ubuntu 4.15.0-74.84-generic 4.15.18
  Uname: Linux 4.15.0-74-generic x86_64
  ApportVersion: 2.20.9-0ubuntu7.9
  Architecture: amd64
  Date: Wed Jan 29 19:07:31 2020
  InstallationDate: Installed on 2019-10-10 (111 days ago)
  InstallationMedia: Ubuntu-Server 18.04.3 LTS "Bionic Beaver" - Release amd64 
(20190805)
  Lsusb:
   Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd 
   Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
  MachineType: QEMU Standard PC (i440FX + PIIX, 1996)
  ProcEnviron:
   TERM=screen
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.15.0-74-generic 
root=UUID=111df9fc-1d42-47eb-82a6-3a80a0aba4c7 ro consoleblank=0
  SourcePackage: systemd
  UpgradeStatus: No upgrade log present (probably fresh install)
  dmi.bios.date: 04/01/2014
  dmi.bios.vendor: SeaBIOS
  dmi.bios.version: rel-1.12.0-0-ga698c8995f-prebuilt.qemu.org
  dmi.chassis.type: 1
  dmi.chassis.vendor: QEMU
  dmi.chassis.version: pc-i440fx-3.1
  dmi.modalias: 
dmi:bvnSeaBIOS:bvrrel-1.12.0-0-ga698c8995f-prebuilt.qemu.org:bd04/01/2014:svnQEMU:pnStandardPC(i440FX+PIIX,1996):pvrpc-i440fx-3.1:cvnQEMU:ct1:cvrpc-i440fx-3.1:
  dmi.product.name: Standard PC (i440FX + PIIX, 1996)
  dmi.product.version: pc-i440fx-3.1
  dmi.sys.vendor: QEMU
  modified.conffile..etc.systemd.timesyncd.conf: [modified]
  mtime.conffile..etc.systemd.timesyncd.conf: 2019-10-10T02:35:05.488000

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1861363/+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