Linux host root switch user gets $? Result exception case

  
        

1. Problem Description
Firstly, when the NBU backs up the I2000 database, the monitoring page always fails, but in fact, the rman backup operation has been completed, but the exception is caused by the last $?

Secondly, in a business upgrade, the implement tool automatically upgrades the previous environment check, each component is not checked, can not be automatically upgraded, and finally the manual upgrade, hundreds of boards, is really a tragedy.

2. Problem phenomenon

NDMC21:~ # su - sshusr -c "ls";echo $? bin breeze check.sh Documents ideploy_file_history nohup.out public_html 1

can see To, in normal terms, when you finally take $?, you should return 0.

3. Problem Analysis

In response to this problem, I specially made a case to the SuSE factory, and collected all kinds of logs, even the trace of the trace, the problem has been unable to locate.

I think this problem didn't exist before, only recently, it should be related to the recent security hardening, so the brothers who do security hardening sort out all the operations on the OS level.

The result is: mainly because the /etc/security directory permissions have been modified, /etc/security -- the original permissions: 755, after security hardening, the permissions were modified to: 600.

I tested on several hosts and it is OK:

NDMC21:~ # ls -ld /etc/security/drw------- 2 root root 368 Jul 12 00:24 /etc/security/NDMC21:~ # su - sshusr -c "ls";echo $? bin breeze check.sh Documents ideploy_file_history nohup.out public_html 1NDMC21:~ # chmod 755 /etc/security NDMC21:~ # su - sshusr -c "ls";echo $? bin breeze check.sh Documents ideploy_file_history nohup.out public_html 0

blog address: http://blog.csdn.net/hw_libo/article/details/38979791 - - Bosco QQ: 375612082 Copyright, the article is allowed to reprint, but the source address must be indicated by link, otherwise legal liability will be pursued!

Copyright © Windows knowledge All Rights Reserved