分类: LINUX
2008-08-20 18:19:38
voidrecordTime() { constcharpa[256]="//home//projects//testService//recordTime"; ofstreamfout; fout.open(pa,ios::app); time_tcurrTime; structtm*tp; charbuf[256]; while(1) { currTime=time(NULL); tp=localtime(&currTime); strftime(buf,256,"%B%e,%Y,%H:%M:%S",tp); fout<<"currenttimeis"<
start() { echo"starttestService" /home/projects/testService/testService& exit0; } stop() { echo-n"stoptestService" ifpkilltestService then echo"[ok]" else echo"[failed]" fi } case"$1"in start) start ;; stop) stop ;; restart) stop start ;; *) echo"usage:$0start|stop|restart" exit0; esac