コード例 #1
0
void
kill_ssl_slave(void)
{
    if (ssl_slave_pid > 0) {
        WAIT_TYPE my_stat;

        do_rawlog(LT_ERR, "Terminating ssl_slave pid %d", ssl_slave_pid);

        block_a_signal(SIGCHLD);
        kill(ssl_slave_pid, SIGTERM);
        mush_wait(ssl_slave_pid, &my_stat, 0);
        unblock_a_signal(SIGCHLD);
        close(ssl_slave_ctl_fd);
        ssl_slave_pid = -1;
        ssl_slave_state = SSL_SLAVE_DOWN;
    }
}
コード例 #2
0
/** Kill the info_slave process, typically at shutdown.
 */
void
kill_info_slave(void)
{
  WAIT_TYPE my_stat;

  if (info_slave_state != INFO_SLAVE_DOWN) {
    if (info_slave_pid > 0) {
      do_rawlog(LT_ERR, "Terminating info_slave pid %d", info_slave_pid);

      block_a_signal(SIGCHLD);
      closesocket(info_slave);
      kill(info_slave_pid, SIGTERM);
      mush_wait(info_slave_pid, &my_stat, 0);
      info_slave_pid = -1;
      unblock_a_signal(SIGCHLD);
    }
    info_slave_state = INFO_SLAVE_DOWN;
  }
}
コード例 #3
0
ファイル: info_master.c プロジェクト: tkrajcar/pypenn
/** Kill the info_slave process, typically at shutdown.
 */
void
kill_info_slave(void)
{
  WAIT_TYPE my_stat;

  if (info_slave_state != INFO_SLAVE_DOWN) {
    if (info_slave_pid > 0) {
      do_rawlog(LT_ERR, "Terminating info_slave pid %d", info_slave_pid);

      block_a_signal(SIGCHLD);

      closesocket(info_slave);
      kill(info_slave_pid, 15);
      /* Have to wait long enough for the info_slave to actually
         die. This will hopefully be enough time. */
      usleep(100);

      mush_wait(info_slave_pid, &my_stat, WNOHANG);
      info_slave_pid = -1;
      unblock_a_signal(SIGCHLD);
    }
    info_slave_state = INFO_SLAVE_DOWN;
  }
}