Allow nntp.disable semaphore to exit nntp process
This commit is contained in:
parent
9a77716efe
commit
5d97330e19
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
function interact($msgsock, $use_crypto=false)
|
||||
{
|
||||
global $CONFIG,$logdir,$logfile,$installed_path,$config_path,$groupconfig,$workpath,$path, $spooldir,$nntp_group,$nntp_article,$auth_ok,$user,$pass;
|
||||
global $CONFIG,$logdir,$logfile,$installed_path,$config_path,$config_dir,$groupconfig,$workpath,$path, $spooldir,$nntp_group,$nntp_article,$auth_ok,$user,$pass;
|
||||
|
||||
$workpath=$spooldir."/";
|
||||
$path=$workpath."articles/";
|
||||
|
@ -28,6 +28,11 @@
|
|||
$msg="";
|
||||
set_time_limit(30);
|
||||
$buf = fgets($msgsock, 2048);
|
||||
if(file_exists($config_dir."/nntp.disable")) {
|
||||
$parent_pid = file_get_contents(sys_get_temp_dir().'/rslight-nntp.lock', IGNORE_NEW_LINES);
|
||||
posix_kill($parent_pid, SIGTERM);
|
||||
exit;
|
||||
}
|
||||
if ($buf === false) {
|
||||
// file_put_contents($logfile, "\n".format_log_date()." socket read failed: reason: " . socket_strerror(socket_last_error($msgsock)), FILE_APPEND);
|
||||
break;
|
||||
|
|
BIN
latest.zip
BIN
latest.zip
Binary file not shown.
Loading…
Reference in New Issue