File better_socket_path_v2.patch of Package gitaly

Index: gitaly-v18.3.0/internal/gitaly/config/config.go
===================================================================
--- gitaly-v18.3.0.orig/internal/gitaly/config/config.go
+++ gitaly-v18.3.0/internal/gitaly/config/config.go
@@ -1085,7 +1085,7 @@ func (cfg *Cfg) Storage(storageName stri
 
 // InternalSocketDir returns the location of the internal socket directory.
 func (cfg *Cfg) InternalSocketDir() string {
-	return filepath.Join(cfg.RuntimeDir, "sock.d")
+	return "/srv/www/vhosts/gitlab-ce/tmp/sockets/private/internal/"
 }
 
 // InternalSocketPath is the path to the internal Gitaly socket.
@@ -1246,11 +1246,12 @@ func SetupRuntimeDirectory(cfg Cfg, proc
 		// as the runtime directory. This may not always be an ideal choice given that
 		// it's typically created at `/tmp`, which may get periodically pruned if `noatime`
 		// is set.
-		var err error
-		runtimeDir, err = os.MkdirTemp("", "gitaly-")
-		if err != nil {
-			return Cfg{}, fmt.Errorf("creating temporary runtime directory: %w", err)
-		}
+		// var err error
+		// runtimeDir, err = os.MkdirTemp("", "gitaly-")
+		// if err != nil {
+		//	return Cfg{}, fmt.Errorf("creating temporary runtime directory: %w", err)
+		// }
+		runtimeDir = "/var/lib/gitaly/"
 	} else {
 		// Otherwise, we use the configured runtime directory. Note that we don't use the
 		// runtime directory directly, but instead create a subdirectory within it which is
@@ -1294,9 +1295,9 @@ func SetupRuntimeDirectory(cfg Cfg, proc
 	// socket paths. We hope/expect that os.MkdirTemp creates a directory
 	// that is not too deep. We need a directory, not a tempfile, because we
 	// will later want to set its permissions to 0700
-	if err := os.Mkdir(cfg.InternalSocketDir(), mode.Directory); err != nil {
-		return Cfg{}, fmt.Errorf("create internal socket directory: %w", err)
-	}
+	// if err := os.Mkdir(cfg.InternalSocketDir(), mode.Directory); err != nil {
+	//	return Cfg{}, fmt.Errorf("create internal socket directory: %w", err)
+	//}
 
 	if err := trySocketCreation(cfg.InternalSocketDir()); err != nil {
 		return Cfg{}, fmt.Errorf("failed creating internal test socket: %w", err)
openSUSE Build Service is sponsored by