What's wrong with the Asterisk CLI history? When I exit the CLI, and re-enter, the last command in the history always defaults to 'stop now'. This is very bad, and it's caused accidental shutdowns more than once. Connected to Asterisk 1.2.9.1 currently running on hera (pid = 17399) Verbosity is at least 3 hera*CLI> A No such command 'A' (type 'help' for help) hera*CLI> B No such command 'B' (type 'help' for help) hera*CLI> C No such command 'C' (type 'help' for help) hera*CLI> D No such command 'D' (type 'help' for help) hera*CLI> E No such command 'E' (type 'help' for help) hera*CLI> [10:30][root@hera(pbx3):~]# asterisk -trv Asterisk 1.2.9.1, Copyright (C) 1999 - 2006 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'show license' for details. ========================================================================Connected to Asterisk 1.2.9.1 currently running on hera (pid = 17399) Verbosity is at least 3 hera*CLI> stop now <-- I pressed the UP arrow upon re-entering the console! Doug
On Mon, 2006-12-11 at 10:31 -0700, Douglas Garstang wrote:> What's wrong with the Asterisk CLI history? When I exit the CLI, and re-enter, the last command in the history always defaults to 'stop now'. This is very bad, and it's caused accidental shutdowns more than once.Nothing wrong here. -- Dave Cotton <dcotton@linuxautrement.com>
> -----Original Message----- > From: Dave Cotton [mailto:dcotton@linuxautrement.com] > Sent: Monday, December 11, 2006 10:55 AM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: Re: [asterisk-users] CLI History > > > On Mon, 2006-12-11 at 10:31 -0700, Douglas Garstang wrote: > > What's wrong with the Asterisk CLI history? When I exit the > CLI, and re-enter, the last command in the history always > defaults to 'stop now'. This is very bad, and it's caused > accidental shutdowns more than once. > > Nothing wrong here.Can you possibly be a little more specific on why it isn't a problem? Doug.
> -----Original Message----- > From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users- > bounces@lists.digium.com] On Behalf Of Douglas Garstang > Sent: Monday, December 11, 2006 1:37 PM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: RE: [asterisk-users] CLI History > > > -----Original Message----- > > From: Dave Cotton [mailto:dcotton@linuxautrement.com] > > Sent: Monday, December 11, 2006 10:55 AM > > To: Asterisk Users Mailing List - Non-Commercial Discussion > > Subject: Re: [asterisk-users] CLI History > > > > > > On Mon, 2006-12-11 at 10:31 -0700, Douglas Garstang wrote: > > > What's wrong with the Asterisk CLI history? When I exit the > > CLI, and re-enter, the last command in the history always > > defaults to 'stop now'. This is very bad, and it's caused > > accidental shutdowns more than once. > > > > Nothing wrong here. > > Can you possibly be a little more specific on why it isn't a problem? > > Doug. > _______________________________________________Sounds like it is working as intended if that is the last command you executed. I'd say be more careful when executing commands.
On Monday 11 December 2006 9:31 am, Douglas Garstang wrote:> What's wrong with the Asterisk CLI history? When I exit the CLI, and > re-enter, the last command in the history always defaults to 'stop now'. > This is very bad, and it's caused accidental shutdowns more than once. > > Connected to Asterisk 1.2.9.1 currently running on hera (pid = 17399) > Verbosity is at least 3 > hera*CLI> A > No such command 'A' (type 'help' for help) > hera*CLI> B > No such command 'B' (type 'help' for help) > hera*CLI> C > No such command 'C' (type 'help' for help) > hera*CLI> D > No such command 'D' (type 'help' for help) > hera*CLI> E > No such command 'E' (type 'help' for help) > hera*CLI> > [10:30][root@hera(pbx3):~]# asterisk -trv > Asterisk 1.2.9.1, Copyright (C) 1999 - 2006 Digium, Inc. and others. > Created by Mark Spencer <markster@digium.com> > Asterisk comes with ABSOLUTELY NO WARRANTY; type 'show warranty' for > details. This is free software, with components licensed under the GNU > General Public License version 2 and other licenses; you are welcome to > redistribute it under certain conditions. Type 'show license' for details. > ========================================================================> Connected to Asterisk 1.2.9.1 currently running on hera (pid = 17399) > Verbosity is at least 3 > hera*CLI> stop now <-- I pressed the UP arrow upon re-entering the console! >I'm a bit confused by your example. What are A,B,C, etc? To exit the Asterisk console, I type 'exit'. Asterisk continues to run, as it should. To re-enter the console I use asterisk -rvvv. -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Carla Schroder Linux geek and random computer tamer check out my Linux Cookbook! http://www.oreilly.com/catalog/linuxckbk/ best book for sysadmins and power users ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> -----Original Message----- > From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users- > bounces@lists.digium.com] On Behalf Of Carla Schroder > Sent: Monday, December 11, 2006 2:17 PM > To: asterisk-users@lists.digium.com > Subject: Re: [asterisk-users] CLI History > > On Monday 11 December 2006 9:31 am, Douglas Garstang wrote: > > What's wrong with the Asterisk CLI history? When I exit the CLI, and > > re-enter, the last command in the history always defaults to 'stopnow'.> > This is very bad, and it's caused accidental shutdowns more thanonce.> > > > Connected to Asterisk 1.2.9.1 currently running on hera (pid 17399) > > Verbosity is at least 3 > > hera*CLI> A > > No such command 'A' (type 'help' for help) > > hera*CLI> B > > No such command 'B' (type 'help' for help) > > hera*CLI> C > > No such command 'C' (type 'help' for help) > > hera*CLI> D > > No such command 'D' (type 'help' for help) > > hera*CLI> E > > No such command 'E' (type 'help' for help) > > hera*CLI> > > [10:30][root@hera(pbx3):~]# asterisk -trv > > Asterisk 1.2.9.1, Copyright (C) 1999 - 2006 Digium, Inc. and others. > > Created by Mark Spencer <markster@digium.com> > > Asterisk comes with ABSOLUTELY NO WARRANTY; type 'show warranty' for > > details. This is free software, with components licensed under theGNU> > General Public License version 2 and other licenses; you are welcometo> > redistribute it under certain conditions. Type 'show license' for > details. > > >=======================================================================> > Connected to Asterisk 1.2.9.1 currently running on hera (pid 17399)> > Verbosity is at least 3 > > hera*CLI> stop now <-- I pressed the UP arrow upon re-entering the > console! > > >Mine appears to work: ##Connected to Asterisk and execute stop now: dragon*CLI> stop now dragon*CLI> Disconnected from Asterisk server ## Restarted Asterisk: [root@dragon ~]# asterisk -p ## Connected to Asterisk then ran exit: [root@dragon ~]# asterisk -r Asterisk 1.4.0-beta3, Copyright (C) 1999 - 2006 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'show license' for details. ======================================================================= Connected to Asterisk 1.4.0-beta3 currently running on dragon (pid = 32521) dragon*CLI> exit ## Connected to Asterisk Again and hit the up arrow: [root@dragon ~]# asterisk -r Asterisk 1.4.0-beta3, Copyright (C) 1999 - 2006 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'show license' for details. ======================================================================= Connected to Asterisk 1.4.0-beta3 currently running on dragon (pid = 32521) dragon*CLI> exit Exit is displayed not stop now. If you hit "A" and it's an invalid command...maybe that is your problem...
> -----Original Message----- > From: Aaron Daniel [mailto:amdtech@shsu.edu] > Sent: Monday, December 11, 2006 12:57 PM > To: asterisk-users@lists.digium.com > Subject: Re: [asterisk-users] CLI History > > > On Mon, 2006-12-11 at 11:17 -0800, Carla Schroder wrote: > > On Monday 11 December 2006 9:31 am, Douglas Garstang wrote: > > > What's wrong with the Asterisk CLI history? When I exit > the CLI, and > > > re-enter, the last command in the history always defaults > to 'stop now'. > > > This is very bad, and it's caused accidental shutdowns > more than once. > > > > > > Connected to Asterisk 1.2.9.1 currently running on hera > (pid = 17399) > > > Verbosity is at least 3 > > > hera*CLI> A > > > No such command 'A' (type 'help' for help) > > > hera*CLI> B > > > No such command 'B' (type 'help' for help) > > > hera*CLI> C > > > No such command 'C' (type 'help' for help) > > > hera*CLI> D > > > No such command 'D' (type 'help' for help) > > > hera*CLI> E > > > No such command 'E' (type 'help' for help) > > > hera*CLI> > > > [10:30][root@hera(pbx3):~]# asterisk -trv > > > Asterisk 1.2.9.1, Copyright (C) 1999 - 2006 Digium, Inc. > and others. > > > Created by Mark Spencer <markster@digium.com> > > > Asterisk comes with ABSOLUTELY NO WARRANTY; type 'show > warranty' for > > > details. This is free software, with components licensed > under the GNU > > > General Public License version 2 and other licenses; you > are welcome to > > > redistribute it under certain conditions. Type 'show > license' for details. > > > > =============================================================> ==========> > > Connected to Asterisk 1.2.9.1 currently running on hera > (pid = 17399) > > > Verbosity is at least 3 > > > hera*CLI> stop now <-- I pressed the UP arrow upon > re-entering the console! > > > > > > > I'm a bit confused by your example. What are A,B,C, etc? > To exit the Asterisk > > console, I type 'exit'. Asterisk continues to run, as it > should. To re-enter > > the console I use asterisk -rvvv. > > > He was demonstrating how the CLI history shows stop now as the last > command (which um... it's a history? you're last command is gonna be > the um... last command you ran... i.e. "stop now").For crying out loud, why is this so hard to understand? It isn't rocket science. I said that when I exit the CLI and re-enter, no matter what my previous set of commands was, when I hit the UP arrow key, it was always 'stop now'. 'Stop now' WAS NOT MY PREVIOUS COMMAND. For the person that suggested maybe unknown commands are not added to the history... hera*CLI> show channels Channel Location State Application(Data) 0 active channels 0 active calls hera*CLI> sip show channels Peer User/ANR Call ID Seq (Tx/Rx) Form Hold Last Message 0 active SIP channels hera*CLI> (I Pressed Ctrl-c here) [13:31][root@hera(pbx3):~]# asterisk -trv Asterisk 1.2.9.1, Copyright (C) 1999 - 2006 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'show license' for details. ========================================================================Connected to Asterisk 1.2.9.1 currently running on hera (pid = 18149) Verbosity is at least 3 hera*CLI> stop now (I pressed the up arrow key here) As you can see, my previous commands where 'show channels' and 'sip show channels'. When I exited the CLI and re-entered and pressed ctrl-c, the commands in the history where not 'show channels and 'sip show channels' but 'stop now' instead. Doug.
> -----Original Message----- > From: Mailing List [mailto:MailingList@mobilcom.net] > Sent: Monday, December 11, 2006 1:38 PM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: Re: [asterisk-users] CLI History > > > > ----- Original Message ----- > > > > On Mon, 2006-12-11 at 10:31 -0700, Douglas Garstang wrote: > > > What's wrong with the Asterisk CLI history? When I exit the > > CLI, and re-enter, the last command in the history always > > defaults to 'stop now'. This is very bad, and it's caused > > accidental shutdowns more than once. > > > > Nothing wrong here. > > Can you possibly be a little more specific on why it isn't a problem? > > > It's most likely how he is quitting the client. > If you exit properly (exit or quit) it retains it but if you > can cancel out (ctrl-c) it just drops.Yes, I think that's it. It seems that hitting ctrl-c breaks the history. I'd file a bug (the cli process should be able to catch SIGINT), but I'm not running the latest 1.2. Doug.
But ctrl-c is 3 less keystrokes than exit\n !> -----Original Message----- > From: Steven [mailto:asterisk@tescogroup.com] > Sent: Monday, December 11, 2006 2:16 PM > To: asterisk-users@lists.digium.com > Subject: [asterisk-users] Re: CLI History > > > Don't hit Ctrl-C! > > If I type ? in the CLI, Ctrl-C is not listed as a command. > *CLI> > ! abort add ael agent > agi cdr > database debug dnsmgr dont dump > dundi extensions > feature group help iax2 include > indication init > load local logger meetme mgcp > mixmonitor moh > no pri realtime reload remove > restart rtp > set show sip skinny soft > stop unload > zap > > The funny thing is that neither is exit. > > Type exit when exiting asterisk CLI, and it will close out properly. > > > > > > > > -- > -- > Steven > > http://www.glimasoutheast.org > > > > "Todd- Asterisk" <thouleasterisk@gleffsecurity.com> wrote in > message news:C36177F6-37AE-4075-8A4B-0DF9BB7707E1@gleffsecurity.com... > > short version: me too > > > > long version: The same thing happens on my asterisk boxes > - both built with the latest trixbox image... perhaps that's a > > factor? My history is always "restart now", although I > typically connect and run "sip show peers". I haven't typed > "restart > > now" in a long time, but that is the first thing when I > hit up-arrrow upon connecting.... > > > > I have had history written to when I type 'exit' at the > console instead of ctrl-c. I haven't tested though as the > school bus > > just arrived.... ;) > > Todd > > > > > > On Dec 11, 2006, at 3:35 PM, Douglas Garstang wrote: > > > >>> -----Original Message----- > >>> From: Aaron Daniel [mailto:amdtech@shsu.edu] > >>> Sent: Monday, December 11, 2006 12:57 PM > >>> To: asterisk-users@lists.digium.com > >>> Subject: Re: [asterisk-users] CLI History > >>> > >>> > >>> On Mon, 2006-12-11 at 11:17 -0800, Carla Schroder wrote: > >>>> On Monday 11 December 2006 9:31 am, Douglas Garstang wrote: > >>>>> What's wrong with the Asterisk CLI history? When I exit > >>> the CLI, and > >>>>> re-enter, the last command in the history always defaults > >>> to 'stop now'. > >>>>> This is very bad, and it's caused accidental shutdowns > >>> more than once. > >>>>> > >>>>> Connected to Asterisk 1.2.9.1 currently running on hera > >>> (pid = 17399) > >>>>> Verbosity is at least 3 > >>>>> hera*CLI> A > >>>>> No such command 'A' (type 'help' for help) > >>>>> hera*CLI> B > >>>>> No such command 'B' (type 'help' for help) > >>>>> hera*CLI> C > >>>>> No such command 'C' (type 'help' for help) > >>>>> hera*CLI> D > >>>>> No such command 'D' (type 'help' for help) > >>>>> hera*CLI> E > >>>>> No such command 'E' (type 'help' for help) > >>>>> hera*CLI> > >>>>> [10:30][root@hera(pbx3):~]# asterisk -trv > >>>>> Asterisk 1.2.9.1, Copyright (C) 1999 - 2006 Digium, Inc. > >>> and others. > >>>>> Created by Mark Spencer <markster@digium.com> > >>>>> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'show > >>> warranty' for > >>>>> details. This is free software, with components licensed > >>> under the GNU > >>>>> General Public License version 2 and other licenses; you > >>> are welcome to > >>>>> redistribute it under certain conditions. Type 'show > >>> license' for details. > >>>>> > >>> =============================================================> >>> ==========> >>>>> Connected to Asterisk 1.2.9.1 currently running on hera > >>> (pid = 17399) > >>>>> Verbosity is at least 3 > >>>>> hera*CLI> stop now <-- I pressed the UP arrow upon > >>> re-entering the console! > >>>>> > >>>> > >>>> I'm a bit confused by your example. What are A,B,C, etc? > >>> To exit the Asterisk > >>>> console, I type 'exit'. Asterisk continues to run, as it > >>> should. To re-enter > >>>> the console I use asterisk -rvvv. > >>>> > >>> He was demonstrating how the CLI history shows stop now > as the last > >>> command (which um... it's a history? you're last command > is gonna be > >>> the um... last command you ran... i.e. "stop now"). > >> > >> For crying out loud, why is this so hard to understand? It > isn't rocket science. I said that when I exit the CLI and re-enter, > >> no matter what my previous set of commands was, when I > hit the UP arrow key, it was always 'stop now'. 'Stop now' > WAS NOT MY > >> PREVIOUS COMMAND. > >> > >> For the person that suggested maybe unknown commands are > not added to the history... > >> > >> hera*CLI> show channels > >> Channel Location State Application(Data) > >> 0 active channels > >> 0 active calls > >> hera*CLI> sip show channels > >> Peer User/ANR Call ID Seq (Tx/Rx) > Form Hold Last Message > >> 0 active SIP channels > >> hera*CLI> > >> (I Pressed Ctrl-c here) > >> > >> [13:31][root@hera(pbx3):~]# asterisk -trv > >> Asterisk 1.2.9.1, Copyright (C) 1999 - 2006 Digium, Inc. > and others. > >> Created by Mark Spencer <markster@digium.com> > >> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'show > warranty' for details. > >> This is free software, with components licensed under the > GNU General Public > >> License version 2 and other licenses; you are welcome to > redistribute it under > >> certain conditions. Type 'show license' for details. > >> > =============================================================> ======== ==> >> Connected to Asterisk 1.2.9.1 currently running on hera > (pid = 18149) > >> Verbosity is at least 3 > >> hera*CLI> stop now (I pressed the up arrow key here) > >> > >> As you can see, my previous commands where 'show channels' > and 'sip show channels'. When I exited the CLI and re-entered and > >> pressed ctrl-c, the commands in the history where not > 'show channels and 'sip show channels' but 'stop now' instead. > >> > >> Doug. > >> > >> > >> _______________________________________________ > >> --Bandwidth and Colocation provided by Easynews.com -- > >> > >> asterisk-users mailing list > >> To UNSUBSCRIBE or update options visit: > >> http://lists.digium.com/mailman/listinfo/asterisk-users > >> > > > > _______________________________________________ > > --Bandwidth and Colocation provided by Easynews.com -- > > > > asterisk-users mailing list > > To UNSUBSCRIBE or update options visit: > > http://lists.digium.com/mailman/listinfo/asterisk-users > > > > > > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >
On Mon, Dec 11, 2006 at 10:31:41AM -0700, Douglas Garstang wrote:> What's wrong with the Asterisk CLI history? When I exit the CLI, and > re-enter, the last command in the history always defaults to 'stop now'. > This is very bad, and it's caused accidental shutdowns more than once.Let's ignore the tone of the question, and try to answer it. Here is what I consider may be wrong: 1. The shell does not exit on Ctrl-D / EOF 2. When the shell does exist on Ctrl-C (SIGHUP) 3. When it exists on Ctrl-C (SIGHUP) it does not save history. 4. (Potentially a problem) saving "stop now" in the history. For starters, I hope you agree that (4) is not the real problem here. (1) and (2) make the Asterisk shell different from standard shells. In s standard shell Ctrl-C is supressed (so it will only affect programs you run from it, and not the shell). Ctrl-D and end of input cause the shell to exit. (3) seems to be the real thing that bothers Douglas. And as usual, Douglas manages to complain with the wrong tone and thus getting people to flame him rather than consider his argument seriously. -- Tzafrir Cohen icq#16849755 jabber:tzafrir@jabber.org +972-50-7952406 mailto:tzafrir.cohen@xorcom.com http://www.xorcom.com iax:guest@local.xorcom.com/tzafrir