I. Problems
An error "cocould not open session" was reported when a root user logged on to a current network host. Before that, the ulimit parameter was adjusted due to oracle's need. As follows:
# <Item> can be one of the following:
#-Core-limits the core file size (KB)
#-Data-max data size (KB)
#-Fsize-maximum filesize (KB)
#-Memlock-max locked-in-memory address space (KB)
#-Nofile-max number of open files
#-Rss-max resident set size (KB)
#-Stack-max stack size (KB)
#-Cpu-max CPU time (MIN)
#-Nproc-max number of processes
#-As-address space limit (KB)
#-Maxlogins-max number of logins for this user
#-Maxsyslogins-max number of logins on the system
#-Priority-the priority to run user process
#-Locks-max number of file locks the user can hold
#-Sigpending-max number of pending signals
#-Msgqueue-max memory used by POSIX message queues (bytes)
#-Nice-max nice priority allowed to raise to values: [-20, 19]
#-Rtprio-max realtime priority
Root soft nproc unlimited
Root hard nproc unlimited
Root soft nofile unlimited
Root hard nofile unlimited
In theory, nproc and nofile of the root user are unrestricted. You do not need to add this configuration here. By manually configuring, it is found that nofile cannot be set to unlimited. As follows:
[Root @ 361way ~] # Ulimit-u unlimited
[Root @ 361way ~] # Ulimit-n unlimited
-Bash: ulimit: open files: cannot modify limit: Operation not permitted
[Root @ 361way ~] #
From the above, we can find that max open file cannot be set to unlimited. After this setting, the system prompts "cocould not open session" after logging on to su root ". The solution is to delete the added four or the last two rows.
In the attempt and optimization of Http persistent connection 2 million, we also mentioned that "before 2.6.25 kernel, a macro defined the maximum value, which is 1024*1024, which is exactly 1 million, in kernel 2.6.25 and later versions, this value can be set through/proc/sys/fs/nr_open. ", In theory, the maximum value is about 2 million.
II. Expansion
In other cases, the error "cocould not open session" may also occur. For example:
1. The max open file value is negative;
2. When some directories under/etc are modified, this error is also reported. For more information, see the blog of Zi AFEI. However, the error message I found during the test is different from that mentioned in the original article, as shown below:
[Root @ 361way/] # su-amos
-Bash:/etc/profile: Permission denied
-Bash-4.1 $ exit
Logout
-Bash:/etc/bash. bash_logout: Permission denied
[Root @ 361way/] # chmod 755 etc/
In summary, the permission is insufficient. In fact, in many cases, the permission is a problem in linux systems. We have encountered this problem today and it is also a Permission problem.