Linux?????????????
???????????? ???????[ 2015/6/5 11:25:46 ] ??????????????
???????? ??????????
???????????????????????????????test.c??????????init.c??????????????????/tmp??????е????test.log?????????????????????е?init_daemon???????????????????????????????init_daemon?????????????????????
????1?? init.c?嵥
#include < unistd.h >
#include < signal.h >
#include < sys/param.h >
#include < sys/types.h >
#include < sys/stat.h >
void init_daemon(void)
{
int pid;
int i;
if(pid=fork())
exit(0);//??????????????????
else if(pid< 0)
exit(1);//fork???????
//????????????????????
setsid();//???????????μ???鳤??????鳤
//?????????????
if(pid=fork())
exit(0);//??????????????????????
else if(pid< 0)
exit(1);//fork???????
//??????????????
//???????????????鳤
for(i=0;i< NOFILE;++i)//???????????д??????
close(i);
chdir("/tmp");//??乤??????е?/tmp
umask(0);//??????????????
return;
}
????2?? test.c?嵥
#include < stdio.h >
#include < time.h >
void init_daemon(void);//???????????????
main()
{
FILE *fp;
time_t t;
init_daemon();//??????Daemon
while(1)//??????????test.log?????????
{
sleep(60);//????????
if((fp=fopen("test.log"??"a")) >=0)
{
t=time(0);
fprintf(fp??"Im here at %s/n"??asctime(localtime(&t)) );
fclose(fp);
}
}
}
?????????????RedHat Linux6.0?±???????????????????£?
????????gcc -g -o test init.c test.c
??????У?./test
???????????ps -ef
????????????????test???????????????????????????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
Linux??????DDR????????????Linux?????????????????豸??????????linux???в???????????м??????????????????????????Linux????Linux??DNS????????????γ???????????Linux?????????????Linux????(???)????????Linux ????????????????????????????????Windows???У?Linux???????Linux????????????????Linux iommu??vfio???????Linux????ε???TCP???????Linux?????????????СLinux?·???????????Linux???Jexus?й?Asp.Net Core??ó???Linux?????????Щ??
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????