Go to file
2020-10-22 14:20:05 +08:00
daemon.conf LOFFILE -> LOGFILE 2020-10-22 14:20:05 +08:00
main.c LOFFILE -> LOGFILE 2020-10-22 14:20:05 +08:00
main.h Initial submission 2020-09-11 16:40:25 +08:00
Makefile Initial submission 2020-09-11 16:40:25 +08:00
popen.c Initial submission 2020-09-11 16:40:25 +08:00
README.md LOFFILE -> LOGFILE 2020-10-22 14:20:05 +08:00

Daemon

根据程序名称和时间为判断条件的进程守护程序.  
配置文件默认 daemon.conf  
global {
    PROCESS_NAME = "frpc";      //进程名称条件变量
    COMMAND = "ls -al";         //进程名称条件变量不成立执行的命令
    TIME = "10";                //时间条件变量, 单位秒
    LOGFILE = "log.txt";        //日志记录
}

Build

Linux编译:  
git clone https://github.com/niuyuling/daemon.git
git clone https://github.com/niuyuling/libconf.git
cd libconf
make clean; make
cd ../daemon
make clean; make

Help

#启动
./daemon
#关闭
killall daemon