Skip to content

Commit 1c88a16

Browse files
committed
fixes lograte bug and cleans up the messed up permissions
1 parent d69add3 commit 1c88a16

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

install/deb/logrotate/apache2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
notifempty
66
compress
77
delaycompress
8-
create 640 root adm
8+
create 640
99
sharedscripts
1010
postrotate
1111
/etc/init.d/apache2 reload > /dev/null || true
@@ -16,4 +16,4 @@
1616
run-parts /etc/logrotate.d/httpd-prerotate; \
1717
fi; \
1818
endscript
19-
}
19+
}

install/deb/logrotate/nginx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
notifempty
66
compress
77
delaycompress
8-
create 640 nginx adm
8+
create 640
99
sharedscripts
1010
postrotate
1111
[ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`
1212
endscript
13-
}
13+
}

install/upgrade/versions/latest.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,25 @@ if [ -e "/etc/mysql/my.cnf" ]; then
150150
sed -i '/symbolic-links\=0/a\local-infile=0' /etc/mysql/my.cnf
151151
fi
152152
fi
153+
154+
# Fix logrotate permission bug for nginx
155+
if [-e "/etc/logrotate/nginx" ]; then
156+
sed -i "s/create 640 nginx adm/create 640/g" /etc/logrotate.d/nginx
157+
fi
158+
159+
# Fix logrotate permission bug for apache
160+
if [-e "/etc/logrotate/apache2" ]; then
161+
sed -i "s/create 640 root adm/create 640/g" /etc/logrotate.d/apache2
162+
fi
163+
164+
# Repair messed up user log permissions from the logrotate bug. Ignoring errors
165+
for user in $($HESTIA/bin/v-list-users plain | cut -f1); do
166+
for domain in $($HESTIA/bin/v-list-web-domains $user plain | cut -f1); do
167+
chown root:$user /var/log/$WEB_SYSTEM/domains/$domain.* > /dev/null 2>&1
168+
for sub_domain in $($HESTIA/bin/v-list-web-domain $user $domain plain | cut -f7 | tr ',' '\n'); do
169+
chown root:$user /var/log/$WEB_SYSTEM/domains/$sub_domain.* > /dev/null 2>&1
170+
done
171+
done
172+
done
173+
174+
chown root:root /var/log/$WEB_SYSTEM/domains/$WEBMAIL_ALIAS* > /dev/null 2>&1

0 commit comments

Comments
 (0)