More To Environment Variables Than You Know

Поделиться
HTML-код
  • Опубликовано: 11 янв 2025

Комментарии • 71

  •  3 года назад +44

    The meaning behind the naming convention for the files is that they are loaded in alphabetical order, so it allows you to specify their order easily, and using tens of the numbers allows you to inject something in specific places, like 51-something between 50-early and 60-late. It's usually the case with something.d folders.

    • @coatlessali
      @coatlessali 3 года назад +5

      So you're telling me it will technically load without the numbers, but is bad practice?

    • @user-ux2kk5vp7m
      @user-ux2kk5vp7m 3 года назад +5

      @@coatlessali yes

  • @vxer
    @vxer 3 года назад +13

    I think there is an issue at 0:32 the banner shows with black background

  • @novazipstream2
    @novazipstream2 3 года назад +12

    I literally never heard of that path before.. I always set my environment variables either in /etc/environment or /etc/profile, typically I place the XDG specification variables in /etc/profile and every other variable goes into /etc/environment

    • @user-ux2kk5vp7m
      @user-ux2kk5vp7m 3 года назад +3

      Why split between /etc/environment and /etc/profile?

    • @novazipstream2
      @novazipstream2 3 года назад

      @@user-ux2kk5vp7m This is directly from the ArchLinux wiki about environmental variables:
      /etc/environment is used by the pam_env module and is shell agnostic so scripting or glob expansion cannot be used. The file only accepts variable=value pairs.
      /etc/profile initializes variables for login shells only. It does, however, run scripts and can be used by all Bourne shell compatible shells
      So, I put the XDG variables in /etc/profile because /etc/environment only takes direct values, and not parsed ones

  • @yramagicman675
    @yramagicman675 3 года назад +12

    systemctl daemon-reload && systemctl daemon-reexec
    That should reload and re-execute all of systemd without rebooting.

  • @motorcyclehuss2128
    @motorcyclehuss2128 3 года назад +19

    he said among us....

  • @maddancing
    @maddancing 3 года назад

    if anyone is curious the naming convention part is mentioned in the mans of systemd-system.conf, system.conf.d, systemd-user.conf and user.conf.d under 'Configuration Directories and Precedence
    '

  • @hojjat5000
    @hojjat5000 3 года назад

    7:23, There are some people in this photo that I don't know.
    From top to bottom, left to right:
    Richard Stallman,
    Unknown, unknown, unknown, unknown, chris titus tech tips, unknown
    Luke, Linus Sebastian, Anthony, Brodie?, Bryan Lunduke, Luke Smith, Unknown, Level1Tech, Distrotube, Linus, Orxdinary gamer, meme guy, tech hut

  • @hostgrady
    @hostgrady 3 года назад +2

    There's a small banner issue near the start

  • @ulfnic
    @ulfnic 3 года назад +5

    printenv skips a lot of variables, declare -p catches a lot more (double for me). Both those won't show functions though, for that you want declare -f but that flag can't be combined with declare -p. (Extra: For just the function names, use declare -F)
    tldr;
    # Instead of printenv use:
    declare -f && declare -p
    Great show as always.

  • @usernamejp
    @usernamejp 3 года назад +5

    I use Void Linux, btw.

    • @baaz5642
      @baaz5642 3 года назад +3

      Hey found a distro friend

  • @unfa00
    @unfa00 3 года назад

    0:31 Your overlay didn't composite properly.

  • @thingsiplay
    @thingsiplay 3 года назад +2

    I set my environment variables in "/etc/profile.d/env.sh" because I can use variables. "environment.d" does not allow variables, because it is not a script.

    • @GeorgijTovarsen
      @GeorgijTovarsen 3 года назад +1

      also it seems to solve the ``env problem'' presented in the video

  • @florianfelix8295
    @florianfelix8295 3 года назад +1

    That’s pretty important especially for starting up wayland compositors -.^

  • @mskiptr
    @mskiptr 3 года назад +2

    That systemd thumbnail really got me curious lol

  • @syakhiskk
    @syakhiskk 3 года назад +1

    0:31 Does kdenlive acting up again or it's just you Brodie? 😆

  • @s9209122222
    @s9209122222 3 года назад

    So... What is the benefit of using systemd for environment config?

  • @HumanGamer
    @HumanGamer 3 года назад

    How did you set up the color highlights where the typed command is colored when it's a valid command vs invalid command being a different color?

  • @FenrirTheGray
    @FenrirTheGray 3 года назад +1

    Oh I heard of this path before... It was the first time that I installed arch and immediatelly ran into some configuration problem that had to be resolved by editing that config file.
    It was god damn annoying.
    Edit: I remembered it now. My OS Prober wouldn't work because systemd blocked it by default. I couldn't dual boot.
    The fix was to enable it in the previosly mentioned file.

  • @maximus6884
    @maximus6884 3 года назад +1

    why would systemd do things so diferently:?

  • @mathalphabet5645
    @mathalphabet5645 3 года назад +1

    I still want that wallpaper

  • @mk72v2oq
    @mk72v2oq 3 года назад +1

    You don't need to use env command explicitly. You can just do 'NAME=VALUE', and things like 'NAME=VALUE alacritty' also works.

    • @genericgamer1319
      @genericgamer1319 3 года назад +1

      yup but if you use sudo or things like it i think you do need env

    • @martinsavc3202
      @martinsavc3202 3 года назад

      @@genericgamer1319 Just need to set the variable in the right place. setting environment variables is always before the command so:
      A=some sudo echo "$A"

    • @genericgamer1319
      @genericgamer1319 3 года назад

      @@martinsavc3202 that doesn't work on my system though even specifying the zsh -c ""echo $A" doesn;t really show anything even using env strange

    • @martinsavc3202
      @martinsavc3202 3 года назад

      @@genericgamer1319 that's strange. :\ darn shells

  • @billeterk
    @billeterk 3 года назад +4

    Interesting - that’s new to me. But then, so is systemd :-)

  • @06kellyjac
    @06kellyjac 3 года назад +1

    I used to set them via PAM

  • @Shimgao
    @Shimgao 3 года назад +1

    I actually use /etc/environment to set my ZDOTDIR variable and have all my .zsh files in the .config/zsh folder instead of having .zshenv in home. Is it a good practice? I don't know

    • @BrodieRobertson
      @BrodieRobertson  3 года назад +3

      I didn't know you could move the .zshenv like that

    • @Shimgao
      @Shimgao 3 года назад

      My ocd wouldnt let me have two .zsh files on different dirs

    • @Reichstaubenminister
      @Reichstaubenminister 3 года назад +1

      @@Shimgao I don't think that's a disorder, it's just good taste in aesthetics.

  • @GavinFreeborn
    @GavinFreeborn 3 года назад

    I assume what happens at 0:31 was not intentional

    • @BrodieRobertson
      @BrodieRobertson  3 года назад +1

      I replaced my video layer with my overlay rather than putting it on top

  • @25NN25
    @25NN25 3 года назад +2

    runit moment

  • @illusioon1569
    @illusioon1569 3 года назад +1

    I use void Linux, btw.

  • @albatross7
    @albatross7 3 года назад

    How do you set environment variables in a GUI?

    • @BrodieRobertson
      @BrodieRobertson  3 года назад +2

      Modify the file in gui text editor?

    • @thgreenshaman8503
      @thgreenshaman8503 3 года назад +1

      Sorry @Albatross but I really wish I could laugh react Brodie's answer!!!!

    • @abdullahkhaled6162
      @abdullahkhaled6162 3 года назад

      You want env variables to be used in a gui right? If so, don't define them in your shell you can use the method mentioned in the video to do so

  • @snipzmattio5887
    @snipzmattio5887 3 года назад

    0:02
    no way

  • @enriquelnx
    @enriquelnx 3 года назад

    0:02 sus word

  • @ahmedomar222
    @ahmedomar222 3 года назад

    Please fix your audio. It has a higher pitch which makes it hard to watch your video regardless how awesome the content is.

  • @purplewarrior1830
    @purplewarrior1830 3 года назад

    *Inhales*
    IT'S A FEATURE IN OPENRC TOO !!111!! PAY ATTENTION TO ME !!11! I'M DIFFERENT

  • @ishaankapoor933
    @ishaankapoor933 2 года назад

    the wallpaper tho!

  • @MOOBBreezy
    @MOOBBreezy Год назад +1

    Systemd overcomplicating things, as always

  • @darkenblade986
    @darkenblade986 3 года назад

    i guess this guy is a big nyanners fan huh. cool video

  • @breadpirateroberts4946
    @breadpirateroberts4946 3 года назад

    0:02 among us

  • @bologna3048
    @bologna3048 3 года назад +1

    yeah but.... runit tho.. ;)

  • @zaidouardi7901
    @zaidouardi7901 3 года назад

    4rth Hokage.

  • @BjornsTIR
    @BjornsTIR 3 года назад

    Haha, you said among us.

  • @janglestick
    @janglestick 2 года назад

    systemd sshd debian environment.d More To Environment Variables Than You Know

    • @janglestick
      @janglestick 2 года назад

      this could get pretty complex for sshd, it's not good to possibly have your path modified in all these places. I wonder if sshd uses all these same configuration files. Time for a bunch of VAR=ImHere1 entries I guess.
      even LANG can be messed with to have some things "lying in wait", or just some nasty old IBM 3270 cursor codes, etc.
      Seriously though, this seems to potentially circumvent a lot of secure organization, it's rather odd n messy n worrisome, i had no idea.

  • @truevaldeg
    @truevaldeg 3 года назад

    wrong! I use openrc, ahaha

  • @motoryzen
    @motoryzen 3 года назад

    I never set any environment variables. I just USE my Linux Mint Cinnamon PC and it just works...no nonsense about it. *shrugs*

    • @mthf5839
      @mthf5839 3 года назад

      yeah, 'environment variables' are usually only needed if you are changing some technical stuff about the inner workings.
      However, a pretty practical example is setting what editor pops up when you run 'sudoedit /etc/anapp/setting.conf' with the EDITOR variable... provided you ever need to edit files in the /etc directory, that is.. :D

  • @arkoprovoshaw5737
    @arkoprovoshaw5737 3 года назад

    I have been watching your videos for a long time and you never seem to get things right about fish. So let me tell you. Everything in fish is done from ~/.config/fish/config.fish. Starting from setting up aliases , abbreviations to defining function. You can source other files for different things but it is the default.

  • @dakata2416
    @dakata2416 3 года назад

    Among us.

  • @laszlobenedek2710
    @laszlobenedek2710 3 года назад

    amongus

  • @dreamcat4
    @dreamcat4 3 года назад

    LOL both times in your example you check with '--user' flag only. But the 2nd time i try without the flag. And it does not propagate the stuff in /etc/environment into any system level (non user) systemd environment. if you try 'systemctl show-environment'. it isnt included there! so what is the best solution to fix this silly non-congruent corner cases buggy behavior? Mut we all now manually smlink the /etc/environment into /etc/environment.d/ folder? Why is this featire so utterly jank? You'd have thought they paid the sytemd guys enough money for it? After ibm paying out 34 billion for the whole company? Dear me. It"s pretty laughable

    • @magnusanderson6681
      @magnusanderson6681 3 года назад

      Yeah, everything about systemd is sad really.
      I'm trying to figure out how I can create a package in the AUR to make *everything* put its configuration files outside of ~ and it looks like `/etc/security/pam_env.conf` might be the only way