File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,12 @@ export async function testConfig() {
1616}
1717
1818export async function reload ( ) {
19- await execFile ( '/usr/sbin/nginx' , [ '-s' , 'reload' ] ) ;
19+ const { stdout } = await execFile ( 'sh' , [ '-c' ,
20+ "for f in /proc/[0-9]*/cmdline; do grep -qa 'nginx: master' \"$f\" && basename \"${f%/cmdline}\" && break; done" ,
21+ ] ) ;
22+ const pid = stdout . trim ( ) ;
23+ if ( ! pid ) throw new Error ( 'nginx master process introuvable' ) ;
24+ await execFile ( 'kill' , [ '-HUP' , pid ] ) ;
2025}
2126
2227export async function readConfig ( ) {
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ services:
1515 - /etc/nginx/sites-available:/etc/nginx/sites-available
1616 - /etc/nginx/sites-enabled:/etc/nginx/sites-enabled
1717 - /usr/sbin/nginx:/usr/sbin/nginx:ro
18- - /run:/run:ro
1918 env_file :
2019 - path : ../.env
2120 required : false
You can’t perform that action at this time.
0 commit comments