Can `su` preserve resource limits?

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 under user t and then switch to t again via su t:



$ ulimit -c -H; ulimit -c
1000
1000
$ su t
Password:
$ ulimit -c -H; ulimit -c
unlimited
0


Is it possible to request su to preserve resource limit, just like sudo which can:



$ ulimit -c -H; ulimit -c
1000
1000

$ sudo bash -c "ulimit -c -H; ulimit -c"
1000
1000


Thanks.



Here I am trying to find a solution to make https://unix.stackexchange.com/a/446811/674 work.







share|improve this question



















  • I think it won't work. It only applies to subshells.
    – Rui F Ribeiro
    May 30 at 2:56














up vote
1
down vote

favorite












I am under user t and then switch to t again via su t:



$ ulimit -c -H; ulimit -c
1000
1000
$ su t
Password:
$ ulimit -c -H; ulimit -c
unlimited
0


Is it possible to request su to preserve resource limit, just like sudo which can:



$ ulimit -c -H; ulimit -c
1000
1000

$ sudo bash -c "ulimit -c -H; ulimit -c"
1000
1000


Thanks.



Here I am trying to find a solution to make https://unix.stackexchange.com/a/446811/674 work.







share|improve this question



















  • I think it won't work. It only applies to subshells.
    – Rui F Ribeiro
    May 30 at 2:56












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I am under user t and then switch to t again via su t:



$ ulimit -c -H; ulimit -c
1000
1000
$ su t
Password:
$ ulimit -c -H; ulimit -c
unlimited
0


Is it possible to request su to preserve resource limit, just like sudo which can:



$ ulimit -c -H; ulimit -c
1000
1000

$ sudo bash -c "ulimit -c -H; ulimit -c"
1000
1000


Thanks.



Here I am trying to find a solution to make https://unix.stackexchange.com/a/446811/674 work.







share|improve this question











I am under user t and then switch to t again via su t:



$ ulimit -c -H; ulimit -c
1000
1000
$ su t
Password:
$ ulimit -c -H; ulimit -c
unlimited
0


Is it possible to request su to preserve resource limit, just like sudo which can:



$ ulimit -c -H; ulimit -c
1000
1000

$ sudo bash -c "ulimit -c -H; ulimit -c"
1000
1000


Thanks.



Here I am trying to find a solution to make https://unix.stackexchange.com/a/446811/674 work.









share|improve this question










share|improve this question




share|improve this question









asked May 30 at 1:23









Tim

22.6k61222401




22.6k61222401











  • I think it won't work. It only applies to subshells.
    – Rui F Ribeiro
    May 30 at 2:56
















  • I think it won't work. It only applies to subshells.
    – Rui F Ribeiro
    May 30 at 2:56















I think it won't work. It only applies to subshells.
– Rui F Ribeiro
May 30 at 2:56




I think it won't work. It only applies to subshells.
– Rui F Ribeiro
May 30 at 2:56















active

oldest

votes











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',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2funix.stackexchange.com%2fquestions%2f446819%2fcan-su-preserve-resource-limits%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f446819%2fcan-su-preserve-resource-limits%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

Peggy Mitchell

Palaiologos

The Forum (Inglewood, California)