Closed kiklop74 closed 3 years ago
Ok, just figured it out. It seems we need to wait a bit before terminating the shell that connected to the TS server.
This makes it work:
shell_exec('TS_SOCKET=/run/task-spooler/tsp.sock /usr/bin/tsp '/path/to/my/script.sh' 2>&1 && /usr/bin/sleep 1s');
Nice. My two cent guess is that the shell is closed before some communication channel is closed properly that leads to the Broken pipe
error. Thanks for sharing your solution!
Hello,
I am trying to utilize ts as a cpu task queue. Currently using ts 1.0 (since that is being distributed with Ubuntu). I have some code in PHP that periodically submits shell script to be executed as task in ts. The task does get submitted but process is immediately finished and stuff is written to socket error file.
PHP code example does this:
Task does get added, it is listed but always shows result -1 and socket error lists stuff like this:
Do you have any hint or suggestion here of what am I doing wrong here?