Go to file
2021-12-11 13:20:06 +08:00
conf.c 支持多个进程的判断 2021-12-11 13:20:06 +08:00
conf.h 支持多个进程的判断 2021-12-11 13:20:06 +08:00
daemon.conf 支持多个进程的判断 2021-12-11 13:20:06 +08:00
main.c 支持多个进程的判断 2021-12-11 13:20:06 +08:00
main.h 支持多个进程的判断 2021-12-11 13:20:06 +08:00
Makefile 支持多个进程的判断 2021-12-11 13:20:06 +08:00
popen.c Initial submission 2020-09-11 16:40:25 +08:00
README.md 支持多个进程的判断 2021-12-11 13:20:06 +08:00

Daemon

Process daemon

build

git clone https://git.aixiao.me:443/aixiao/libconf.git
git clone https://git.aixiao.me:443/aixiao/daemon.git
cd libconf
make clean; make
cd ../daemon
make clean; make

HELP

root@NIUYULING:/mnt/c/Users/niuyuling/Desktop/conf# ./daemon -?
Process daemon
Author: AIXIAO@AIXIAO.ME
Usage: [-?h] [-c filename]

Options:
-c          : set configuration file, (default: daemon.conf)
-? -h       : help information

root@NIUYULING:/mnt/c/Users/niuyuling/Desktop/conf#


配置文件示列:
global {
    PROCESS="ls->ls -al";       // 要执行的命令和进程名, 依'->'为分界, '->'之前的字符为进程名字, '->'之后的字符串为要执行的命令.(PROCESS配置理论可以有无数个, 通过链表存储)
    PROCESS="id->id";           // 同上
    TIME = "10";                // 循环时间, 单位秒. 大于等于1
    LOGFILE = "log_daemon.txt"; // 日志文件
}