SMS Server Tools 3
This site is hosted by Kekekasvi.com
 Menu
Basic information:
Additional information:
Support:
Get SMS Server Tools 3:
Additional Options

 Sponsored links

 Search
Custom Search

 Visitor locations
 
 SMS Server Tools 3 Community
Welcome, Guest. Please login or register. Thu Mar 28, 2024 23:53
SMSTools3 Community » Help and support Bottom

[solved] mysmsd not work with cygrunsrv

Login and Post Reply

Page:  1

Author Post
Member
Registered:
Feb 2017
Location: Lahore, Punjab, Pakistan
Hi Keke,
I am observing a problem with event handler to store data in MySQL. In smsd.confg eventhandler = /usr/local/bin/mysmsd
mysmsd works fine when it runs from smsd using cygwin bash shell. But when i run smsd as windows service using cygrunsrv it encountered an error which showed in log file as under:
2017-02-03 10:09:59,7, GSM1: Running eventhandler: /usr/local/bin/mysmsd SENT /var/spool/sms/sent/test.txt 59
2017-02-03 10:10:04,3, GSM1: Done: eventhandler, execution time 5 sec., status: 32512 (127)
2017-02-03 10:10:04,3, GSM1: Exec: eventhandler encountered errors:
2017-02-03 10:10:04,3, GSM1: ! /usr/local/bin/mysmsd: line 37: mysql: command not found
2017-02-03 10:10:04,6, GSM1: ALERT (continues, 2): problem with eventhandler, result 127
when i checked mysmsd the line 37 was mysql $SQL_ARGS \"insert into $SQL_TABLE (type,sent,sender,receiver,msgid,text) values (\\\"$1\\\",\\\"$DATE\\\",\\\"$FROM\\\",\\\"$TO\\\",\\\"$3\\\", \\\"$TEXT\\\");\";
when i run /usr/local/bin/mysmsd SENT /var/spool/sms/sent/test.txt 59 from shell directly it works fine.
can you please help me thanks in advance.

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
In the bash shell type a command which mysql and you can see where it is located.
Add that path to the cygrunsrv --install ... command, or use the full path in your eventhandler. Or modify PATH variable on the top of your eventhandler, like PATH=$PATH:/path/to/mysql.

Member
Registered:
Feb 2017
Location: Lahore, Punjab, Pakistan
Topic owner
my path to mysql shown by bash is /cygdrive/c/Program Files/MySQL/MySQL Server 5.1/bin/mysql how do i configure it.

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Try this:

#!/bin/bash

PATH=$PATH:/cygdrive/c/Program\ Files/MySQL/MySQL\ Server\ 5.1/bin

# Your evenhandler continues here

 
'bash' Syntax Highlight powered by GeSHi


Member
Registered:
Feb 2017
Location: Lahore, Punjab, Pakistan
Topic owner
Thanks keke, it worked . Thanks for your quick response.

Member
Registered:
Feb 2017
Location: Lahore, Punjab, Pakistan
Topic owner
Hello sir, I install cygwin on windows server 2012 and same problem started again. Now mysql path is
/cygdrive/c/Program Files (x86)/MySQL/MySQL Server 5.1/bin/mysql.

how to configure it as a path?

it gives followind error on codeGSM1: ! /usr/src/smstools3/scripts/mysmsd: line 12: syntax error near unexpected token `('


« Last edit by Asif on Wed Jul 15, 2020 13:03, 45 months ago. »

Login and Post Reply

Page:  1

SMSTools3 Community » Help and support Top

 
Time in this board is UTC.  

Privacy Policy   SMS Server Tools 3 Copyright © Keijo Kasvi.