if (!(strcasecmp(argv[1],"fork")))
{
pid_t pid;
+ FILE *pidfile;
/* do daemon fork */
pid = fork();
exit(0);
}
nooutput = 1;
+
+ /* write pid file */
+ pidfile = fopen("/var/run/lcr.pid","w");
+ if (pidfile)
+ {
+ fprintf(pidfile, "%d\n", getpid());
+ fclose(pidfile);
+ }
} else
/* if not start */
if (!!strcasecmp(argv[1],"start"))