If its a daemon it needs '-p' for pidfiles. These debian init scripts are atrocious and need to get updated with pidfiles ;) Below is a somewhat modified version of what I used in siproxd. Its not very complex, just make 'pidfile = optarg' at the 'p' option and put it in some header.
char *pidfile;
int createpidfile(char* pidfile)
{
FILE *f = NULL;
TRACE(TRACE_INFO,"creating PID file [%s]", pidfile);
if ((f=fopen(pidfile, "w")))
{
fprintf(f,"%i\n",(int)getpid());
fclose(f);
}
else
{
TRACE(TRACE_ERROR,"couldn't create new PID file: %s",
strerror(errno));
return(1);
}
return(0);
}
Dan
Aaron Stone wrote:
How about this set of command line options across the board...
Common options for all DBMail utilities:
-f file specify an alternative config file
-q quietly skip interactive prompts
-n show the intended action but do not perform it, no to all
-y perform all proposed actions, as though yes to all
-v verbose details
-V show the version
-h show this help message
One option that I'd like to have on the command line for the daemons is a
no-daemonize / no-fork option. This would be a great benefit for lots of
debugging and testing situations. Would overloading the meaning of '-n' work?
Thoughts, questions, comments?
Aaron
_______________________________________________
Dbmail-dev mailing list
[email protected]
http://twister.fastxs.net/mailman/listinfo/dbmail-dev
signature.asc
Description: OpenPGP digital signature
