CGI script error: Unable to set mail user uid/gid

Refers to:

  • Plesk 12.5 for Linux
  • Plesk 12.0 for Linux

Created:

2016-11-16 13:10:54 UTC

Modified:

2016-12-21 20:07:54 UTC

0

Was this article helpful?


Have more questions?

Submit a request

CGI script error: Unable to set mail user uid/gid

Symptoms

A custom CGI script launched from a website does not work correctly.

The script gives the following error in the /usr/local/psa/var/log/maillog :

Mar 16 12:09:28 sv104 plesk sendmail[22369]: Failed to change uid (11): Resource temporarily unavailable
Mar 16 12:09:28 sv104 plesk sendmail[22369]: Unable to set mail user uid/gid.
Mar 16 12:09:28 sv104 plesk sendmail[22368]: Worker process failed to execute handlers: unexpected exit code: 255

Cause

Apache configuration file contains a limit of the number of forked processes:

    RLimitNPROC 10

Since the script uses sendmail utility (in this case), Apache service tries to launch a process from popuser (uid=30). Popuser already has more than 10 processes:

# cat /etc/passwd | grep :30:
gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
popuser:x:30:31:POP3 service user:/var/qmail/popuser:/sbin/nologin
# ps aux | grep popuser | wc -l
32

EAGAIN error of setuid utility is caused by Apache limits.The output of strace utility:

25733 01:27:06.327490 setrlimit(RLIMIT_NPROC, {rlim_cur=10, rlim_max=328*1024}) = 0 <0.000004>
...
25736 01:27:06.437720 setuid(30) = -1 EAGAIN (Resource temporarily unavailable) <0.000005>

Resolution

Increase RLIMIT_NPROC value in Apache configuration.

Have more questions? Submit a request
Please sign in to leave a comment.