New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

smsd: infinite send loop on non-writable sms file #329

Open
agalanin opened this Issue Jul 25, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@agalanin

agalanin commented Jul 25, 2017

Initial conditions

gammu-smsd is running by user gammu

Steps to reproduce

  1. invoke gammu-smsd-inject by root
  2. check logs

Results

  1. A new file /var/spool/gammu/outbox/OUTC20170724_230618_00_+12345678901_sms0.smsbackup is created. Owner is root:gammu, permissions - 0644.
  2. gammu enters infinite loop:
Jul 24 23:32:13 barsik gammu-smsd[30728]: Transmitted OUTC20170724_230618_00_+12345678901_sms0.smsbackup (total: 1) to +12345678901, message reference 0x62
Jul 24 23:32:13 barsik gammu-smsd[30728]: AddSentSMSInfo: Failed to open file for writing, Error 13: Permission denied
Jul 24 23:32:13 barsik gammu-smsd[30728]: Error setting sent status: Can not open specified file. (CANTOPENFILE[28])
Jul 24 23:32:14 barsik gammu-smsd[30728]: Message without SMSC, assuming you want to use the one from phone
Jul 24 23:32:17 barsik gammu-smsd[30728]: Transmitted OUTC20170724_230618_00_+12345678901_sms0.smsbackup (total: 1) to +12345678901, message reference 0x63
Jul 24 23:32:17 barsik gammu-smsd[30728]: AddSentSMSInfo: Failed to open file for writing, Error 13: Permission denied
Jul 24 23:32:17 barsik gammu-smsd[30728]: Error setting sent status: Can not open specified file. (CANTOPENFILE[28])
Jul 24 23:32:18 barsik gammu-smsd[30728]: Message without SMSC, assuming you want to use the one from phone
Jul 24 23:32:20 barsik gammu-smsd[30728]: Transmitted OUTC20170724_230618_00_+12345678901_sms0.smsbackup (total: 1) to +12345678901, message reference 0x64
Jul 24 23:32:20 barsik gammu-smsd[30728]: AddSentSMSInfo: Failed to open file for writing, Error 13: Permission denied
Jul 24 23:32:20 barsik gammu-smsd[30728]: Error setting sent status: Can not open specified file. (CANTOPENFILE[28])
Jul 24 23:32:21 barsik gammu-smsd[30728]: Message without SMSC, assuming you want to use the one from phone
Jul 24 23:32:23 barsik gammu-smsd[30728]: Transmitted OUTC20170724_230618_00_+12345678901_sms0.smsbackup (total: 1) to +12345678901, message reference 0x65
Jul 24 23:32:23 barsik gammu-smsd[30728]: AddSentSMSInfo: Failed to open file for writing, Error 13: Permission denied
Jul 24 23:32:23 barsik gammu-smsd[30728]: Error setting sent status: Can not open specified file. (CANTOPENFILE[28])

I think that gammu-smsd should not re-send SMSes that was successfully sent if there are minor problem in updating sent SMS status. In this case error log about failed status update ie enough.

@agalanin

This comment has been minimized.

Show comment
Hide comment
@agalanin

agalanin Jul 27, 2017

Oh, sorry! I forgot to tell gammu version. 1.38.1

agalanin commented Jul 27, 2017

Oh, sorry! I forgot to tell gammu version. 1.38.1

@GanFall

This comment has been minimized.

Show comment
Hide comment
@GanFall

GanFall May 23, 2018

Hi, did you found solution for this problem? I have changed folder permission, but I can not test it currently. I'm using gammu as emergency notification system when the power goes down. When I was not at home, there was long power outage and the SMS notification got stuck exactly as your, I have then received over 300 messages. Will cost me lot of money :-( I have never experienced such error before, but recently I have updated gammu to latest version (because hw compatibility problem) and I was not testing it well. So the problem only waited to appear in worst possible moment. Only solution was to lock simcard by network owner, otherwise gammu would kill my phone and cost me fortune :-( Not sure how to fix it. I will at least create script to empty outbox directory automatically from older files.

GanFall commented May 23, 2018

Hi, did you found solution for this problem? I have changed folder permission, but I can not test it currently. I'm using gammu as emergency notification system when the power goes down. When I was not at home, there was long power outage and the SMS notification got stuck exactly as your, I have then received over 300 messages. Will cost me lot of money :-( I have never experienced such error before, but recently I have updated gammu to latest version (because hw compatibility problem) and I was not testing it well. So the problem only waited to appear in worst possible moment. Only solution was to lock simcard by network owner, otherwise gammu would kill my phone and cost me fortune :-( Not sure how to fix it. I will at least create script to empty outbox directory automatically from older files.

@agalanin

This comment has been minimized.

Show comment
Hide comment
@agalanin

agalanin May 23, 2018

First I revert permissions to spool directory:

chown -R gammu:gammu /var/spool/gammu

and then modify sms sender script to operate under user gammu:

echo "$message" | su gammu -s /bin/bash -c 'gammu-smsd-inject TEXT +1234567890'

agalanin commented May 23, 2018

First I revert permissions to spool directory:

chown -R gammu:gammu /var/spool/gammu

and then modify sms sender script to operate under user gammu:

echo "$message" | su gammu -s /bin/bash -c 'gammu-smsd-inject TEXT +1234567890'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment