[Devel] Contribution to OpenSER
Daniel-Constantin Mierla
daniel at voice-system.ro
Wed Mar 28 11:41:21 CEST 2007
Hello,
On 03/27/07 19:33, Anatoly Pidruchny wrote:
> Dear OpenSER developers,
>
> we would like to contribute some changes to OpenSER that should be
> useful to all of the OpenSER community.
>
> The first small but useful change that we want is the ability to run
> OpenSER in "no-daemon" mode. We need to do this to run OpenSER under
> daemontools. There is a -D option already that means "Do not fork into
> daemon mode". But the problem with this option is that it really means
> more then just "Do not fork into daemon mode". It really means do not
> fork at all, i.e. do not create any child OpenSER processes. The patch
> below adds a variable no_daemon in main.c, makes -D option only change
> the no_daemon variable and makes the variable no_daemon only control
> whether OpenSER daemonizes itself or not. Yes, this patch means that
> -D option will no longer change the value of dont_fork variable. Well,
> we think a new option has to be added that will turn on the dont_fork
> variable. This patch does not add such a new option.
>
> Please let me know what should I do contribute this patch.
please register the patch to the tracker on sourceforge page. In this
way won't get lost inside mailing lists and someone will review and
incorporate it.
http://sourceforge.net/tracker/?atid=743022&group_id=139143&func=browse
Cheers,
Daniel
> I can also add an additional option to control the dont_fork variable,
> if you suggest so. Below is the proposed patch.
>
>
> *** main.c.old Tue Mar 27 11:52:28 2007
> --- main.c.new Tue Mar 27 11:54:56 2007
> ***************
> *** 227,232 ****
> --- 227,233 ----
> int sig_flag = 0; /* last signal received */
> int debug = L_NOTICE;
> int dont_fork = 0;
> + int no_daemon = 0;
> int log_stderr = 0;
> /* log facility (see syslog(3)) */
> int log_facility = LOG_DAEMON;
> ***************
> *** 1070,1076 ****
> debug++;
> break;
> case 'D':
> ! dont_fork=1;
> break;
> case 'E':
> log_stderr=1;
> --- 1071,1077 ----
> debug++;
> break;
> case 'D':
> ! no_daemon=1;
> break;
> case 'E':
> log_stderr=1;
> ***************
> *** 1327,1333 ****
> #endif /* USE_TLS */
> #endif /* USE_TCP */
> /* init_daemon? */
> ! if (!dont_fork){
> if ( daemonize((log_name==0)?argv[0]:log_name) <0 )
> goto error;
> }
> if (install_sigs() != 0){
> --- 1328,1334 ----
> #endif /* USE_TLS */
> #endif /* USE_TCP */
> /* init_daemon? */
> ! if (!no_daemon){
> if ( daemonize((log_name==0)?argv[0]:log_name) <0 )
> goto error;
> }
> if (install_sigs() != 0){
>
>
>
> Best regards,
>
> Anatoly Pidruchny.
> NewCross Technologies.
>
>
> _______________________________________________
> Devel mailing list
> Devel at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/devel
>
More information about the Devel
mailing list