C++学习笔记————守护进程
工作中要在Linux下部署一个代理服务,需要使其在后台运行并且防止僵尸进程,因此需要守护进程Daemon。
守护进程详细流程:
https://blog.csdn.net/lianghe_work/article/details/47659889
Daemon代码:
#include <unistd.h>
#include <signal.h>
#include <fcntl.h>
#include <sys/syslog.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int init_daemon(void)
{<