home | list info | list archive | date index | thread index

[OCLUG-Tech] how to programatically kill minicom without resetting it?

  • Subject: [OCLUG-Tech] how to programatically kill minicom without resetting it?
  • From: "Robert P. J. Day" <rpjday [ at ] crashcourse [ dot ] ca>
  • Date: Wed, 13 Mar 2013 07:29:15 -0400

  i'm currently working with minicom to initialize a modem using
a minicom "runscript" -- for those of you unfamiliar with this, you
can run:

  $ minicom -S script

where "script" is a shell script that minicom will execute, doing
things like sending various "AT" commands to the modem. at the end
of all that, i get the desired

  Modem is connected

but at that point, if i invoked minicom in the foreground, it's
obviously still running and it will have a lock file on the device
file (in my case, /dev/ttyUSB0). that means i can't start pppd on
that port since i will immediately get

  Device ttyUSB0 is locked by pid ....

so what i want is for minicom to now exit gracefully *without*
resetting the modem, since that would defeat everything's that's
been done up to now. that's equivalent to exiting minicom manually
with "Q" (quit with no reset) as opposed to "X" (exit and reset),
and i need to do that programatically from within a script.

  all the documentation i've seen suggests that can be done with

$ killall -9 minicom

which (as i read it) *claims* that that will kill minicom without
resetting the modem, but that just doesn't seem true with all the
tests i've run -- resets it every time.

  i know i can cheat and simply "rm" the lock file under /var/lock,
but that's seems tacky and i'd rather do this the right way. anyone
know how to kill off a minicom session without resetting the modem
it's talking to?

rday