<p>N A has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18184">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">asterisk.c: Warn of incompatibilities with remote console.<br><br>Some command line options to Asterisk only apply when Asterisk<br>is started and cannot be used with remote console mode. If a<br>user tries to use any of these, they are currently simply<br>silently ignored.<br><br>This prints out a warning if incompatible options are used,<br>informing users that an option used cannot be used with remote<br>console mode. Additionally, some clarifications are added to<br>the help text and man page.<br><br>ASTERISK-22246<br><br>Change-Id: I980a5380ef2c19e8ea348596396d5382893c4337<br>---<br>M doc/asterisk.8<br>M main/asterisk.c<br>2 files changed, 52 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/84/18184/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/doc/asterisk.8 b/doc/asterisk.8</span><br><span>index e5991d9..b45ac88 100644</span><br><span>--- a/doc/asterisk.8</span><br><span>+++ b/doc/asterisk.8</span><br><span>@@ -195,7 +195,8 @@</span><br><span> .TP</span><br><span> \-T</span><br><span> Add timestamp to all non-command related output going to the console</span><br><span style="color: hsl(0, 100%, 40%);">-when running with verbose and/or logging to the console.</span><br><span style="color: hsl(120, 100%, 40%);">+when running with verbose and/or logging to the console. Can only be</span><br><span style="color: hsl(120, 100%, 40%);">+used at startup (e.g. not with remote console mode).</span><br><span> .TP</span><br><span> \-U \fIuser\fR</span><br><span> Run as user \fIuser\fR instead of the</span><br><span>diff --git a/main/asterisk.c b/main/asterisk.c</span><br><span>index de520a0..04e6fb3 100644</span><br><span>--- a/main/asterisk.c</span><br><span>+++ b/main/asterisk.c</span><br><span>@@ -3360,7 +3360,7 @@</span><br><span> printf(" -t Record soundfiles in /var/tmp and move them where they\n");</span><br><span> printf(" belong after they are done\n");</span><br><span> printf(" -T Display the time in [Mmm dd hh:mm:ss] format for each line\n");</span><br><span style="color: hsl(0, 100%, 40%);">- printf(" of output to the CLI\n");</span><br><span style="color: hsl(120, 100%, 40%);">+ printf(" of output to the CLI. Cannot be used with remote console mode.\n\n");</span><br><span> printf(" -v Increase verbosity (multiple v's = more verbose)\n");</span><br><span> printf(" -x <cmd> Execute command <cmd> (implies -r)\n");</span><br><span> printf(" -X Enable use of #exec in asterisk.conf\n");</span><br><span>@@ -3716,6 +3716,55 @@</span><br><span> }</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ if (ast_opt_remote) {</span><br><span style="color: hsl(120, 100%, 40%);">+ int didwarn = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ optind = 1;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Not all options can be used with remote console. Warn if they're used. */</span><br><span style="color: hsl(120, 100%, 40%);">+ while ((c = getopt(argc, argv, getopt_settings)) != -1) {</span><br><span style="color: hsl(120, 100%, 40%);">+ switch (c) {</span><br><span style="color: hsl(120, 100%, 40%);">+ /* okay to run with remote console */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 'B': /* force black background */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 'd': /* debug */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 'h': /* help */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 'I': /* obsolete timing option: warning already thrown if used */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 'L': /* max load */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 'M': /* max calls */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 'n': /* no color */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 'R': /* reconnect */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 'r': /* remote */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 's': /* set socket path */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 'V': /* version */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 'v': /* verbose */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 'W': /* white background */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 'x': /* remote execute */</span><br><span style="color: hsl(120, 100%, 40%);">+ case '?': /* ? */</span><br><span style="color: hsl(120, 100%, 40%);">+ break;</span><br><span style="color: hsl(120, 100%, 40%);">+ /* can only be run when Asterisk is starting */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 'X': /* enables #exec for asterisk.conf only. */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 'C': /* set config path */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 'c': /* foreground console */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 'e': /* minimum memory free */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 'F': /* always fork */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 'f': /* no fork */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 'G': /* run group */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 'g': /* dump core */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 'i': /* init keys */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 'm': /* mute */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 'p': /* high priority */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 'q': /* quiet */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 'T': /* timestamp */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 't': /* cache record files */</span><br><span style="color: hsl(120, 100%, 40%);">+ case 'U': /* run user */</span><br><span style="color: hsl(120, 100%, 40%);">+ fprintf(stderr, "'%c' option is not compatible with remote console mode and has no effect.\n", c);</span><br><span style="color: hsl(120, 100%, 40%);">+ didwarn = 1;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ if (didwarn) {</span><br><span style="color: hsl(120, 100%, 40%);">+ fprintf(stderr, "\n"); /* if any warnings print out, make them stand out */</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /* For remote connections, change the name of the remote connection.</span><br><span> * We do this for the benefit of init scripts (which need to know if/when</span><br><span> * the main asterisk process has died yet). */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18184">change 18184</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/18184"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I980a5380ef2c19e8ea348596396d5382893c4337 </div>
<div style="display:none"> Gerrit-Change-Number: 18184 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>