mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-06-18 12:20:40 +00:00
Dirty hack, fix the permission of direcotry /var/log/xcat
This commit is contained in:
@ -153,6 +153,14 @@ return_value=0
|
||||
run_ps () {
|
||||
local ret_local=0
|
||||
mkdir -p "\"/var/log/xcat\""
|
||||
# On Ubuntu, the rsyslogd daemon write log files with syslog:adm
|
||||
# permissison. And in some case, the directory /var/log/xcat was
|
||||
# created by xCAT, and had root:root ownership. In this way, rsyslogd
|
||||
# did not have enough permission to write to log files under this
|
||||
# directory.
|
||||
# As a dirty hack, change the ownership of directory /var/log/xcat
|
||||
# to the same ownership of directory /var/log.
|
||||
chown `ls -ld /var/log | awk '{ print \$3\":\"\$4 }'` "\"/var/log/xcat\""
|
||||
local logfile=\"/var/log/xcat/xcat.log\"
|
||||
|
||||
if [ -f \$1 ]; then
|
||||
@ -300,4 +308,3 @@ cd /
|
||||
#rm -Rf /xcatpost
|
||||
#rm -f /tmp/mypostscript
|
||||
exit 0
|
||||
|
||||
|
@ -138,6 +138,13 @@ return_value=0
|
||||
run_ps () {
|
||||
local ret_local=0
|
||||
mkdir -p "\"/var/log/xcat\""
|
||||
# On some Linux distro, the rsyslogd daemon write log files with permision
|
||||
# other than root:root. And in some case, the directory /var/log/xcat was
|
||||
# created by xCAT, and had root:root ownership. In this way, rsyslogd
|
||||
# did not have enough permission to write to log files under this directory.
|
||||
# As a dirty hack, change the ownership of directory /var/log/xcat to the
|
||||
# same ownership of directory /var/log.
|
||||
chown `ls -ld /var/log | awk '{ print \$3\":\"\$4 }'` "\"/var/log/xcat\""
|
||||
local logfile=\"/var/log/xcat/xcat.log\"
|
||||
|
||||
if [ -f \$1 ]; then
|
||||
@ -274,5 +281,3 @@ updateflag.awk $MASTER 3002
|
||||
cd /
|
||||
#rm -Rf /xcatpost
|
||||
#rm -f /xcatpost/mypostscript
|
||||
|
||||
|
||||
|
@ -348,7 +348,8 @@ else
|
||||
#making sure all the messages goes to /var/log/messages
|
||||
touch /var/log/messages
|
||||
if ( pmatch $OSVER "ubuntu*" ) || ( is_lsb_ubuntu ) || ( pmatch $OSVER "debian*" ); then
|
||||
chown syslog:adm /var/log/messages
|
||||
chown --reference=/var/log /var/log/messages
|
||||
chown --reference=/var/log /var/log/xcat
|
||||
fi
|
||||
if [ $ng -eq 0 ]; then
|
||||
if [ ! -f $conf_file.XCATORIG ]; then
|
||||
|
Reference in New Issue
Block a user