Cron is trying (and failing) to open env file: /etc/environment












3














I'm using Devuan ASCII (which is more or less Debian 9, Stretch). Now, my /var/log/auth.log has a bunch of these entries:



Jan  6 09:45:01 mybox CRON[20951]: pam_env(cron:session): Unable to open env file: /etc/environment: No such file or directory
Jan 6 09:45:01 mybox CRON[20951]: pam_unix(cron:session): session opened for user root by (uid=0)


which apparently get generated when I su.




  1. Why is cron/pam_env/pam_unix trying to open that file in the first place, rather than checking whether it exists?

  2. If they legitimately expect it, why isn't it there?

  3. What should I do about this?










share|improve this question





























    3














    I'm using Devuan ASCII (which is more or less Debian 9, Stretch). Now, my /var/log/auth.log has a bunch of these entries:



    Jan  6 09:45:01 mybox CRON[20951]: pam_env(cron:session): Unable to open env file: /etc/environment: No such file or directory
    Jan 6 09:45:01 mybox CRON[20951]: pam_unix(cron:session): session opened for user root by (uid=0)


    which apparently get generated when I su.




    1. Why is cron/pam_env/pam_unix trying to open that file in the first place, rather than checking whether it exists?

    2. If they legitimately expect it, why isn't it there?

    3. What should I do about this?










    share|improve this question



























      3












      3








      3







      I'm using Devuan ASCII (which is more or less Debian 9, Stretch). Now, my /var/log/auth.log has a bunch of these entries:



      Jan  6 09:45:01 mybox CRON[20951]: pam_env(cron:session): Unable to open env file: /etc/environment: No such file or directory
      Jan 6 09:45:01 mybox CRON[20951]: pam_unix(cron:session): session opened for user root by (uid=0)


      which apparently get generated when I su.




      1. Why is cron/pam_env/pam_unix trying to open that file in the first place, rather than checking whether it exists?

      2. If they legitimately expect it, why isn't it there?

      3. What should I do about this?










      share|improve this question















      I'm using Devuan ASCII (which is more or less Debian 9, Stretch). Now, my /var/log/auth.log has a bunch of these entries:



      Jan  6 09:45:01 mybox CRON[20951]: pam_env(cron:session): Unable to open env file: /etc/environment: No such file or directory
      Jan 6 09:45:01 mybox CRON[20951]: pam_unix(cron:session): session opened for user root by (uid=0)


      which apparently get generated when I su.




      1. Why is cron/pam_env/pam_unix trying to open that file in the first place, rather than checking whether it exists?

      2. If they legitimately expect it, why isn't it there?

      3. What should I do about this?







      debian cron environment-variables pam devuan






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 1 hour ago

























      asked 2 hours ago









      einpoklum

      2,08341952




      2,08341952






















          2 Answers
          2






          active

          oldest

          votes


















          2














          Answering all of your questions





          1. Why is cron/pam_env/pam_unix trying to open that file in the first place?




          See BUG #646015. In some cases(like locale related stuff) this file is deprecated. But it is still used system-wide, and log is made whenever it is missing.





          1. If they legitimately expect it, why isn't it there?




          Cause maybe the bug isn't fixed after all. Steve Langasek (BUG #646015) said it is, and new systems should create that file using postinst scripts the same way old systems being upgraded should already have that file.





          1. What should I do about this?





          • Run dpkg-reconfigure libpam-modules and see if it will create the file through its postinst script.

          • If that does not work, create the file manually with touch /etc/environment


          It's also interesting to report your issue to the Devuan Project with details of the problem and your setup since this issue was resolved before the Debian/Devuan fork happened.






          share|improve this answer























          • Wait, what? /etc/environment is deprecated? Since when? Do you have a reference for this? The bug report you link to has one user claiming it is deprecated and another claiming it is not.
            – terdon
            18 mins ago












          • OK, i have misquoted the link. Putting LOCALE related stuff inside /etc/environment became deprecated.
            – nwildner
            11 mins ago










          • Could you remove the mention of its being deprecated then? As far as I know, this is a very standard file that's been around for ages and locale settings are only a small part of what it's used for.
            – terdon
            9 mins ago



















          1














          An inelegant but perfectly valid solution is to give those modules what they want: As root, execute



          touch /etc/environment


          and to make sure the permissions are right, just in case:



          chmod 644 /etc/environment





          share|improve this answer

















          • 2




            Note that this behavior is completely normal. The pam_env is expected to look for /etc/environment and that's the default way that the /etc/environment file is read, at least on Linux systems.
            – terdon
            1 hour ago










          • I have it here: cat /etc/environment QT_QPA_PLATFORMTHEME=qt5ct
            – Rui F Ribeiro
            1 hour ago










          • @terdon: Looking for it is fine, assuming it exists is not fine. It's either a bug in pam_env or an issue with Debian.
            – einpoklum
            1 hour ago










          • Sounds more like a bug of the specific distro. That is a standard file and it exists in Debian. But is this actually a problem? Does it cause any issue other than a message in the log?
            – terdon
            1 hour ago











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f492972%2fcron-is-trying-and-failing-to-open-env-file-etc-environment%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          Answering all of your questions





          1. Why is cron/pam_env/pam_unix trying to open that file in the first place?




          See BUG #646015. In some cases(like locale related stuff) this file is deprecated. But it is still used system-wide, and log is made whenever it is missing.





          1. If they legitimately expect it, why isn't it there?




          Cause maybe the bug isn't fixed after all. Steve Langasek (BUG #646015) said it is, and new systems should create that file using postinst scripts the same way old systems being upgraded should already have that file.





          1. What should I do about this?





          • Run dpkg-reconfigure libpam-modules and see if it will create the file through its postinst script.

          • If that does not work, create the file manually with touch /etc/environment


          It's also interesting to report your issue to the Devuan Project with details of the problem and your setup since this issue was resolved before the Debian/Devuan fork happened.






          share|improve this answer























          • Wait, what? /etc/environment is deprecated? Since when? Do you have a reference for this? The bug report you link to has one user claiming it is deprecated and another claiming it is not.
            – terdon
            18 mins ago












          • OK, i have misquoted the link. Putting LOCALE related stuff inside /etc/environment became deprecated.
            – nwildner
            11 mins ago










          • Could you remove the mention of its being deprecated then? As far as I know, this is a very standard file that's been around for ages and locale settings are only a small part of what it's used for.
            – terdon
            9 mins ago
















          2














          Answering all of your questions





          1. Why is cron/pam_env/pam_unix trying to open that file in the first place?




          See BUG #646015. In some cases(like locale related stuff) this file is deprecated. But it is still used system-wide, and log is made whenever it is missing.





          1. If they legitimately expect it, why isn't it there?




          Cause maybe the bug isn't fixed after all. Steve Langasek (BUG #646015) said it is, and new systems should create that file using postinst scripts the same way old systems being upgraded should already have that file.





          1. What should I do about this?





          • Run dpkg-reconfigure libpam-modules and see if it will create the file through its postinst script.

          • If that does not work, create the file manually with touch /etc/environment


          It's also interesting to report your issue to the Devuan Project with details of the problem and your setup since this issue was resolved before the Debian/Devuan fork happened.






          share|improve this answer























          • Wait, what? /etc/environment is deprecated? Since when? Do you have a reference for this? The bug report you link to has one user claiming it is deprecated and another claiming it is not.
            – terdon
            18 mins ago












          • OK, i have misquoted the link. Putting LOCALE related stuff inside /etc/environment became deprecated.
            – nwildner
            11 mins ago










          • Could you remove the mention of its being deprecated then? As far as I know, this is a very standard file that's been around for ages and locale settings are only a small part of what it's used for.
            – terdon
            9 mins ago














          2












          2








          2






          Answering all of your questions





          1. Why is cron/pam_env/pam_unix trying to open that file in the first place?




          See BUG #646015. In some cases(like locale related stuff) this file is deprecated. But it is still used system-wide, and log is made whenever it is missing.





          1. If they legitimately expect it, why isn't it there?




          Cause maybe the bug isn't fixed after all. Steve Langasek (BUG #646015) said it is, and new systems should create that file using postinst scripts the same way old systems being upgraded should already have that file.





          1. What should I do about this?





          • Run dpkg-reconfigure libpam-modules and see if it will create the file through its postinst script.

          • If that does not work, create the file manually with touch /etc/environment


          It's also interesting to report your issue to the Devuan Project with details of the problem and your setup since this issue was resolved before the Debian/Devuan fork happened.






          share|improve this answer














          Answering all of your questions





          1. Why is cron/pam_env/pam_unix trying to open that file in the first place?




          See BUG #646015. In some cases(like locale related stuff) this file is deprecated. But it is still used system-wide, and log is made whenever it is missing.





          1. If they legitimately expect it, why isn't it there?




          Cause maybe the bug isn't fixed after all. Steve Langasek (BUG #646015) said it is, and new systems should create that file using postinst scripts the same way old systems being upgraded should already have that file.





          1. What should I do about this?





          • Run dpkg-reconfigure libpam-modules and see if it will create the file through its postinst script.

          • If that does not work, create the file manually with touch /etc/environment


          It's also interesting to report your issue to the Devuan Project with details of the problem and your setup since this issue was resolved before the Debian/Devuan fork happened.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 7 mins ago

























          answered 1 hour ago









          nwildner

          14k14176




          14k14176












          • Wait, what? /etc/environment is deprecated? Since when? Do you have a reference for this? The bug report you link to has one user claiming it is deprecated and another claiming it is not.
            – terdon
            18 mins ago












          • OK, i have misquoted the link. Putting LOCALE related stuff inside /etc/environment became deprecated.
            – nwildner
            11 mins ago










          • Could you remove the mention of its being deprecated then? As far as I know, this is a very standard file that's been around for ages and locale settings are only a small part of what it's used for.
            – terdon
            9 mins ago


















          • Wait, what? /etc/environment is deprecated? Since when? Do you have a reference for this? The bug report you link to has one user claiming it is deprecated and another claiming it is not.
            – terdon
            18 mins ago












          • OK, i have misquoted the link. Putting LOCALE related stuff inside /etc/environment became deprecated.
            – nwildner
            11 mins ago










          • Could you remove the mention of its being deprecated then? As far as I know, this is a very standard file that's been around for ages and locale settings are only a small part of what it's used for.
            – terdon
            9 mins ago
















          Wait, what? /etc/environment is deprecated? Since when? Do you have a reference for this? The bug report you link to has one user claiming it is deprecated and another claiming it is not.
          – terdon
          18 mins ago






          Wait, what? /etc/environment is deprecated? Since when? Do you have a reference for this? The bug report you link to has one user claiming it is deprecated and another claiming it is not.
          – terdon
          18 mins ago














          OK, i have misquoted the link. Putting LOCALE related stuff inside /etc/environment became deprecated.
          – nwildner
          11 mins ago




          OK, i have misquoted the link. Putting LOCALE related stuff inside /etc/environment became deprecated.
          – nwildner
          11 mins ago












          Could you remove the mention of its being deprecated then? As far as I know, this is a very standard file that's been around for ages and locale settings are only a small part of what it's used for.
          – terdon
          9 mins ago




          Could you remove the mention of its being deprecated then? As far as I know, this is a very standard file that's been around for ages and locale settings are only a small part of what it's used for.
          – terdon
          9 mins ago













          1














          An inelegant but perfectly valid solution is to give those modules what they want: As root, execute



          touch /etc/environment


          and to make sure the permissions are right, just in case:



          chmod 644 /etc/environment





          share|improve this answer

















          • 2




            Note that this behavior is completely normal. The pam_env is expected to look for /etc/environment and that's the default way that the /etc/environment file is read, at least on Linux systems.
            – terdon
            1 hour ago










          • I have it here: cat /etc/environment QT_QPA_PLATFORMTHEME=qt5ct
            – Rui F Ribeiro
            1 hour ago










          • @terdon: Looking for it is fine, assuming it exists is not fine. It's either a bug in pam_env or an issue with Debian.
            – einpoklum
            1 hour ago










          • Sounds more like a bug of the specific distro. That is a standard file and it exists in Debian. But is this actually a problem? Does it cause any issue other than a message in the log?
            – terdon
            1 hour ago
















          1














          An inelegant but perfectly valid solution is to give those modules what they want: As root, execute



          touch /etc/environment


          and to make sure the permissions are right, just in case:



          chmod 644 /etc/environment





          share|improve this answer

















          • 2




            Note that this behavior is completely normal. The pam_env is expected to look for /etc/environment and that's the default way that the /etc/environment file is read, at least on Linux systems.
            – terdon
            1 hour ago










          • I have it here: cat /etc/environment QT_QPA_PLATFORMTHEME=qt5ct
            – Rui F Ribeiro
            1 hour ago










          • @terdon: Looking for it is fine, assuming it exists is not fine. It's either a bug in pam_env or an issue with Debian.
            – einpoklum
            1 hour ago










          • Sounds more like a bug of the specific distro. That is a standard file and it exists in Debian. But is this actually a problem? Does it cause any issue other than a message in the log?
            – terdon
            1 hour ago














          1












          1








          1






          An inelegant but perfectly valid solution is to give those modules what they want: As root, execute



          touch /etc/environment


          and to make sure the permissions are right, just in case:



          chmod 644 /etc/environment





          share|improve this answer












          An inelegant but perfectly valid solution is to give those modules what they want: As root, execute



          touch /etc/environment


          and to make sure the permissions are right, just in case:



          chmod 644 /etc/environment






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 2 hours ago









          einpoklum

          2,08341952




          2,08341952








          • 2




            Note that this behavior is completely normal. The pam_env is expected to look for /etc/environment and that's the default way that the /etc/environment file is read, at least on Linux systems.
            – terdon
            1 hour ago










          • I have it here: cat /etc/environment QT_QPA_PLATFORMTHEME=qt5ct
            – Rui F Ribeiro
            1 hour ago










          • @terdon: Looking for it is fine, assuming it exists is not fine. It's either a bug in pam_env or an issue with Debian.
            – einpoklum
            1 hour ago










          • Sounds more like a bug of the specific distro. That is a standard file and it exists in Debian. But is this actually a problem? Does it cause any issue other than a message in the log?
            – terdon
            1 hour ago














          • 2




            Note that this behavior is completely normal. The pam_env is expected to look for /etc/environment and that's the default way that the /etc/environment file is read, at least on Linux systems.
            – terdon
            1 hour ago










          • I have it here: cat /etc/environment QT_QPA_PLATFORMTHEME=qt5ct
            – Rui F Ribeiro
            1 hour ago










          • @terdon: Looking for it is fine, assuming it exists is not fine. It's either a bug in pam_env or an issue with Debian.
            – einpoklum
            1 hour ago










          • Sounds more like a bug of the specific distro. That is a standard file and it exists in Debian. But is this actually a problem? Does it cause any issue other than a message in the log?
            – terdon
            1 hour ago








          2




          2




          Note that this behavior is completely normal. The pam_env is expected to look for /etc/environment and that's the default way that the /etc/environment file is read, at least on Linux systems.
          – terdon
          1 hour ago




          Note that this behavior is completely normal. The pam_env is expected to look for /etc/environment and that's the default way that the /etc/environment file is read, at least on Linux systems.
          – terdon
          1 hour ago












          I have it here: cat /etc/environment QT_QPA_PLATFORMTHEME=qt5ct
          – Rui F Ribeiro
          1 hour ago




          I have it here: cat /etc/environment QT_QPA_PLATFORMTHEME=qt5ct
          – Rui F Ribeiro
          1 hour ago












          @terdon: Looking for it is fine, assuming it exists is not fine. It's either a bug in pam_env or an issue with Debian.
          – einpoklum
          1 hour ago




          @terdon: Looking for it is fine, assuming it exists is not fine. It's either a bug in pam_env or an issue with Debian.
          – einpoklum
          1 hour ago












          Sounds more like a bug of the specific distro. That is a standard file and it exists in Debian. But is this actually a problem? Does it cause any issue other than a message in the log?
          – terdon
          1 hour ago




          Sounds more like a bug of the specific distro. That is a standard file and it exists in Debian. But is this actually a problem? Does it cause any issue other than a message in the log?
          – terdon
          1 hour ago


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f492972%2fcron-is-trying-and-failing-to-open-env-file-etc-environment%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          404 Error Contact Form 7 ajax form submitting

          How to know if a Active Directory user can login interactively

          TypeError: fit_transform() missing 1 required positional argument: 'X'