System freezing after safely remove external drive

Forum Forums New users New Users and General Questions System freezing after safely remove external drive

  • This topic has 18 replies, 5 voices, and was last updated Jun 11-11:17 am by RJP.
Viewing 4 posts - 16 through 19 (of 19 total)
  • Author
    Posts
  • #145143
    Member
    anti-apXos

      Robin, I don’t think the sudoers file in your screenshot will work. I did test and it’s not working on my system. The line allowing NOPASSWD for the script needs to be further down or else the line below it, without NOPASSWD and applying to ALL:ALL, overrides it.

      Alex, the screenshot you posted also does not allow NOPASSWD for this script. That looks like just the default sudoers file to me.

      #145144
      Member
      Robin

        The line allowing NOPASSWD for the script needs to be further down or else the line below it, without NOPASSWD and applying to ALL:ALL, overrides it.

        Wasn’t aware of that fact that the position of the line in the file makes a difference, sorry. I just had recreated this from my recollection now on my current antiX 23.1 where I hadn’t set it up this way until now (Since I know I just have to pass the hdparm command on console manually if a drive doesn’t spin down with the default nonsudoed processing …)

        Is this the proper place now (see new screenshot) ? (except for the fact the comment should read “without asking for sudo password” instead of “without explicit sudo instruction”.)

        —————–

        Update: Tested the line in the position as in the screenshot below, and it positively works, but I have no clue whether this could break something else when setting it to the very end of the file…

        • This reply was modified 1 month, 1 week ago by Robin. Reason: Tested

        Windows is like a submarine. Open a window and serious problems will start.

        #145151
        Member
        anti-apXos

          Yeah, it should work there. Personally, I keep the @includedirs last, though that does mean a rule in /etc/sudoers.d could override it. Just a preference, I guess.

          I wasn’t sure that making the rule for %users instead of %sudo was a good idea, but after thinking about it, I guess maybe it’s intentional. It means even a user who’s not in the sudoers group will be able to use sudo (with no password) for this one command.

          #145152
          Member
          RJP

            It should be

            user ALL=(ALL) NOPASSWD: /usr/local/bin/unplugdrive.sh

            Edit: both ways are working.

            https://www.tecmint.com/run-sudo-command-without-password-linux/

            • This reply was modified 1 month, 1 week ago by RJP.
          Viewing 4 posts - 16 through 19 (of 19 total)
          • You must be logged in to reply to this topic.