• Mystery Incorporated

    Mystery Incorporated

    1 year ago
    So that answer is that, FLEET does not use global environment variables
  • Rachel Perkins

    Rachel Perkins

    1 year ago
    FWIW, I usually set my software inventory variable in my dev build command.
    FLEET_BETA_SOFTWARE_INVENTORY=1 ./build/fleet serve --dev
  • Mystery Incorporated

    Mystery Incorporated

    1 year ago
    I am guessing you are using docker?
  • I guess that stuffs the env var into your docker environment? I am not super familiar with docker tho, if I can run stuff natively I try to do that to eliminate overhead
  • Rachel Perkins

    Rachel Perkins

    1 year ago
    Yeah, we recommend docker for our dev environment
  • Stefano Bonicatti

    Stefano Bonicatti

    1 year ago
    Btw, the availability of an environment variable is not controlled by the process that needs to access it (Fleet), but it's controlled by who (what other process/context) is launching such process. In the case of systemd, as other have said, you have to set the env var there. If you had launched it from bash, then it would've inherited those env vars.
  • Tomas Touceda

    Tomas Touceda

    1 year ago
    what Stefano mentions is correct. That said, we should add that to the systemd documentation @Rachel Perkins
  • Mystery Incorporated

    Mystery Incorporated

    1 year ago
    @Stefano Bonicatti indeed, I figured the variable was only going to bash, that's what I meant by fancy pants method, as in some way to give the fleet process the environment variable, because it is not reading it from /etc/environment (the global environment variables for all processes). Bash specific environment variables go in .bash_profile or .profile etc So when something says "set environment variable" and doesn't specify local or global, I would think it would read the global env vars. But maybe that is a limitation of systemd not fleet which is what I think you are saying?
  • @Rachel Perkins probably explains why it won't build for me, I guess i could probably build it in the docker container and then use the binary natively like I am doing if I decide to build it, which i really should as I build everything else I use.
  • Stefano Bonicatti

    Stefano Bonicatti

    1 year ago
    @Mystery Incorporated I wouldn't necessarily call it a limitation, it's a choice of systemd, since it doesn't want to rely on PAM to read that file. But in general, what I was trying to say is that if any process is not receiving environment variables, you have to look into what's the parent process and check how it works/how it passes env vars.