Bisa / factorio-init

Factorio init script
MIT License
414 stars 82 forks source link

Runaway cat on factorio stop #199

Closed tmzasz closed 1 year ago

tmzasz commented 1 year ago

Re creation of #185 as my repo was messy as all crap sorry.

Once you run the command factorio stop the tail -f that is attached to the server.fifo becomes a idle runaway cat attempting to read the fifo while the server is offline. This is not desirable behavior as this cat is doing nothing just reading a pipe that has stalled. as of the current commit when this issue was opened the offending line of code seems to be this line on 362 in the factorio script cat "${FIFO}" &. Removing or commenting out this line seems to prevent the rouge cat from forming on server shutdown.

here is a short video demonstrating said behaivor https://i.gyazo.com/e95fd6690cd04011acc9930eb38e6870.mp4

Os of the machine CentOS Linux release 7.9.2009 (Core) using kernel 4.9.178 with alt glibc root 2.18

tmzasz commented 1 year ago

Upon looking at the issue a bit more in depth i have to wonder what 362 is actually doing in the first place https://github.com/Bisa/factorio-init/blob/8e252753931b2ee9cc96239f6cca9f6f4f96eb60/factorio#L361-L368 as it seems to be not needed as the tail closes successfully on its own due to 364-368 and earlier on in start_service the fifo is recreated anyways https://github.com/Bisa/factorio-init/blob/8e252753931b2ee9cc96239f6cca9f6f4f96eb60/factorio#L300-L306