Run a script as root upon user login into XFCE

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
1
down vote

favorite












I am setting up a "special" environment for user john on my workstation running XFCE desktop. When john signs I want to tweak system configuration which requires root access. I am looking for a way to run a script as root upon user signing into XFCE which would check user name and make tweaks as necessary.



My research led me to the idea of putting my script in /etc/lightdm/lightdm.conf.d/ and use session-setup-script. But am not sure if it is the right place. I need an advice from a guru.










share|improve this question

























    up vote
    1
    down vote

    favorite












    I am setting up a "special" environment for user john on my workstation running XFCE desktop. When john signs I want to tweak system configuration which requires root access. I am looking for a way to run a script as root upon user signing into XFCE which would check user name and make tweaks as necessary.



    My research led me to the idea of putting my script in /etc/lightdm/lightdm.conf.d/ and use session-setup-script. But am not sure if it is the right place. I need an advice from a guru.










    share|improve this question























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I am setting up a "special" environment for user john on my workstation running XFCE desktop. When john signs I want to tweak system configuration which requires root access. I am looking for a way to run a script as root upon user signing into XFCE which would check user name and make tweaks as necessary.



      My research led me to the idea of putting my script in /etc/lightdm/lightdm.conf.d/ and use session-setup-script. But am not sure if it is the right place. I need an advice from a guru.










      share|improve this question













      I am setting up a "special" environment for user john on my workstation running XFCE desktop. When john signs I want to tweak system configuration which requires root access. I am looking for a way to run a script as root upon user signing into XFCE which would check user name and make tweaks as necessary.



      My research led me to the idea of putting my script in /etc/lightdm/lightdm.conf.d/ and use session-setup-script. But am not sure if it is the right place. I need an advice from a guru.







      xubuntu startup root






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 3 at 3:22









      oᴉɹǝɥɔ

      230214




      230214




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote













          Ok, I figured out a working solution just the way I need it.



          I created a file /etc/lightdm/lightdm.conf.d/kids.conf with content



          [Seat:*]
          session-setup-script=/root/bin/tweak-sys-config.sh


          tweak-sys-config.sh runs as root only once (unlike .profile that may run many times) upon desktop user singin with $USER environment variable initialized to user login.






          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',
            convertImagesToLinks: true,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1002543%2frun-a-script-as-root-upon-user-login-into-xfce%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote













            Ok, I figured out a working solution just the way I need it.



            I created a file /etc/lightdm/lightdm.conf.d/kids.conf with content



            [Seat:*]
            session-setup-script=/root/bin/tweak-sys-config.sh


            tweak-sys-config.sh runs as root only once (unlike .profile that may run many times) upon desktop user singin with $USER environment variable initialized to user login.






            share|improve this answer
























              up vote
              1
              down vote













              Ok, I figured out a working solution just the way I need it.



              I created a file /etc/lightdm/lightdm.conf.d/kids.conf with content



              [Seat:*]
              session-setup-script=/root/bin/tweak-sys-config.sh


              tweak-sys-config.sh runs as root only once (unlike .profile that may run many times) upon desktop user singin with $USER environment variable initialized to user login.






              share|improve this answer






















                up vote
                1
                down vote










                up vote
                1
                down vote









                Ok, I figured out a working solution just the way I need it.



                I created a file /etc/lightdm/lightdm.conf.d/kids.conf with content



                [Seat:*]
                session-setup-script=/root/bin/tweak-sys-config.sh


                tweak-sys-config.sh runs as root only once (unlike .profile that may run many times) upon desktop user singin with $USER environment variable initialized to user login.






                share|improve this answer












                Ok, I figured out a working solution just the way I need it.



                I created a file /etc/lightdm/lightdm.conf.d/kids.conf with content



                [Seat:*]
                session-setup-script=/root/bin/tweak-sys-config.sh


                tweak-sys-config.sh runs as root only once (unlike .profile that may run many times) upon desktop user singin with $USER environment variable initialized to user login.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Feb 4 at 4:39









                oᴉɹǝɥɔ

                230214




                230214



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1002543%2frun-a-script-as-root-upon-user-login-into-xfce%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    Unable to execute new pre-installation script (/var/lib/dpkg/tmp.ci/preinst)

                    Running the scala interactive shell from the command line

                    Do not install recommended packages of dependencies