Author |
Post |
|
#1 Sun Sep 01, 2013 13:05, 129 months ago.
|
Member
Registered: Jul 2013
Location: United States of America
|
Hello.
I am running a script to send the messages from Cygwin command line, it sends around 10 per minute, and there are 6 modems configured, sometimes my script stops because I am getting this back from the SmsTools:
mv: try to overwrite `/var/spool/sms/outgoing/send_tRZacZ', overriding mode 0600 (rw-------)? n
The folders only contain a low amount of files, changing from 0 to ~5.
I am not sure what caused it, maybe the unique filename is not so unique? Or maybe the 6 instances of the modem all try to move the file at once and causes the conflict ? It happen twice in last hour.
Does this indicate a problem and is there a way to tell it to automatically overwrite it or skip it ?
Thank you.
|
|
#2 Sun Sep 01, 2013 18:53, 129 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
I would like to see that external script, for debugging and probably trying under Cygwin.
You can show it privately, use Private tags around it.
|
|
#3 Sun Sep 01, 2013 22:10, 129 months ago.
|
Member
Registered: Jul 2013
Location: United States of America
Topic owner
|
Thanks for your reply. It is a python script that loads data from an url and then triggers the local sendsms command in order to send a message. Data is loaded as plain text and contains 10 lines per page load, each line contains phone number and message to send, separated by "|": This is repeated every 34 seconds, seems enough for the modems to send data. I noticed each time I restart smsd that there are 7 instances of sendsms.exe in windows, is that correct for 6 modems ? Hidden private text.
|
|
#4 Mon Sep 02, 2013 20:43, 129 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
Thanks for the information. adrianTNT wrote I noticed each time I restart smsd that there are 7 instances of sendsms.exe in windows, is that correct for 6 modems ?
The mainspooler is one process, and each modem has it's process too. Seven instances is correct, but the name should be smsd or smsd.exe, not sendsms.exe. I'm not sure, but I have a strange feeling from the past (long time ago), in some cases names in the process list were not correct. Anyways, it probably seems that the sendsms script causes the problem, when smsd is spooling messages at the same time, and perhaps on the slow system under remarkable load. The script creates files with rw, and smsd tries to change it to 0766. If this happens when the temp file is created, and before the file is moved, conflick may happen. Do you have a global setting os_cygwin = yes defined in your configuration? The fastest way to fix the situation would be to change the python script so that it would write itself files that go into spooler. Some unique key is needed, it can be some counter or timestamp with the destination number, or something like that. When a file is created, it's name should end with .LOCK, or start with LOCKED. Like file007.LOCK or LOCKED007. Smstools skips those files, as they are not complete. After the file is complete and closed, the name must be changed, and then smstools will process them.
|
|
#5 Tue Sep 03, 2013 06:29, 129 months ago.
|
Member
Registered: Jul 2013
Location: United States of America
Topic owner
|
Processes are named smsd.exe, yes, sorry So I understand that this can be caused by a slow system and I should better create the SMS files myself ? The system indeed has an extremly slow processor, I cannot use it for anything else. I do not see "os_cygwin = yes", should I add it in smsd.conf ? Hidden private text. Thank you.
|
|
#6 Tue Sep 03, 2013 20:56, 129 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
os_cygwin = yes is recommended.
The script sendsms has it's limitations, and therefore on many systems front end application creates files by itself. Naming convention is one reason, also some additional header lines can be used.
Your python script should check how many files there are in the spooler. If there are more than couple of hundred files, probably less on your hardware, the script should stop spooling and wait. grep those "Took nn seconds... nnn SMS files seen" lines from the log, to see what is reasonable limit, as it depends on hardware and load.
If you want to monitor failed files, use failed = /var/spool/sms/failed setting. In your case yesterday, modem did not answer and smsd was stopped before retry was done. From the failed folder it's easy to see what messages are not sent. Those files also contain the reason why the sending failed.
|
|
#7 Tue Sep 03, 2013 22:15, 129 months ago.
|
Member
Registered: Jul 2013
Location: United States of America
Topic owner
|
I also thought about checking for existent files before creating more, I will check in both "outgoing" and "checked" folder, both can get filled with many messages and slow down the system, I noticed that if I have under 200 in outgoing folder then it loads a file in 1-2 seconds, otherwise it can take even 20-30 seconds in case there are over 1000 files.
Thanks for the great support Keke.
|