ALWAYS run commands with low priority on unix?












3















I am not asking how to nice and renice a command on UNIX.



What happens is that on a particular machine into which I frequently log I am only allowed to run long-running processes with low priority (nice 19). Is there a way for all my commands on this machine to run as if I had "niced 19" them?



Inevitably I forget to prefix the command with "nice 19" when I start it, then need to go muck around in ps/top to locate the pid of my resource-hogging process and then renice it. Too much trouble, and I risk annoying the sysadmin; is there a way to do this by default?



many thanks!
~l










share|improve this question













migrated from stackoverflow.com Jul 21 '10 at 0:35


This question came from our site for professional and enthusiast programmers.














  • 2





    It sounds like this is a sysadmin type question, about using an operating system rather than programming. It may be better suited for superuser.com.

    – JAL
    Jul 21 '10 at 0:31
















3















I am not asking how to nice and renice a command on UNIX.



What happens is that on a particular machine into which I frequently log I am only allowed to run long-running processes with low priority (nice 19). Is there a way for all my commands on this machine to run as if I had "niced 19" them?



Inevitably I forget to prefix the command with "nice 19" when I start it, then need to go muck around in ps/top to locate the pid of my resource-hogging process and then renice it. Too much trouble, and I risk annoying the sysadmin; is there a way to do this by default?



many thanks!
~l










share|improve this question













migrated from stackoverflow.com Jul 21 '10 at 0:35


This question came from our site for professional and enthusiast programmers.














  • 2





    It sounds like this is a sysadmin type question, about using an operating system rather than programming. It may be better suited for superuser.com.

    – JAL
    Jul 21 '10 at 0:31














3












3








3








I am not asking how to nice and renice a command on UNIX.



What happens is that on a particular machine into which I frequently log I am only allowed to run long-running processes with low priority (nice 19). Is there a way for all my commands on this machine to run as if I had "niced 19" them?



Inevitably I forget to prefix the command with "nice 19" when I start it, then need to go muck around in ps/top to locate the pid of my resource-hogging process and then renice it. Too much trouble, and I risk annoying the sysadmin; is there a way to do this by default?



many thanks!
~l










share|improve this question














I am not asking how to nice and renice a command on UNIX.



What happens is that on a particular machine into which I frequently log I am only allowed to run long-running processes with low priority (nice 19). Is there a way for all my commands on this machine to run as if I had "niced 19" them?



Inevitably I forget to prefix the command with "nice 19" when I start it, then need to go muck around in ps/top to locate the pid of my resource-hogging process and then renice it. Too much trouble, and I risk annoying the sysadmin; is there a way to do this by default?



many thanks!
~l







unix scheduling priority nice






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jul 21 '10 at 0:29









laramichaelslaramichaels

3991512




3991512




migrated from stackoverflow.com Jul 21 '10 at 0:35


This question came from our site for professional and enthusiast programmers.









migrated from stackoverflow.com Jul 21 '10 at 0:35


This question came from our site for professional and enthusiast programmers.










  • 2





    It sounds like this is a sysadmin type question, about using an operating system rather than programming. It may be better suited for superuser.com.

    – JAL
    Jul 21 '10 at 0:31














  • 2





    It sounds like this is a sysadmin type question, about using an operating system rather than programming. It may be better suited for superuser.com.

    – JAL
    Jul 21 '10 at 0:31








2




2





It sounds like this is a sysadmin type question, about using an operating system rather than programming. It may be better suited for superuser.com.

– JAL
Jul 21 '10 at 0:31





It sounds like this is a sysadmin type question, about using an operating system rather than programming. It may be better suited for superuser.com.

– JAL
Jul 21 '10 at 0:31










4 Answers
4






active

oldest

votes


















3














Assuming Bash, if your system supports this feature, place this in your ~/.bashrc or ~/.profile:



ulimit -e 19


You can try it from a command line first as a test.






share|improve this answer































    2














    You might ask your sysadmin to look into adjusting limits.conf, a configuration file that is part of PAM and is located (on my Ubuntu system) in /etc/security.



    A line like



    @users hard priority 19


    sets the default 'niceness' for processes started by user accounts.






    share|improve this answer































      0














      This answer assumes your shell is bash.



      Rather than mucking about in ps or top, just suspend the process(es) with Ctrl-z if they weren't launched that way (via &), and then run jobs -l to get a pid, renice that pid, and then continue the job's execution via bg (for BackGround) or fg (ForeGround).






      share|improve this answer































        0














        Have you tried verynice? It's a bit old but still seems to be a program that might be excellent for your needs.



        Update 2019-02-06: link updated.






        share|improve this answer


























        • Linky no worky no more. What was verynice?

          – Jé Queue
          Feb 6 at 16:27






        • 1





          Oh wow, 2010 called, it wanted its answer back. Link updated. :)

          – Janne Pikkarainen
          Feb 6 at 17:01













        Your Answer








        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "3"
        };
        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
        });


        }
        });














        draft saved

        draft discarded


















        StackExchange.ready(
        function () {
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f165921%2falways-run-commands-with-low-priority-on-unix%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        4 Answers
        4






        active

        oldest

        votes








        4 Answers
        4






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        3














        Assuming Bash, if your system supports this feature, place this in your ~/.bashrc or ~/.profile:



        ulimit -e 19


        You can try it from a command line first as a test.






        share|improve this answer




























          3














          Assuming Bash, if your system supports this feature, place this in your ~/.bashrc or ~/.profile:



          ulimit -e 19


          You can try it from a command line first as a test.






          share|improve this answer


























            3












            3








            3







            Assuming Bash, if your system supports this feature, place this in your ~/.bashrc or ~/.profile:



            ulimit -e 19


            You can try it from a command line first as a test.






            share|improve this answer













            Assuming Bash, if your system supports this feature, place this in your ~/.bashrc or ~/.profile:



            ulimit -e 19


            You can try it from a command line first as a test.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jul 21 '10 at 4:23









            Dennis WilliamsonDennis Williamson

            77.5k14130167




            77.5k14130167

























                2














                You might ask your sysadmin to look into adjusting limits.conf, a configuration file that is part of PAM and is located (on my Ubuntu system) in /etc/security.



                A line like



                @users hard priority 19


                sets the default 'niceness' for processes started by user accounts.






                share|improve this answer




























                  2














                  You might ask your sysadmin to look into adjusting limits.conf, a configuration file that is part of PAM and is located (on my Ubuntu system) in /etc/security.



                  A line like



                  @users hard priority 19


                  sets the default 'niceness' for processes started by user accounts.






                  share|improve this answer


























                    2












                    2








                    2







                    You might ask your sysadmin to look into adjusting limits.conf, a configuration file that is part of PAM and is located (on my Ubuntu system) in /etc/security.



                    A line like



                    @users hard priority 19


                    sets the default 'niceness' for processes started by user accounts.






                    share|improve this answer













                    You might ask your sysadmin to look into adjusting limits.conf, a configuration file that is part of PAM and is located (on my Ubuntu system) in /etc/security.



                    A line like



                    @users hard priority 19


                    sets the default 'niceness' for processes started by user accounts.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Jul 21 '10 at 0:36









                    JALJAL

                    1213




                    1213























                        0














                        This answer assumes your shell is bash.



                        Rather than mucking about in ps or top, just suspend the process(es) with Ctrl-z if they weren't launched that way (via &), and then run jobs -l to get a pid, renice that pid, and then continue the job's execution via bg (for BackGround) or fg (ForeGround).






                        share|improve this answer




























                          0














                          This answer assumes your shell is bash.



                          Rather than mucking about in ps or top, just suspend the process(es) with Ctrl-z if they weren't launched that way (via &), and then run jobs -l to get a pid, renice that pid, and then continue the job's execution via bg (for BackGround) or fg (ForeGround).






                          share|improve this answer


























                            0












                            0








                            0







                            This answer assumes your shell is bash.



                            Rather than mucking about in ps or top, just suspend the process(es) with Ctrl-z if they weren't launched that way (via &), and then run jobs -l to get a pid, renice that pid, and then continue the job's execution via bg (for BackGround) or fg (ForeGround).






                            share|improve this answer













                            This answer assumes your shell is bash.



                            Rather than mucking about in ps or top, just suspend the process(es) with Ctrl-z if they weren't launched that way (via &), and then run jobs -l to get a pid, renice that pid, and then continue the job's execution via bg (for BackGround) or fg (ForeGround).







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Jul 21 '10 at 0:44









                            Phil MillerPhil Miller

                            1013




                            1013























                                0














                                Have you tried verynice? It's a bit old but still seems to be a program that might be excellent for your needs.



                                Update 2019-02-06: link updated.






                                share|improve this answer


























                                • Linky no worky no more. What was verynice?

                                  – Jé Queue
                                  Feb 6 at 16:27






                                • 1





                                  Oh wow, 2010 called, it wanted its answer back. Link updated. :)

                                  – Janne Pikkarainen
                                  Feb 6 at 17:01


















                                0














                                Have you tried verynice? It's a bit old but still seems to be a program that might be excellent for your needs.



                                Update 2019-02-06: link updated.






                                share|improve this answer


























                                • Linky no worky no more. What was verynice?

                                  – Jé Queue
                                  Feb 6 at 16:27






                                • 1





                                  Oh wow, 2010 called, it wanted its answer back. Link updated. :)

                                  – Janne Pikkarainen
                                  Feb 6 at 17:01
















                                0












                                0








                                0







                                Have you tried verynice? It's a bit old but still seems to be a program that might be excellent for your needs.



                                Update 2019-02-06: link updated.






                                share|improve this answer















                                Have you tried verynice? It's a bit old but still seems to be a program that might be excellent for your needs.



                                Update 2019-02-06: link updated.







                                share|improve this answer














                                share|improve this answer



                                share|improve this answer








                                edited Feb 6 at 17:02

























                                answered Jul 29 '10 at 8:58









                                Janne PikkarainenJanne Pikkarainen

                                6,2892329




                                6,2892329













                                • Linky no worky no more. What was verynice?

                                  – Jé Queue
                                  Feb 6 at 16:27






                                • 1





                                  Oh wow, 2010 called, it wanted its answer back. Link updated. :)

                                  – Janne Pikkarainen
                                  Feb 6 at 17:01





















                                • Linky no worky no more. What was verynice?

                                  – Jé Queue
                                  Feb 6 at 16:27






                                • 1





                                  Oh wow, 2010 called, it wanted its answer back. Link updated. :)

                                  – Janne Pikkarainen
                                  Feb 6 at 17:01



















                                Linky no worky no more. What was verynice?

                                – Jé Queue
                                Feb 6 at 16:27





                                Linky no worky no more. What was verynice?

                                – Jé Queue
                                Feb 6 at 16:27




                                1




                                1





                                Oh wow, 2010 called, it wanted its answer back. Link updated. :)

                                – Janne Pikkarainen
                                Feb 6 at 17:01







                                Oh wow, 2010 called, it wanted its answer back. Link updated. :)

                                – Janne Pikkarainen
                                Feb 6 at 17:01




















                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Super User!


                                • 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%2fsuperuser.com%2fquestions%2f165921%2falways-run-commands-with-low-priority-on-unix%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

                                Aardman Animations

                                Are they similar matrix

                                “minimization” problem in Euclidean space related to orthonormal basis