Basically smsd is planned to work with fixed devices. However, some user had some idea or even code for plug-and-play support. It was with support for one device, if I remember correctly. If I find where this information was, I let you know and publish it here.
When smsd is started and modem does not exists, modem process will stop but smsd main process continues because there can be more modems to serve. From the log, of course, can be seen that modem process has stopped:
2009-06-26 19:54:06,5, GSM1: Modem handler 0 has started. /dev/ttyUSB2 PID: 17087.
2009-06-26 19:54:06,3, GSM1: Cannot open serial port /dev/ttyUSB2, error: No such device
2009-06-26 19:54:06,2, GSM1: Modem handler 0 terminated. PID: 17087, was started 09-06-26 19:54:06.
Also, after this a modem process is <defunct> which can be seen from the ps -ef list.
If you use the latest sms3 script to start smsd, you can see that there is *"smsd MAINPROCESS"* and for example *"smsd GSM1_______"* presented in the ps list. You could use crontab and script with detects that "smsd GSM1" is missing. In this case it's safe to run sms3 restart.
Another issue is the device name, which may change after a modem is disconnected and connected back again. One solution for this is using
udev if it's available. I do not use udev by myself, but know smsd users who use it successfully. Changed device name can also be detected using a modified startup script, but my script is not complete enough to be published. My script is used to perform remote hard reset for a modem, which is little bit different thing.
« Last edit by
keke on Sun Aug 16, 2009 12:54, 177 months ago. »