1

On CentOS/RHEL 6, when I start my daemon as root user, I see /proc/<pid>/loginuid of the process as 0 and when I start it through sudo, I see loginuid of the sudo user. Even if I do sudo su - to become root, I see loginuid of the sudo user. My doubt is whether the process limits of open files, memory etc change when loginuid is non-root ? Or for that matter any other factor which causes performance drop when loginuid is non-root ?

  • Are you asking about ulimit of sudo user's process? – Am_I_Helpful Jul 25 '15 at 13:33
0

The fact that the login UID doesn't change after sudo or su is the whole point of a having login UID, separate from the real and effective UIDs. It's meant for logging purposes.

Neither the login UID nor any other UID of a process has a direct impact on a process's limits or performance.

Limits are set by the program that logs you in. After that, they are inherited by all the programs in the session, even if you call sudo or su or some other program to change to another user. A program can change the limits that apply to it, but only up to a point: there's a soft limit, which programs can change, and a hard limit, which programs can't change unless running as root¹. Normal programs don't change their limits.

¹ or having the appropriate capability, which normally only root has.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.