Closed Praneet9 closed 4 years ago
Test results:
I first ran the setup for PR #179, so I had already executed nginx_setup.sh
. This time I ran it again from this branch; I got an error ln: failed to create symbolic link '/var/log/nginx/tmp': File exists
, but the script seemed to complete successfully. It might be worth adding error handling for that case.
After restarting, I ended up in an infinite loop where the Chromium kiosk browser starts and then closes itself as soon as the default frontend page loads. I'm not sure why this is happening, but it needs to be fixed.
If I just manually start a regular Chromium browser and go to a page like localhost/dashboard
, I can successfully reload that page instead of getting a 404. So I think this PR is fine to merge in. Can you answer the following questions for records-keeping:
I have just tried to replicate this issue from a clean image (flashing your default image from Google Drive); here are my actions & results:
pufferfish.img
onto the SD card.setup.sh
and allowed it to restart the RPi.backend_service.sh
and kiosk.sh
and restarted the RPi. The kiosk browser launched fine. I then pressed "Ctrl+W" to close it, and then I restarted the RPi again. The kiosk browser still launched fine.usb_logging.sh
and restarted the RPi. The kiosk browser still launched fine. I then pressed "Ctrl+W" to close it, and then I restarted the RPi again. The kiosk browser still launched fine. After I pressed "Ctrl+W" again, eventually the kiosk browser would restart on its own.configure_kiosk.sh
and restarted the RPi. The kiosk browser still launched fine. I then pressed "Ctrl+W" to close it, and then I restarted the RPi again. The kiosk browser still launched fine. After I pressed "Ctrl+W" again, eventually the kiosk browser would restart on its own.nginx_setup.sh
and restarted the RPi. The kiosk browser entered the restart loop.nginx_setup.sh
and restarted the RPi. The kiosk browser then launched fine.This suggests that running nginx_setup.sh
from this PR, after I've already done the setup from PR #179, causes the problem somehow.
I was actually supposed to remove the line with symbolic link, as it is not required anymore. We are writing logs to a custom directory which is not read-only. This was done to fix the bug of writing logs in read-only mode. I'll remove this line in a new commit in #179
I tried to reproduce the problem and was successful in doing that.
Weirdly the looping stopped whenever I switched branch from #183 to #179
Turns out the problem was in the backend due to ModuleNotFoundError: No module named 'RPi'
error. This restarted the backend service and in turn, the kiosk service restarted as well as it requires backend service to be active.
I can confirm there's no problem with nginx_setup
in this branch.
Ok, so that's a separate issue; we can merge in this PR in the meantime. For records-keeping:
Added configuration to nginx configuration file for redirecting to localhost on 404 error code.