File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,15 @@ function insert($event_name, $data) {
7373
7474 $ this ->update_config ();
7575
76- exec ("nohup /usr/lib/mailman/bin/newlist -u " .escapeshellcmd ($ data ["new " ]["domain " ])." -e " .escapeshellcmd ($ data ["new " ]["domain " ])." " .escapeshellcmd ($ data ["new " ]["listname " ])." " .escapeshellcmd ($ data ["new " ]["email " ])." " .escapeshellcmd ($ data ["new " ]["password " ])." >/dev/null 2>&1 & " );
76+ $ pid = exec ("nohup /usr/lib/mailman/bin/newlist -u " .escapeshellcmd ($ data ["new " ]["domain " ])." -e " .escapeshellcmd ($ data ["new " ]["domain " ])." " .escapeshellcmd ($ data ["new " ]["listname " ])." " .escapeshellcmd ($ data ["new " ]["email " ])." " .escapeshellcmd ($ data ["new " ]["password " ])." >/dev/null 2>&1 & echo $!; " );
77+ // wait for /usr/lib/mailman/bin/newlist-call
78+ $ running = true ;
79+ do {
80+ exec ('ps -p ' .intval ($ pid ), $ out );
81+ if (count ($ out ) ==1 ) $ running =false ; else sleep (1 );
82+ unset($ out );
83+ } while ($ running );
84+ unset($ out );
7785 if (is_file ('/var/lib/mailman/data/virtual-mailman ' )) exec ('postmap /var/lib/mailman/data/virtual-mailman ' );
7886 if (is_file ('/var/lib/mailman/data/transport-mailman ' )) exec ('postmap /var/lib/mailman/data/transport-mailman ' );
7987 exec ('nohup ' .$ conf ['init_scripts ' ] . '/ ' . 'mailman reload >/dev/null 2>&1 & ' );
You can’t perform that action at this time.
0 commit comments