@@ -321,9 +321,15 @@ def post_pref(self, apt_packages, packages, upgrade=False):
321321 "'\" $http_referer\" "
322322 "\" $http_user_agent\" ';\n " )
323323
324- # Nginx-Plus does not have nginx
325- # package structure like this
326- # So creating directories
324+ if not os .path .exists ('/etc/nginx/bots.d' ):
325+ WOFileUtils .textwrite (
326+ self , '/etc/nginx/conf.d/variables-hash.conf' ,
327+ 'variables_hash_max_size 4096;\n '
328+ 'variables_hash_bucket_size 4096;' )
329+
330+ # Nginx-Plus does not have nginx
331+ # package structure like this
332+ # So creating directories
327333 if not os .path .exists ('/etc/nginx/sites-available' ):
328334 Log .debug (self , 'Creating directory'
329335 '/etc/nginx/sites-available' )
@@ -1404,11 +1410,15 @@ def post_pref(self, apt_packages, packages, upgrade=False):
14041410 try :
14051411 WOMysql .execute (
14061412 self ,
1407- "create user 'netdata'@'localhost ';" ,
1413+ "DELETE FROM mysql. user WHERE User = 'netdata';" ,
14081414 log = False )
14091415 WOMysql .execute (
14101416 self ,
1411- "grant usage on *.* to 'netdata'@'localhost';" ,
1417+ "create user 'netdata'@'127.0.0.1';" ,
1418+ log = False )
1419+ WOMysql .execute (
1420+ self ,
1421+ "grant usage on *.* to 'netdata'@'127.0.0.1';" ,
14121422 log = False )
14131423 WOMysql .execute (
14141424 self , "flush privileges;" ,
@@ -1585,11 +1595,16 @@ def post_pref(self, apt_packages, packages, upgrade=False):
15851595 # ngxblocker
15861596 if any ('/usr/local/sbin/install-ngxblocker' == x [1 ]
15871597 for x in packages ):
1598+ # remove duplicate directives
1599+ if os .path .exists ('/etc/nginx/conf.d/variables-hash.conf' ):
1600+ WOFileUtils .rm (self , '/etc/nginx/conf.d/variables-hash.conf' )
15881601 WOFileUtils .chmod (
15891602 self , "/usr/local/sbin/install-ngxblocker" , 0o700 )
15901603 WOShellExec .cmd_exec (self , '/usr/local/sbin/install-ngxblocker -x' )
15911604 WOFileUtils .chmod (
15921605 self , "/usr/local/sbin/update-ngxblocker" , 0o700 )
1606+ if not WOService .restart_service (self , 'nginx' ):
1607+ Log .error (self , 'ngxblocker install failed' )
15931608
15941609
15951610def pre_stack (self ):
0 commit comments