Guys. Anybody know why sometimes on some servers Asterisk shows more than once while doing a ps? [root@server2 akrall]# ps -ax|grep asterisk 20555 ? S 0:00 /bin/sh /usr/sbin/safe_asterisk 20557 ? S 0:00 asterisk -vvvg -c 20558 ? S 0:00 asterisk -vvvg -c 20560 ? S 0:00 asterisk -vvvg -c 20561 ? S 0:00 asterisk -vvvg -c 20562 ? S 0:00 asterisk -vvvg -c 20564 ? S 0:00 asterisk -vvvg -c 20565 ? S 0:00 asterisk -vvvg -c 20566 ? S 0:02 asterisk -vvvg -c 20567 ? S 0:00 asterisk -vvvg -c 21958 ? S 0:00 asterisk -vvvg -c 30470 pts/2 S 0:00 grep asterisk Im running asterisk via the start/stop script on init.d On my other servers, it only shows once...
Mark Charlton
2005-Jul-01 17:18 UTC
[Asterisk-Users] asterisk showing more than once on ps
On 7/2/05, Anton Krall <akrall-lists@intruder.com.mx> wrote:> Guys. > > Anybody know why sometimes on some servers Asterisk shows more than once > while doing a ps? > > [root@server2 akrall]# ps -ax|grep asterisk > 20555 ? S 0:00 /bin/sh /usr/sbin/safe_asterisk > 20557 ? S 0:00 asterisk -vvvg -c > 20558 ? S 0:00 asterisk -vvvg -c > 20560 ? S 0:00 asterisk -vvvg -c > 20561 ? S 0:00 asterisk -vvvg -c > 20562 ? S 0:00 asterisk -vvvg -c > 20564 ? S 0:00 asterisk -vvvg -c > 20565 ? S 0:00 asterisk -vvvg -c > 20566 ? S 0:02 asterisk -vvvg -c > 20567 ? S 0:00 asterisk -vvvg -c > 21958 ? S 0:00 asterisk -vvvg -c > 30470 pts/2 S 0:00 grep asterisk > > Im running asterisk via the start/stop script on init.d > > On my other servers, it only shows once... > >I would guess its the use of the -c flag to run it From: http://www.voip-info.org/tiki-index.php?page=Asterisk+options # asterisk -vvvvvvc:Start Asterisk PBX, don't go background have you been monitoring it from the command line. I use -rvvvv to get the background version. Just a guess. Mark
jjones@quiddesign.com
2005-Jul-01 18:38 UTC
[Asterisk-Users] asterisk showing more than once on ps
Actually this is on an enterprise system - I have never seen more than one. Just checked now and there were several calls up and only one ps. On Jul 1, 2005, at 8:33 PM, Luki wrote:>> Do not know why, but have noticed redhat = 1, and debian = many >> > Not quite. RedHat Enterprise also = many at times, depending on number > of concurrent calls; usually one when idle. Maybe it has something to > do with kernel 2.4 vs 2.6 and how threads show up in ps. > > --Luki > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >
Michael Stahl
2005-Jul-02 07:32 UTC
[Asterisk-Users] asterisk showing more than once on ps
The system startup script /etc/init.d/asterisk calls the script /usr/sbin/safe_asterisk In safe_asterisk, the program is started with -c by default (console on TTY9). That explains why it is starting with a console, but not why it's running so many times! Here is what my system (FC3) shows: [root@pbx sbin]# ps ax | grep asterisk 3371 ? S 0:00 /bin/sh /usr/sbin/safe_asterisk 3417 ? S 0:00 asterisk -vvvg -c 6846 ? S 0:00 asterisk -vvvg -c 6848 ? S 0:00 asterisk -vvvg -c 6849 ? S 0:00 asterisk -vvvg -c 6850 ? S 0:00 asterisk -vvvg -c 6853 ? S 0:01 asterisk -vvvg -c 6854 ? S 0:00 asterisk -vvvg -c 8479 pts/1 S+ 0:00 grep asterisk Can anyone explain why asterisk is being launched 7 times? Thanks, OCG -----Original Message----- From: Luki [mailto:lugosoft@gmail.com] Sent: Friday, July 01, 2005 9:33 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [Asterisk-Users] asterisk showing more than once on ps> Do not know why, but have noticed redhat = 1, and debian = manyNot quite. RedHat Enterprise also = many at times, depending on number of concurrent calls; usually one when idle. Maybe it has something to do with kernel 2.4 vs 2.6 and how threads show up in ps. --Luki
>> >>[root at pbx sbin]# ps ax | grep asterisk >> 3371 ? S 0:00 /bin/sh /usr/sbin/safe_asterisk >> 3417 ? S 0:00 asterisk -vvvg -c >> 6846 ? S 0:00 asterisk -vvvg -c >> 6848 ? S 0:00 asterisk -vvvg -c >> 6849 ? S 0:00 asterisk -vvvg -c >> 6850 ? S 0:00 asterisk -vvvg -c >> 6853 ? S 0:01 asterisk -vvvg -c >> 6854 ? S 0:00 asterisk -vvvg -c >> 8479 pts/1 S+ 0:00 grep asterisk >> >> >>Can anyone explain why asterisk is being launched 7 times?>It isn't launched 7 times. Asterisk is a multi-threaded application and >depending on what modules are active, a new thread will be created. That's >what you see. >The line 'asterisk -vvvg -c' doesn't mean that every thread has it's own >'c'onsole. Just one thread is the console. >So this is absolutly normal. >When, on some systems, do just see one thread/program, then this system >just show the main-thread. This depends on kernel/ps version. > >ArminBut that doesn't explain why, on the same machine, if you call "/etc/init.d/asterisk stop" and then "/etc/init.d/asterisk start", you dont many processes, just one. Shouldn't this be consistent with your explanation? Rick