Browse Source

Update legacy /var/run directory to /run (#3159)

* Update legacy /var/run directory to /run

Refs:
https://access.redhat.com/solutions/4154291
https://bugs.launchpad.net/ubuntu/+source/dbus/+bug/1854314

* update ipset url due to 301 redirect

* Update sieve upgrade script

* Include update script

* Force update templates

* Fix tests

Co-authored-by: Jaap Marcus <9754650+jaapmarcus@users.noreply.github.com>
Istiak Ferdous 3 năm trước cách đây
mục cha
commit
bce434fb4f
42 tập tin đã thay đổi với 99 bổ sung81 xóa
  1. 1 1
      bin/v-change-sys-hestia-ssl
  2. 6 6
      bin/v-list-sys-services
  3. 1 1
      install/common/dovecot/dovecot.conf
  4. 1 1
      install/common/firewall/ipset/blacklist.sh
  5. 2 2
      install/deb/clamav/clamd.conf
  6. 3 3
      install/deb/exim/exim4.conf.4.94.template
  7. 3 3
      install/deb/exim/exim4.conf.template
  8. 1 1
      install/deb/logrotate/apache2
  9. 1 1
      install/deb/logrotate/nginx
  10. 4 4
      install/deb/mysql/my-large.cnf
  11. 4 4
      install/deb/mysql/my-medium.cnf
  12. 4 4
      install/deb/mysql/my-small.cnf
  13. 1 1
      install/deb/nginx/nginx.conf
  14. 1 1
      install/deb/templates/web/php-fpm/no-php.tpl
  15. 1 1
      install/deb/templates/web/php-fpm/socket.tpl
  16. 5 5
      install/hst-install-debian.sh
  17. 2 2
      install/rpm/clamav/clamd.conf
  18. 2 2
      install/rpm/clamav/clamd.service
  19. 1 1
      install/rpm/clamav/freshclam.conf
  20. 3 3
      install/rpm/exim/exim.conf
  21. 1 1
      install/rpm/logrotate/httpd
  22. 1 1
      install/rpm/logrotate/nginx
  23. 1 1
      install/rpm/mysql/my-large.cnf
  24. 1 1
      install/rpm/mysql/my-medium.cnf
  25. 1 1
      install/rpm/mysql/my-small.cnf
  26. 1 1
      install/rpm/nginx/nginx.conf
  27. 1 1
      install/rpm/php-fpm/multiphp.tpl
  28. 1 1
      install/rpm/pma/apache.conf
  29. 1 1
      install/rpm/templates/web/php-fpm/default.tpl
  30. 1 1
      install/rpm/templates/web/php-fpm/no-php.tpl
  31. 1 1
      install/rpm/templates/web/php-fpm/socket.tpl
  32. 1 1
      install/upgrade/manual/install_sieve.sh
  33. 21 3
      install/upgrade/versions/1.7.0.sh
  34. 2 2
      src/deb/nginx/hestia
  35. 3 3
      src/deb/nginx/nginx.conf
  36. 2 2
      src/deb/php/php-fpm.conf
  37. 3 3
      src/rpm/nginx/hestia-nginx.service
  38. 2 2
      src/rpm/nginx/nginx.conf
  39. 3 3
      src/rpm/php/hestia-php.service
  40. 1 1
      src/rpm/php/hestia-php.spec
  41. 2 2
      src/rpm/php/php-fpm.conf
  42. 1 1
      test/test.bats

+ 1 - 1
bin/v-change-sys-hestia-ssl

@@ -66,7 +66,7 @@ cp -f $ssl_dir/certificate.key $HESTIA/ssl/certificate.key
 
 # Restarting web server
 if [ "$restart" != 'no' ]; then
-	kill -HUP $(cat /var/run/hestia-nginx.pid)
+	kill -HUP $(cat /run/hestia-nginx.pid)
 	$BIN/v-restart-mail "$restart"
 fi
 

+ 6 - 6
bin/v-list-sys-services

@@ -115,14 +115,14 @@ get_srv_state() {
 
 		# Searching pid file
 		pid_file=''
-		if [ -e "/var/run/$srv.pid" ]; then
-			pid_file="/var/run/$srv.pid"
+		if [ -e "/run/$srv.pid" ]; then
+			pid_file="/run/$srv.pid"
 		fi
-		if [ -z "$pid_file" ] && [ -e "/var/run/$srv/$srv.pid" ]; then
-			pid_file="/var/run/$srv/$srv.pid"
+		if [ -z "$pid_file" ] && [ -e "/run/$srv/$srv.pid" ]; then
+			pid_file="/run/$srv/$srv.pid"
 		fi
-		if [ -z "$pid_file" ] && [ -e "/var/run/$name/$name.pid" ]; then
-			pid_file="/var/run/$name/$name.pid"
+		if [ -z "$pid_file" ] && [ -e "/run/$name/$name.pid" ]; then
+			pid_file="/run/$name/$name.pid"
 		fi
 		if [ -z "$pid_file" ] && [ -e "/proc/$pid" ]; then
 			pid_file="/proc/$pid"

+ 1 - 1
install/common/dovecot/dovecot.conf

@@ -1,6 +1,6 @@
 protocols = imap pop3
 listen = *, ::
-base_dir = /var/run/dovecot/
+base_dir = /run/dovecot/
 login_greeting = Mail Delivery Agent
 !include conf.d/*.conf
 !include_try conf.d/domains/*.conf

+ 1 - 1
install/common/firewall/ipset/blacklist.sh

@@ -8,7 +8,7 @@ BLACKLISTS=(
 	"https://www.projecthoneypot.org/list_of_ips.php?t=d&rss=1"                                # Project Honey Pot Directory of Dictionary Attacker IPs
 	"https://check.torproject.org/cgi-bin/TorBulkExitList.py?ip=1.1.1.1"                       # TOR Exit Nodes
 	"https://www.maxmind.com/en/high-risk-ip-sample-list"                                      # MaxMind GeoIP Anonymous Proxies
-	"http://danger.rulez.sk/projects/bruteforceblocker/blist.php"                              # BruteForceBlocker IP List
+	"https://danger.rulez.sk/projects/bruteforceblocker/blist.php"                             # BruteForceBlocker IP List
 	"https://www.spamhaus.org/drop/drop.lasso"                                                 # Spamhaus Don't Route Or Peer List (DROP)
 	"https://cinsscore.com/list/ci-badguys.txt"                                                # C.I. Army Malicious IP List
 	"https://lists.blocklist.de/lists/all.txt"                                                 # blocklist.de attackers

+ 2 - 2
install/deb/clamav/clamd.conf

@@ -1,7 +1,7 @@
 #Automatically Generated by clamav-daemon postinst
 #To reconfigure clamd run #dpkg-reconfigure clamav-daemon
 #Please read /usr/share/doc/clamav-daemon/README.Debian.gz for details
-LocalSocket /var/run/clamav/clamd.ctl
+LocalSocket /run/clamav/clamd.ctl
 FixStaleSocket true
 LocalSocketGroup clamav
 LocalSocketMode 666
@@ -84,5 +84,5 @@ LogFileMaxSize 0
 Bytecode true
 BytecodeSecurity TrustSigned
 BytecodeTimeout 60000
-PidFile /var/run/clamav/clamd.pid
+PidFile /run/clamav/clamd.pid
 OnAccessMaxFileSize 5M

+ 3 - 3
install/deb/exim/exim4.conf.4.94.template

@@ -33,7 +33,7 @@ spamd_address = 127.0.0.1 783
 .endif
 
 .ifdef CLAMD
-av_scanner = clamd: /var/run/clamav/clamd.ctl
+av_scanner = clamd: /run/clamav/clamd.ctl
 .endif
 
 log_selector = +tls_sni
@@ -246,13 +246,13 @@ smtp_relay_login:
 dovecot_plain:
   driver = dovecot
   public_name = PLAIN
-  server_socket = /var/run/dovecot/auth-client
+  server_socket = /run/dovecot/auth-client
   server_set_id = $auth1
 
 dovecot_login:
   driver = dovecot
   public_name = LOGIN
-  server_socket = /var/run/dovecot/auth-client
+  server_socket = /run/dovecot/auth-client
   server_set_id = $auth1
 
 

+ 3 - 3
install/deb/exim/exim4.conf.template

@@ -33,7 +33,7 @@ spamd_address = 127.0.0.1 783
 .endif
 
 .ifdef CLAMD
-av_scanner = clamd: /var/run/clamav/clamd.ctl
+av_scanner = clamd: /run/clamav/clamd.ctl
 .endif
 
 log_selector = +tls_sni
@@ -248,13 +248,13 @@ smtp_relay_login:
 dovecot_plain:
   driver = dovecot
   public_name = PLAIN
-  server_socket = /var/run/dovecot/auth-client
+  server_socket = /run/dovecot/auth-client
   server_set_id = $auth1
 
 dovecot_login:
   driver = dovecot
   public_name = LOGIN
-  server_socket = /var/run/dovecot/auth-client
+  server_socket = /run/dovecot/auth-client
   server_set_id = $auth1
 
 

+ 1 - 1
install/deb/logrotate/apache2

@@ -9,7 +9,7 @@
     sharedscripts
     postrotate
         /etc/init.d/apache2 reload > /dev/null || true
-        [ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /var/run/nginx.pid`
+        [ ! -f /run/nginx.pid ] || kill -USR1 `cat /run/nginx.pid`
         endscript
     prerotate
         if [ -d /etc/logrotate.d/httpd-prerotate ]; then \

+ 1 - 1
install/deb/logrotate/nginx

@@ -8,6 +8,6 @@
     create 640
     sharedscripts
     postrotate
-        [ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`
+        [ -f /run/nginx.pid ] && kill -USR1 `cat /run/nginx.pid`
         endscript
 }

+ 4 - 4
install/deb/mysql/my-large.cnf

@@ -1,14 +1,14 @@
 [client]
 port=3306
-socket=/var/run/mysqld/mysqld.sock
+socket=/run/mysqld/mysqld.sock
 
 [mysqld_safe]
-socket=/var/run/mysqld/mysqld.sock
+socket=/run/mysqld/mysqld.sock
 
 [mysqld]
 user=mysql
-pid-file=/var/run/mysqld/mysqld.pid
-socket=/var/run/mysqld/mysqld.sock
+pid-file=/run/mysqld/mysqld.pid
+socket=/run/mysqld/mysqld.sock
 port=3306
 basedir=/usr
 datadir=/var/lib/mysql

+ 4 - 4
install/deb/mysql/my-medium.cnf

@@ -1,14 +1,14 @@
 [client]
 port=3306
-socket=/var/run/mysqld/mysqld.sock
+socket=/run/mysqld/mysqld.sock
 
 [mysqld_safe]
-socket=/var/run/mysqld/mysqld.sock
+socket=/run/mysqld/mysqld.sock
 
 [mysqld]
 user=mysql
-pid-file=/var/run/mysqld/mysqld.pid
-socket=/var/run/mysqld/mysqld.sock
+pid-file=/run/mysqld/mysqld.pid
+socket=/run/mysqld/mysqld.sock
 port=3306
 basedir=/usr
 datadir=/var/lib/mysql

+ 4 - 4
install/deb/mysql/my-small.cnf

@@ -1,14 +1,14 @@
 [client]
 port=3306
-socket=/var/run/mysqld/mysqld.sock
+socket=/run/mysqld/mysqld.sock
 
 [mysqld_safe]
-socket=/var/run/mysqld/mysqld.sock
+socket=/run/mysqld/mysqld.sock
 
 [mysqld]
 user=mysql
-pid-file=/var/run/mysqld/mysqld.pid
-socket=/var/run/mysqld/mysqld.sock
+pid-file=/run/mysqld/mysqld.pid
+socket=/run/mysqld/mysqld.sock
 port=3306
 basedir=/usr
 datadir=/var/lib/mysql

+ 1 - 1
install/deb/nginx/nginx.conf

@@ -3,7 +3,7 @@ user                 www-data;
 worker_processes     auto;
 worker_rlimit_nofile 65535;
 error_log            /var/log/nginx/error.log;
-pid                  /var/run/nginx.pid;
+pid                  /run/nginx.pid;
 include              /etc/nginx/modules-enabled/*.conf;
 
 # Worker config

+ 1 - 1
install/deb/templates/web/php-fpm/no-php.tpl

@@ -1,7 +1,7 @@
 ; origin-src: deb/templates/web/php-fpm/no-php.tpl
 
 ;[%backend%]
-;listen = /var/run/php/%backend%.sock
+;listen = /run/php/%backend%.sock
 ;listen.owner = %user%
 ;listen.group = www-data
 ;listen.mode = 0660

+ 1 - 1
install/deb/templates/web/php-fpm/socket.tpl

@@ -1,7 +1,7 @@
 ; origin-src: deb/templates/web/php-fpm/socket.tpl
 
 [%backend%]
-listen = /var/run/php/%backend%.sock
+listen = /run/php/%backend%.sock
 listen.owner = %user%
 listen.group = www-data
 listen.mode = 0660

+ 5 - 5
install/hst-install-debian.sh

@@ -1743,13 +1743,13 @@ if [ "$clamd" = 'yes' ]; then
 	gpasswd -a clamav Debian-exim > /dev/null 2>&1
 	cp -f $HESTIA_INSTALL_DIR/clamav/clamd.conf /etc/clamav/
 	update-rc.d clamav-daemon defaults
-	if [ ! -d "/var/run/clamav" ]; then
-		mkdir /var/run/clamav
+	if [ ! -d "/run/clamav" ]; then
+		mkdir /run/clamav
 	fi
-	chown -R clamav:clamav /var/run/clamav
+	chown -R clamav:clamav /run/clamav
 	if [ -e "/lib/systemd/system/clamav-daemon.service" ]; then
-		exec_pre1='ExecStartPre=-/bin/mkdir -p /var/run/clamav'
-		exec_pre2='ExecStartPre=-/bin/chown -R clamav:clamav /var/run/clamav'
+		exec_pre1='ExecStartPre=-/bin/mkdir -p /run/clamav'
+		exec_pre2='ExecStartPre=-/bin/chown -R clamav:clamav /run/clamav'
 		sed -i "s|\[Service\]/|[Service]\n$exec_pre1\n$exec_pre2|g" \
 			/lib/systemd/system/clamav-daemon.service
 		systemctl daemon-reload

+ 2 - 2
install/rpm/clamav/clamd.conf

@@ -1,7 +1,7 @@
 #Automatically Generated by clamav-base postinst
 #To reconfigure clamd run #dpkg-reconfigure clamav-base
 #Please read /usr/share/doc/clamav-base/README.Debian.gz for details
-LocalSocket /var/run/clamav/clamd.ctl
+LocalSocket /run/clamav/clamd.ctl
 FixStaleSocket true
 LocalSocketGroup clamav
 LocalSocketMode 666
@@ -22,7 +22,7 @@ LogSyslog false
 LogFacility LOG_LOCAL6
 LogClean false
 LogVerbose true
-PidFile /var/run/clamav/clamd.pid
+PidFile /run/clamav/clamd.pid
 DatabaseDirectory /var/lib/clamav
 SelfCheck 3600
 Foreground false

+ 2 - 2
install/rpm/clamav/clamd.service

@@ -4,8 +4,8 @@ After = syslog.target nss-lookup.target network.target
 
 [Service]
 Type = simple
-ExecStartPre = /usr/bin/mkdir -p /var/run/clamav
-ExecStartPre = /usr/bin/chown -R clamav:clamav /var/run/clamav
+ExecStartPre = /usr/bin/mkdir -p /run/clamav
+ExecStartPre = /usr/bin/chown -R clamav:clamav /run/clamav
 ExecStart = /usr/sbin/clamd -c /etc/clamd.conf
 Restart = on-failure
 PrivateTmp = true

+ 1 - 1
install/rpm/clamav/freshclam.conf

@@ -48,7 +48,7 @@
 
 # This option allows you to save the process identifier of the daemon
 # Default: disabled
-#PidFile /var/run/freshclam.pid
+#PidFile /run/freshclam.pid
 
 # By default when started freshclam drops privileges and switches to the
 # "clamav" user. This directive allows you to change the database owner.

+ 3 - 3
install/rpm/exim/exim.conf

@@ -31,7 +31,7 @@ spamd_address = 127.0.0.1 783
 .endif
 
 .ifdef CLAMD
-av_scanner = clamd: /var/run/clamav/clamd.ctl
+av_scanner = clamd: /run/clamav/clamd.ctl
 .endif
 
 log_selector = +tls_sni
@@ -221,13 +221,13 @@ begin authenticators
 dovecot_plain:
   driver = dovecot
   public_name = PLAIN
-  server_socket = /var/run/dovecot/auth-client
+  server_socket = /run/dovecot/auth-client
   server_set_id = $auth1
 
 dovecot_login:
   driver = dovecot
   public_name = LOGIN
-  server_socket = /var/run/dovecot/auth-client
+  server_socket = /run/dovecot/auth-client
   server_set_id = $auth1
 
 

+ 1 - 1
install/rpm/logrotate/httpd

@@ -5,6 +5,6 @@
     sharedscripts
     postrotate
         /sbin/service httpd reload > /dev/null 2>/dev/null || true
-        [ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /var/run/nginx.pid`
+        [ ! -f /run/nginx.pid ] || kill -USR1 `cat /run/nginx.pid`
     endscript
 }

+ 1 - 1
install/rpm/logrotate/nginx

@@ -8,6 +8,6 @@
     create 640
     sharedscripts
     postrotate
-        [ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`
+        [ -f /run/nginx.pid ] && kill -USR1 `cat /run/nginx.pid`
         endscript
 }

+ 1 - 1
install/rpm/mysql/my-large.cnf

@@ -7,7 +7,7 @@ socket=/var/lib/mysql/mysql.sock
 
 [mysqld]
 user=mysql
-#pid-file=/var/run/mysqld/mysqld.pid
+#pid-file=/run/mysqld/mysqld.pid
 socket=/var/lib/mysql/mysql.sock
 port=3306
 basedir=/usr

+ 1 - 1
install/rpm/mysql/my-medium.cnf

@@ -7,7 +7,7 @@ socket=/var/lib/mysql/mysql.sock
 
 [mysqld]
 user=mysql
-#pid-file=/var/run/mysqld/mysqld.pid
+#pid-file=/run/mysqld/mysqld.pid
 socket=/var/lib/mysql/mysql.sock
 port=3306
 basedir=/usr

+ 1 - 1
install/rpm/mysql/my-small.cnf

@@ -7,7 +7,7 @@ socket=/var/lib/mysql/mysql.sock
 
 [mysqld]
 user=mysql
-#pid-file=/var/run/mysqld/mysqld.pid
+#pid-file=/run/mysqld/mysqld.pid
 socket=/var/lib/mysql/mysql.sock
 port=3306
 basedir=/usr

+ 1 - 1
install/rpm/nginx/nginx.conf

@@ -3,7 +3,7 @@ user                 apache;
 worker_processes     auto;
 worker_rlimit_nofile 65535;
 error_log            /var/log/nginx/error.log;
-pid                  /var/run/nginx.pid;
+pid                  /run/nginx.pid;
 
 # Worker config
 events {

+ 1 - 1
install/rpm/php-fpm/multiphp.tpl

@@ -1,7 +1,7 @@
 ; origin-src: rhel/php-fpm/multiphp.tpl
 
 [%domain%]
-listen = /var/run/php/php%backend_version%-fpm-%domain%.sock
+listen = /run/php/php%backend_version%-fpm-%domain%.sock
 listen.owner = %user%
 listen.group = apache
 listen.mode = 0660

+ 1 - 1
install/rpm/pma/apache.conf

@@ -26,7 +26,7 @@ Alias /%pma_alias% /usr/share/phpmyadmin
 	</IfDefine>
     <IfDefine !PHP_ENABLED>
         <FilesMatch \.php$>
-            SetHandler "proxy:unix:/var/run/hestia-php.sock|fcgi://localhost"
+            SetHandler "proxy:unix:/run/hestia-php.sock|fcgi://localhost"
         </FilesMatch>
     </IfDefine>
 

+ 1 - 1
install/rpm/templates/web/php-fpm/default.tpl

@@ -1,7 +1,7 @@
 ; origin-src: rhel/templates/web/php-fpm/default.tpl
 
 [%backend%]
-listen = /var/run/php/php%backend_version%-fpm-%domain%.sock
+listen = /run/php/php%backend_version%-fpm-%domain%.sock
 listen.owner = %user%
 listen.group = apache
 listen.mode = 0660

+ 1 - 1
install/rpm/templates/web/php-fpm/no-php.tpl

@@ -1,7 +1,7 @@
 ; origin-src: rhel/templates/web/php-fpm/no-php.tpl
 
 ;[%backend%]
-;listen = /var/run/php/%backend%.sock
+;listen = /run/php/%backend%.sock
 ;listen.owner = %user%
 ;listen.group = apache
 ;listen.mode = 0660

+ 1 - 1
install/rpm/templates/web/php-fpm/socket.tpl

@@ -1,7 +1,7 @@
 ; origin-src: rhel/templates/web/php-fpm/socket.tpl
 
 [%backend%]
-listen = /var/run/php/%backend%.sock
+listen = /run/php/%backend%.sock
 listen.owner = %user%
 listen.group = apache
 listen.mode = 0660

+ 1 - 1
install/upgrade/manual/install_sieve.sh

@@ -96,7 +96,7 @@ else
 		#  10-master.conf
 		sed -i -E -z "s/  \}\n  unix_listener auth-master \{\n    group = mail\n    mode = 0660\n    user = dovecot\n  \}\n  user = dovecot\n\}/  \}\n  user = dovecot\n\}/g" /etc/dovecot/conf.d/10-master.conf
 		#  15-lda.conf
-		sed -i -E -z "s/mail_plugins = \\\$mail_plugins sieve\n  auth_socket_path = \/var\/run\/dovecot\/auth-master/\#mail_plugins = \$mail_plugins/g" /etc/dovecot/conf.d/15-lda.conf
+		sed -i -E -z "s/mail_plugins = \\\$mail_plugins sieve\n  auth_socket_path = \/run\/dovecot\/auth-master/\#mail_plugins = \$mail_plugins/g" /etc/dovecot/conf.d/15-lda.conf
 		#  20-imap.conf
 		sed -i "s/mail_plugins = quota imap_quota imap_sieve/mail_plugins = quota imap_quota/g" /etc/dovecot/conf.d/20-imap.conf
 

+ 21 - 3
install/upgrade/versions/1.7.0.sh

@@ -17,9 +17,9 @@
 ####### You can use \n within the string to create new lines.                   #######
 #######################################################################################
 
-upgrade_config_set_value 'UPGRADE_UPDATE_WEB_TEMPLATES' 'false'
-upgrade_config_set_value 'UPGRADE_UPDATE_DNS_TEMPLATES' 'false'
-upgrade_config_set_value 'UPGRADE_UPDATE_MAIL_TEMPLATES' 'false'
+upgrade_config_set_value 'UPGRADE_UPDATE_WEB_TEMPLATES' 'true'
+upgrade_config_set_value 'UPGRADE_UPDATE_DNS_TEMPLATES' 'true'
+upgrade_config_set_value 'UPGRADE_UPDATE_MAIL_TEMPLATES' 'true'
 upgrade_config_set_value 'UPGRADE_REBUILD_USERS' 'true'
 upgrade_config_set_value 'UPGRADE_UPDATE_FILEMANAGER_CONFIG' 'false'
 
@@ -48,3 +48,21 @@ if [ -z "$(grep -e 'condition =  ${lookup{$local_part@$domain}lsearch{/etc/exim4
 		fi
 	done
 fi
+
+# rename /var/run/xx to /run/
+for file in /etc/dovecot/dovecot.conf /etc/clamav/clamd.conf /etc/exim/exim.conf.template /etc/logrotate.d/apache2 /etc/logrotate.d/nginx /etc/mysql/my.cnf /etc/nginx/nginx.conf; do
+	if [ -f "$file" ]; then
+		echo "[ * ] Update $file legacy /var/run/ to /run/"
+		sed -i 's|/var/run/|/run/|g' $file
+	fi
+done
+# Update any custom php templates
+for file in $HESTIA/data/templates/web/php-fpm/*; do
+	echo "[ * ] Update $file legacy /var/run/ to /run/"
+	sed -i 's|/var/run/|/run/|g' $file
+done
+
+for file in /etc/php/*/fpm/pool.d/www.conf; do
+	echo "[ * ] Update $file legacy /var/run/ to /run/"
+	sed -i 's|/var/run/|/run/|g' $file
+done

+ 2 - 2
src/deb/nginx/hestia

@@ -16,12 +16,12 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 NGINX_DAEMON=/usr/local/hestia/nginx/sbin/hestia-nginx
 NGINX_NAME=hestia-nginx
 NGINX_DESC=hestia-nginx
-NGINX_PID=/var/run/hestia-nginx.pid
+NGINX_PID=/run/hestia-nginx.pid
 
 PHP_DAEMON=/usr/local/hestia/php/sbin/hestia-php
 PHP_NAME=hestia-php
 PHP_DESC=hestia-php
-PHP_PID=/var/run/hestia-php.pid
+PHP_PID=/run/hestia-php.pid
 PHP_CONF=/usr/local/hestia/php/etc/php-fpm.conf
 
 set -e

+ 3 - 3
src/deb/nginx/nginx.conf

@@ -3,7 +3,7 @@ user                 admin;
 worker_processes     1;
 worker_rlimit_nofile 65535;
 error_log            /var/log/hestia/nginx-error.log;
-pid                  /var/run/hestia-nginx.pid;
+pid                  /run/hestia-nginx.pid;
 
 # Worker config
 events {
@@ -130,7 +130,7 @@ http {
 
 			location ~ /([^/]+\.php)$ {
 				try_files     /$1 =404;
-				fastcgi_pass  unix:/var/run/hestia-php.sock;
+				fastcgi_pass  unix:/run/hestia-php.sock;
 				fastcgi_index index.php;
 				include       fastcgi_params;
 				fastcgi_param SCRIPT_FILENAME /usr/local/hestia/web/fm/dist/index.php;
@@ -141,7 +141,7 @@ http {
 			include                  /usr/local/hestia/nginx/conf/fastcgi_params;
 			fastcgi_param            SCRIPT_FILENAME /usr/local/hestia/web/$fastcgi_script_name;
 			fastcgi_param            QUERY_STRING $query_string;
-			fastcgi_pass             unix:/var/run/hestia-php.sock;
+			fastcgi_pass             unix:/run/hestia-php.sock;
 			fastcgi_intercept_errors on;
 			break                    ;
 		}

+ 2 - 2
src/deb/php/php-fpm.conf

@@ -1,5 +1,5 @@
 [global]
-pid = /var/run/hestia-php.pid
+pid = /run/hestia-php.pid
 daemonize = yes
 log_level = error
 emergency_restart_threshold = 10
@@ -8,7 +8,7 @@ process_control_timeout = 10s
 events.mechanism = epoll
 
 [www]
-listen = /var/run/hestia-php.sock
+listen = /run/hestia-php.sock
 
 user = admin
 group = admin

+ 3 - 3
src/rpm/nginx/hestia-nginx.service

@@ -6,10 +6,10 @@ After=hestia-php.service
 
 [Service]
 Type=forking
-PIDFile=/var/run/hestia-nginx.pid
+PIDFile=/run/hestia-nginx.pid
 ExecStart=/usr/local/hestia/nginx/sbin/nginx -c /usr/local/hestia/nginx/conf/nginx.conf
-ExecReload=/bin/sh -c "/bin/kill -s HUP $(/bin/cat /var/run/hestia-nginx.pid)"
-ExecStop=/bin/sh -c "/bin/kill -s TERM $(/bin/cat /var/run/hestia-nginx.pid)"
+ExecReload=/bin/sh -c "/bin/kill -s HUP $(/bin/cat /run/hestia-nginx.pid)"
+ExecStop=/bin/sh -c "/bin/kill -s TERM $(/bin/cat /run/hestia-nginx.pid)"
 
 [Install]
 WantedBy=hestia.service

+ 2 - 2
src/rpm/nginx/nginx.conf

@@ -3,7 +3,7 @@ user                 admin;
 worker_processes     1;
 worker_rlimit_nofile 65535;
 error_log            /usr/local/hestia/log/nginx-error.log;
-pid                  /var/run/hestia-nginx.pid;
+pid                  /run/hestia-nginx.pid;
 
 # Worker config
 events {
@@ -132,7 +132,7 @@ http {
 			include                  /usr/local/hestia/nginx/conf/fastcgi_params;
 			fastcgi_param            SCRIPT_FILENAME /usr/local/hestia/web/$fastcgi_script_name;
 			fastcgi_param            QUERY_STRING $query_string;
-			fastcgi_pass             unix:/var/run/hestia-php.sock;
+			fastcgi_pass             unix:/run/hestia-php.sock;
 			fastcgi_intercept_errors on;
 			break                    ;
 		}

+ 3 - 3
src/rpm/php/hestia-php.service

@@ -5,10 +5,10 @@ PartOf=hestia.service
 
 [Service]
 Type=forking
-PIDFile=/var/run/hestia-php.pid
+PIDFile=/run/hestia-php.pid
 ExecStart=/usr/local/hestia/php/sbin/hestia-php --fpm-config /usr/local/hestia/php/etc/php-fpm.conf
-ExecReload=/bin/sh -c "/bin/kill -s HUP $(/bin/cat /var/run/hestia-php.pid)"
-ExecStop=/usr/bin/php -r '$pid=(int)file_get_contents("/var/run/hestia-php.pid");posix_kill($pid,SIGTERM);while(posix_kill($pid,0)){sleep(0);}'
+ExecReload=/bin/sh -c "/bin/kill -s HUP $(/bin/cat /run/hestia-php.pid)"
+ExecStop=/usr/bin/php -r '$pid=(int)file_get_contents("/run/hestia-php.pid");posix_kill($pid,SIGTERM);while(posix_kill($pid,0)){sleep(0);}'
 ExecStartPre=/bin/bash -c "/bin/systemctl set-environment HOSTNAME=$(/usr/bin/hostname)"
 Environment="HESTIA=/usr/local/hestia"
 

+ 1 - 1
src/rpm/php/hestia-php.spec

@@ -39,7 +39,7 @@ mkdir -p %{buildroot}%{_unitdir}
 %defattr(-,root,root)
 %attr(755,root,root) /usr/local/hestia/php
 %attr(775,admin,admin) /usr/local/hestia/php/var/log
-%attr(775,admin,admin) /usr/local/hestia/php/var/run
+%attr(775,admin,admin) /usr/local/hestia/php/run
 %config(noreplace) /usr/local/hestia/php/etc/php-fpm.conf
 %config(noreplace) /usr/local/hestia/php/lib/php.ini
 %{_unitdir}/hestia-php.service

+ 2 - 2
src/rpm/php/php-fpm.conf

@@ -1,5 +1,5 @@
 [global]
-pid = /var/run/hestia-php.pid
+pid = /run/hestia-php.pid
 daemonize = yes
 log_level = error
 emergency_restart_threshold = 10
@@ -8,7 +8,7 @@ process_control_timeout = 10s
 events.mechanism = epoll
 
 [www]
-listen = /var/run/hestia-php.sock
+listen = /run/hestia-php.sock
 
 user = admin
 group = admin

+ 1 - 1
test/test.bats

@@ -1194,7 +1194,7 @@ function check_ip_not_banned(){
 }
 
 @test "DNS: Add domain record" {
-    run v-add-dns-record $user $domain test A 198.18.0.125 20
+    run v-add-dns-record $user $domain test A 198.18.0.125 '' 20
     assert_success
     refute_output
 }