I have a script that must remain in php and run as a service and another script that must remain in python and run as a service. I need the first script to send data to the second script.
I have achieved this by echoing the data out of the first script so it gets sent to stdout and using a pipe to send it to the second script that listens to stdin and responds to the data as it receives it.
This works great when I call the scripts from the shell as:
Code:
script1.php | script2.py
This does not work when the aforementioned code is run as a service by systemd because systemd sends stdout to journald and there seems to be no way around that.
I have also tried to send the data from script1 to a named pipe where script2 reads from the same named pipe.
Again, works great until I try to daemonize the process.
Distro is Arch and this also cannot be changed.
Any help is appreciated.