Why some non-root program can be executed by double-click while others not?












0















For example, I found Firefox's process command line: /usr/lib/firefox/firefox. I browse to this location and double-click it, it prompts this:
enter image description here



However, if I type the command in terminal, it works normally.










share|improve this question







New contributor




sz ppeter is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    0















    For example, I found Firefox's process command line: /usr/lib/firefox/firefox. I browse to this location and double-click it, it prompts this:
    enter image description here



    However, if I type the command in terminal, it works normally.










    share|improve this question







    New contributor




    sz ppeter is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      For example, I found Firefox's process command line: /usr/lib/firefox/firefox. I browse to this location and double-click it, it prompts this:
      enter image description here



      However, if I type the command in terminal, it works normally.










      share|improve this question







      New contributor




      sz ppeter is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      For example, I found Firefox's process command line: /usr/lib/firefox/firefox. I browse to this location and double-click it, it prompts this:
      enter image description here



      However, if I type the command in terminal, it works normally.







      executable






      share|improve this question







      New contributor




      sz ppeter is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      sz ppeter is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      sz ppeter is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 1 hour ago









      sz ppetersz ppeter

      1




      1




      New contributor




      sz ppeter is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      sz ppeter is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      sz ppeter is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Simple reason is that file manager recognizes the file type. If you double-click /usr/share/applications/firefox.desktop or any other .desktop file for that matter, the file manager will execute it as application. Otherwise, file manager looks up which filetype corresponds to which application.



          And that's were /usr/lib/firefox/firefox comes in. It is compiled as shared object.



          $ file   /usr/lib/firefox/firefox
          /usr/lib/firefox/firefox: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=d2a4bfe9dbe1aadd5480a6b5612b7a3fc1fd01a2, stripped


          This type of file has been touched on in detail in kos's answer, but basically shared object is an executable file, which can be used as library. Libraries usually are included into other software, hence Nautilus can ignore and has no default program assigned to it. By contrast, to shell (or rather kernel, to which execve() call will pass the path to that file) recognizes that as executable file just fine.



          Now, what gets executed when you execute firefox.desktop ? That's /usr/bin/firefox.sh - a wrapper script which does a few checks and replaces itself with /usr/lib/firefox/firefox later on. In this case, shell script is detected as filetype and Nautilus happily spawns that. There's a lot of other things that happen behind the scenes, but that's the general gist of it all.






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "89"
            };
            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: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            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
            });


            }
            });






            sz ppeter is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1120772%2fwhy-some-non-root-program-can-be-executed-by-double-click-while-others-not%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Simple reason is that file manager recognizes the file type. If you double-click /usr/share/applications/firefox.desktop or any other .desktop file for that matter, the file manager will execute it as application. Otherwise, file manager looks up which filetype corresponds to which application.



            And that's were /usr/lib/firefox/firefox comes in. It is compiled as shared object.



            $ file   /usr/lib/firefox/firefox
            /usr/lib/firefox/firefox: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=d2a4bfe9dbe1aadd5480a6b5612b7a3fc1fd01a2, stripped


            This type of file has been touched on in detail in kos's answer, but basically shared object is an executable file, which can be used as library. Libraries usually are included into other software, hence Nautilus can ignore and has no default program assigned to it. By contrast, to shell (or rather kernel, to which execve() call will pass the path to that file) recognizes that as executable file just fine.



            Now, what gets executed when you execute firefox.desktop ? That's /usr/bin/firefox.sh - a wrapper script which does a few checks and replaces itself with /usr/lib/firefox/firefox later on. In this case, shell script is detected as filetype and Nautilus happily spawns that. There's a lot of other things that happen behind the scenes, but that's the general gist of it all.






            share|improve this answer




























              0














              Simple reason is that file manager recognizes the file type. If you double-click /usr/share/applications/firefox.desktop or any other .desktop file for that matter, the file manager will execute it as application. Otherwise, file manager looks up which filetype corresponds to which application.



              And that's were /usr/lib/firefox/firefox comes in. It is compiled as shared object.



              $ file   /usr/lib/firefox/firefox
              /usr/lib/firefox/firefox: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=d2a4bfe9dbe1aadd5480a6b5612b7a3fc1fd01a2, stripped


              This type of file has been touched on in detail in kos's answer, but basically shared object is an executable file, which can be used as library. Libraries usually are included into other software, hence Nautilus can ignore and has no default program assigned to it. By contrast, to shell (or rather kernel, to which execve() call will pass the path to that file) recognizes that as executable file just fine.



              Now, what gets executed when you execute firefox.desktop ? That's /usr/bin/firefox.sh - a wrapper script which does a few checks and replaces itself with /usr/lib/firefox/firefox later on. In this case, shell script is detected as filetype and Nautilus happily spawns that. There's a lot of other things that happen behind the scenes, but that's the general gist of it all.






              share|improve this answer


























                0












                0








                0







                Simple reason is that file manager recognizes the file type. If you double-click /usr/share/applications/firefox.desktop or any other .desktop file for that matter, the file manager will execute it as application. Otherwise, file manager looks up which filetype corresponds to which application.



                And that's were /usr/lib/firefox/firefox comes in. It is compiled as shared object.



                $ file   /usr/lib/firefox/firefox
                /usr/lib/firefox/firefox: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=d2a4bfe9dbe1aadd5480a6b5612b7a3fc1fd01a2, stripped


                This type of file has been touched on in detail in kos's answer, but basically shared object is an executable file, which can be used as library. Libraries usually are included into other software, hence Nautilus can ignore and has no default program assigned to it. By contrast, to shell (or rather kernel, to which execve() call will pass the path to that file) recognizes that as executable file just fine.



                Now, what gets executed when you execute firefox.desktop ? That's /usr/bin/firefox.sh - a wrapper script which does a few checks and replaces itself with /usr/lib/firefox/firefox later on. In this case, shell script is detected as filetype and Nautilus happily spawns that. There's a lot of other things that happen behind the scenes, but that's the general gist of it all.






                share|improve this answer













                Simple reason is that file manager recognizes the file type. If you double-click /usr/share/applications/firefox.desktop or any other .desktop file for that matter, the file manager will execute it as application. Otherwise, file manager looks up which filetype corresponds to which application.



                And that's were /usr/lib/firefox/firefox comes in. It is compiled as shared object.



                $ file   /usr/lib/firefox/firefox
                /usr/lib/firefox/firefox: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=d2a4bfe9dbe1aadd5480a6b5612b7a3fc1fd01a2, stripped


                This type of file has been touched on in detail in kos's answer, but basically shared object is an executable file, which can be used as library. Libraries usually are included into other software, hence Nautilus can ignore and has no default program assigned to it. By contrast, to shell (or rather kernel, to which execve() call will pass the path to that file) recognizes that as executable file just fine.



                Now, what gets executed when you execute firefox.desktop ? That's /usr/bin/firefox.sh - a wrapper script which does a few checks and replaces itself with /usr/lib/firefox/firefox later on. In this case, shell script is detected as filetype and Nautilus happily spawns that. There's a lot of other things that happen behind the scenes, but that's the general gist of it all.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 1 hour ago









                Sergiy KolodyazhnyySergiy Kolodyazhnyy

                72.9k9152316




                72.9k9152316






















                    sz ppeter is a new contributor. Be nice, and check out our Code of Conduct.










                    draft saved

                    draft discarded


















                    sz ppeter is a new contributor. Be nice, and check out our Code of Conduct.













                    sz ppeter is a new contributor. Be nice, and check out our Code of Conduct.












                    sz ppeter is a new contributor. Be nice, and check out our Code of Conduct.
















                    Thanks for contributing an answer to Ask Ubuntu!


                    • 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%2faskubuntu.com%2fquestions%2f1120772%2fwhy-some-non-root-program-can-be-executed-by-double-click-while-others-not%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

                    GameSpot

                    connect to host localhost port 22: Connection refused

                    Getting a Wifi WPA2 wifi connection