• Ephera@lemmy.ml
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    3 hours ago

    It’s kind of bad for scripts, where it can be either annoying or genuinely problematic, when your script hangs on a password prompt. You typically do want it to just fail right away, because if you have monitoring, then you’ll be able to spot it failing.

    These days, it is (largely reliably) possible to detect whether a command is being run interactively or as part of an unattended script, so you do see some commands that trigger a sudo password prompt only for interactive use, for example systemctl does this. But this adds quite a bit of complexity to each individual program, so it isn’t really something that’s going to be implemented universally.

    I also have to say that systemctl kind of gets on my tits when it does that, because it throws up a GUI dialog for grabbing the password, which is quite jarring.