From: Lau K. T. V. <vin...@gm...> - 2007-05-12 02:03:19
|
Hi everyone, I face a rather perculiar problem with my Gumstix. I use Minicom to access my Gumstix via a serial connection. Everytime the *exec* command is issued, the login prompt (without the welcome message) returns. The program/script to be executed does not run and I have to login all over again. The other thing that causes the same problem is when I attempt to activate a GPRS-Bluetooth connection using *pppd call gprs*. The login prompt appears, but the chat script tries to continue running. Chat scripts issue modem AT commands and the system mistook those to be input for the username and password. This is of course wrong, so there is a login error and the script fails. By the way, I did try to anticipate the login prompt by adding the appropriate expects and responses. That did not work either. I have also tried letting the scripts run on start-up or run without a live serial connection monitoring it, in case it is some kind of permission thing. The same problem occurred. Without the serial connection to monitor it, I don't really know if the login prompt came up again. However, using my phone as an indicator, if the script ran successfully without interruption from the login prompt, my phone should indicate a live GPRS connection, which it didn't. I do not get the login prompt problem on my computer, both *exec* and *pppd call gprs* worked well. My computer is running on linux 2.4.20, while my Gumstix is on linux 2.6.11. I am not sure if the difference in kernel version is a cause for this. Anyone with any ideas? ~ Vincent |
From: Lau K. T. V. <vin...@gm...> - 2007-05-12 16:22:00
|
Hi Dave, I am referring to the exec command from the shell. The stuff that I am doing are primarily shell scripts, with little or no C programming involved. The same problem occurs for the pppd chat scripts. Thanks for your help! Regards, Vincent Lau ---------- Forwarded message ---------- > From: "Dave Hylands" <dhy...@gm...> > To: "General mailing list for gumstix users." < > gum...@li...> > Date: Sat, 12 May 2007 01:14:23 -0700 > Subject: Re: [Gumstix-users] Return of the login prompt > Hi Vincent, > > > Everytime the exec command is issued, the login prompt (without the > welcome > > message) returns. The program/script to be executed does not run and I > have > > to login all over again. > > Could you provide an example. I'm familiar with the exec call from C. > Are you referring to that? or the exec command from the shell? > > -- > Dave Hylands > Vancouver, BC, Canada > http://www.DaveHylands.com/ <http://www.davehylands.com/> > |
From: Dave H. <dhy...@gm...> - 2007-05-12 20:39:08
|
Hi Vincent, > I am referring to the exec command from the shell. The stuff that I am doing > are primarily shell scripts, with little or no C programming involved. The > same problem occurs for the pppd chat scripts. OK - so do you know what exec really does? It REPLACES the current process with the new process, and when the new process finishes, then it would go back to the login prompt. Using exec is rather unusual, and I'd only recommned using it very special circumstances. So if you do: exec foo It will replace the shell with foo, and when foo exits it will return to the login prompt. If you just do: foo then it will launch a new sub-process and when the new process exits it will return to the launching shell. -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |
From: Lauri K. <lau...@gm...> - 2007-05-14 06:23:10
|
2007/5/12, Dave Hylands <dhy...@gm...>: > > I am referring to the exec command from the shell. The stuff that I am doing > > are primarily shell scripts, with little or no C programming involved. The > > same problem occurs for the pppd chat scripts. > > OK - so do you know what exec really does? > > It REPLACES the current process with the new process, and when the new > process finishes, then it would go back to the login prompt. Using > exec is rather unusual, and I'd only recommned using it very special > circumstances. Hi Vincent, Dave, The exec shell builtin command servers also another purpose: opening files and reassigning file descriptors. Anyway, the problem here may be that busybox is compiled without exec builtin (just a guess). You can check the existense of exec by issuing: "exec 3< filename" at shell prompt. That should open a file as file descriptor 3 (for reading). An error message would indicate that the exec builtin is missing. -lauri |
From: Dave H. <dhy...@gm...> - 2007-05-12 08:14:23
|
Hi Vincent, > Everytime the exec command is issued, the login prompt (without the welcome > message) returns. The program/script to be executed does not run and I have > to login all over again. Could you provide an example. I'm familiar with the exec call from C. Are you referring to that? or the exec command from the shell? -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |
From: L R N. <lo...@lo...> - 2007-05-13 01:26:22
|
the 'exec' command REPLACES the current command processor (bash/sh/ash/rsh/...) with the current command. Thus if you type: exec ls (for example) at the command line, it replaces your shell (bash in my case) with the 'ls' command, and when THAT concludes its function, it returns to the PARENT of the shell it replaced. Well, bash is from login, so when it ends, you log in again. if you're using this in a shell, remember that you need to run the script using a 'shebang', the #!/bin/bash, header. If you don't use the '#!' header, the current shell executes the script... thus the exec command exits the current login. If you start a script and use the #! method, it starts a NEW shell to run the script, and the exec command will do what you (presumably) desired. #!/bin/bash # starts a new shell exec ls (to reformat my previous example) Hope this helps Take Care, Loni lo...@lo... On Sat, 12 May 2007, Dave Hylands wrote: > Date: Sat, 12 May 2007 01:14:23 -0700 > From: Dave Hylands <dhy...@gm...> > Reply-To: General mailing list for gumstix users. > <gum...@li...> > To: General mailing list for gumstix users. > <gum...@li...> > Subject: Re: [Gumstix-users] Return of the login prompt > > Hi Vincent, > > > Everytime the exec command is issued, the login prompt (without the welcome > > message) returns. The program/script to be executed does not run and I have > > to login all over again. > > Could you provide an example. I'm familiar with the exec call from C. > Are you referring to that? or the exec command from the shell? > > |
From: L R N. <lo...@lo...> - 2007-05-13 01:29:06
|
{Chuckle} Really ironic how Dave and I say almost the same identical statement and give the same examples. Hey! Get out of my head!! Take Care, Loni lo...@lo... On Sat, 12 May 2007, L R Nix wrote: > Date: Sat, 12 May 2007 20:26:00 -0500 (CDT) > From: L R Nix <lo...@lo...> > Reply-To: General mailing list for gumstix users. > <gum...@li...> > To: General mailing list for gumstix users. > <gum...@li...> > Subject: Re: [Gumstix-users] Return of the login prompt > > > the 'exec' command REPLACES the current command processor > (bash/sh/ash/rsh/...) with the current command. > > Thus if you type: > > exec ls (for example) > > at the command line, it replaces your shell (bash in my case) with the > 'ls' command, and when THAT concludes its function, it returns to the > PARENT of the shell it replaced. Well, bash is from login, so when it > ends, you log in again. > > if you're using this in a shell, remember that you need to run the script > using a 'shebang', the #!/bin/bash, header. > > If you don't use the '#!' header, the current shell executes the script... > thus the exec command exits the current login. If you start a script and > use the #! method, it starts a NEW shell to run the script, and the exec > command will do what you (presumably) desired. > > #!/bin/bash > # starts a new shell > exec ls > > (to reformat my previous example) > > Hope this helps > > Take Care, > > Loni > lo...@lo... > > > On Sat, 12 May 2007, Dave Hylands wrote: > > > Date: Sat, 12 May 2007 01:14:23 -0700 > > From: Dave Hylands <dhy...@gm...> > > Reply-To: General mailing list for gumstix users. > > <gum...@li...> > > To: General mailing list for gumstix users. > > <gum...@li...> > > Subject: Re: [Gumstix-users] Return of the login prompt > > > > Hi Vincent, > > > > > Everytime the exec command is issued, the login prompt (without the welcome > > > message) returns. The program/script to be executed does not run and I have > > > to login all over again. > > > > Could you provide an example. I'm familiar with the exec call from C. > > Are you referring to that? or the exec command from the shell? > > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > gumstix-users mailing list > gum...@li... > https://lists.sourceforge.net/lists/listinfo/gumstix-users > |