Search code examples
ubuntufile-permissionssms-gateway

Playsms folders empty on Ubuntu


I'm using playsms 1.4 with smstools v3.1.20 on Ubuntu 16.04 with apache2, php7. I can send messages from playsms, but "my sent messages" folder is always empty, even though messages are successfully sent.

I've set the directory permission like this:

chown www-data:www-data -R /var/spool/sms

and it looks like this: ls -ltrR /var/spool/sms

/var/spool/sms:
total 28
drwxrwxrwx 2 www-data www-data 4096 Sep  2 12:44 checked
drwxrwxrwx 5 www-data www-data 4096 Sep  2 13:35 backup
drwxrwxrwx 2 www-data www-data 4096 Sep  3 20:46 failed
drwxrwxrwx 2 www-data www-data 4096 Sep  4 13:49 incoming
drwxrwxrwx 2 www-data www-data 4096 Sep  5 15:37 outgoing
drwxrwxrwx 2 www-data www-data 4096 Sep  5 15:37 sent
drwxrwxrwx 2 www-data www-data 4096 Sep  5 15:37 modem1

/var/spool/sms/checked:
total 0

/var/spool/sms/backup:
total 12
drwxrwxrwx 2 www-data www-data 4096 Sep  2 20:13 failed
drwxrwxrwx 2 www-data www-data 4096 Sep  4 13:49 incoming
drwxrwxrwx 2 www-data www-data 4096 Sep  5 15:16 sent

/var/spool/sms/backup/failed:
total 4
-rwxrwxrwx 1 www-data www-data 205 Sep  2 20:13 out.20170902180659.0.1.5

/var/spool/sms/backup/incoming:
total 24
-rwxrwxrwx 1 www-data www-data 180 Sep  2 21:21 modem1.8zQs3w
-rwxrwxrwx 1 www-data www-data 251 Sep  2 21:21 modem1.cASf2P
-rwxrwxrwx 1 www-data www-data 252 Sep  4 13:49 modem1.cY8NyU

/var/spool/sms/backup/sent:
total 80
-rwxrwxrwx 1 www-data www-data 193 Sep  4 13:47 out.20170904114728.0.1.1
-rwxrwxrwx 1 www-data www-data 253 Sep  4 16:32 out.20170904143202.0.1.2
-rwxrwxrwx 1 www-data www-data 253 Sep  5 15:16 out.20170905131603.0.1.3
-rwxrwxrwx 1 www-data www-data 253 Sep  5 15:16 out.20170905131603.0.1.4

/var/spool/sms/failed:
total 44
-rwxrwxrwx 1 www-data www-data 188 Sep  2 20:38 send_Kr8jMv
-rwxrwxrwx 1 www-data www-data  98 Sep  2 20:45 send_mGCCDT
-rwxrwxrwx 1 www-data www-data  97 Sep  2 20:45 send_6I691g

/var/spool/sms/incoming:
total 0

/var/spool/sms/outgoing:
total 0

/var/spool/sms/sent:
total 40
-rwxrwxrwx 1 www-data www-data 135 Sep  2 12:49 send_QKToY1
-rwxrwxrwx 1 www-data www-data 136 Sep  2 13:02 send_TGGpX5
-rwxrwxrwx 1 www-data www-data 142 Sep  2 20:37 send_mI6lvu
-rwxrwxrwx 1 www-data www-data 136 Sep  2 20:47 send_kARqqi
-rw-r--r-- 1 root     root     136 Sep  5 15:37 send_9Ka0VL

playsms logs doesn't show anything abnormal, no errors. Notice how the last sent message is under root user, I believe this happens because it was sent after I manually set permission to www-data and smstools is run at system startup as root.

Do you have any suggestions on what I could try to get this working correctly? it's pretty annoying not seeing the messages you've sent and their status. It's just not practical to check the logs.


Solution

  • I got it working by re-installing Ubuntu 16.04 server (this might or might not have been necessary, but I wanted to start fresh). Next I followed the instructions given here to install apache2, php7 and all the required modules, but i skipped installing Nginx because I don't need it.

    I also skipped steps 5 and 6 because I don't use Nginx. After finishing those steps I installed smstools 3.1.21 following the instructions given here.

    This got everything working like it should, folder are now populated with messages as expected.