CRAB REST cannot write logs to named pipe with PR #11431
**Impact of the bug**
CRAB REST

**Describe the bug**
CRAB REST cannot write logs to named pipe with Valentin PR [dmwm/WMCore#11431](https://github.com/dmwm/WMCore/pull/11431).

Last week, I opened PR [dmwm/WMCore#11455](https://github.com/dmwm/WMCore/pull/11455), and we agreed to merge [dmwm/WMCore#11431](https://github.com/dmwm/WMCore/pull/11431).
But, when I tested it again after PR merged, I found that I ran the wrong script that did write logs to file instead of named pipe. When I switched to named pipe this time, I got `UnsupportedOperation: File or stream is not seekable` error.

CRAB REST want to write to named pipe in order to stream logs to the container stdout using our [solution here](https://github.com/dmwm/CRABServer/issues/7463#issuecomment-1344306384).

**How to reproduce it**
1. Make named pipe with `mkfifo /crabserver-fifo`.
2. Run `cat crabserver-fifo` to start reading data (named pipe need to read before CRAB's process can write).
3. In another terminal, start python and try to open file with `a+` mode. You will see this error:
```
>>> open('/crabserver-fifo', 'a+')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
io.UnsupportedOperation: File or stream is not seekable.
```

**Expected behavior**
[WMCore/REST/Main.py#L406](https://github.com/dmwm/WMCore/blob/81c7d43e71283b9fca163895d295975dc8655c89/src/python/WMCore/REST/Main.py#L406) should open named pipe without error.

**Additional context and error message**
Changing the open file mode to `a` is enough to fix this.

Mode `a` works for writing logs to both file and named pipe because logs operation (at least for StreamHandler, default of CherryPy's WMCore) is write-only operation.

Sorry for my mistake in my last PR.
diff --git a/src/python/WMCore/REST/Main.py b/src/python/WMCore/REST/Main.py
index b8427080d..6cc9a628c 100644
--- a/src/python/WMCore/REST/Main.py
+++ b/src/python/WMCore/REST/Main.py
@@ -403,7 +403,9 @@ class RESTDaemon(RESTMain):
                                 bufsize=0, close_fds=True, shell=False)
                 logger = subproc.stdin
             elif isinstance(self.logfile, str):
-                logger = open(self.logfile, "a+")
+                # if a unix pipe is set as the logfile, it must be opened to append to the end of the file
+                # if file/pipe does not exist, create it
+                logger = open(self.logfile, "a")
             else:
                 raise TypeError("'logfile' must be a string or array")
             os.dup2(logger.fileno(), sys.stdout.fileno())
['src/python/WMCore/REST/Main.py']