I'm running the official Docker container of Seafile and every week or so, Nginx fails to restart and I need to manually restart the container.
Manually restarting the container fixes it. Maybe the script needs to catch the error and keep trying?
I see the following errors in my log:
*** Shutting down runit daemon (PID 24)...
*** Running /etc/my_init.post_shutdown.d/10_syslog-ng.shutdown...
*** Init system aborted.
*** Killing all processes...
*** Running /etc/my_init.d/01_create_data_links.sh...
*** Booting runit daemon...
*** Runit started as PID 24
*** Running /scripts/enterpoint.sh...
2022-08-22 04:08:56 Nginx ready
2022-08-22 04:08:56 This is an idle script (infinite loop) to keep container running.
nginx: [error] open() "/run/nginx.pid" failed (2: No such file or directory)
Traceback (most recent call last):
File "/scripts/start.py", line 86, in <module>
main()
File "/scripts/start.py", line 53, in main
call('nginx -s reload')
File "/scripts/utils.py", line 70, in call
return subprocess.check_call(*a, **kw)
File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'nginx -s reload' returned non-zero exit status 1.
*** Shutting down /scripts/enterpoint.sh (PID 25)...
*** Shutting down runit daemon (PID 24)...
*** Running /etc/my_init.post_shutdown.d/10_syslog-ng.shutdown...
*** Init system aborted.
*** Killing all processes...
*** Running /etc/my_init.d/01_create_data_links.sh...
*** Booting runit daemon...
*** Runit started as PID 24
*** Running /scripts/enterpoint.sh...
2022-08-25 10:55:58 Nginx ready
2022-08-25 10:55:58 This is an idle script (infinite loop) to keep container running.
nginx: [error] open() "/run/nginx.pid" failed (2: No such file or directory)
Traceback (most recent call last):
File "/scripts/start.py", line 86, in <module>
main()
File "/scripts/start.py", line 53, in main
call('nginx -s reload')
File "/scripts/utils.py", line 70, in call
return subprocess.check_call(*a, **kw)
File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'nginx -s reload' returned non-zero exit status 1.
*** Shutting down /scripts/enterpoint.sh (PID 25)...
*** Shutting down runit daemon (PID 24)...
*** Running /etc/my_init.post_shutdown.d/10_syslog-ng.shutdown...
*** Init system aborted.
*** Killing all processes...
*** Running /etc/my_init.d/01_create_data_links.sh...
*** Booting runit daemon...
*** Runit started as PID 24
*** Running /scripts/enterpoint.sh...
2022-08-25 10:56:22 Nginx ready
2022-08-25 10:56:22 This is an idle script (infinite loop) to keep container running.
I'm running the official Docker container of Seafile and every week or so, Nginx fails to restart and I need to manually restart the container.
Manually restarting the container fixes it. Maybe the script needs to catch the error and keep trying?
I see the following errors in my log: