Author |
Post |
|
#1 Fri Feb 03, 2017 06:03, 95 months ago.
|
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.
|
|
#2 Fri Feb 03, 2017 14:13, 95 months ago.
|
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.
|
|
#3 Sat Feb 04, 2017 09:51, 95 months ago.
|
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.
|
|
#4 Sat Feb 04, 2017 16:09, 95 months ago.
|
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
|
|
#5 Mon Feb 06, 2017 04:49, 95 months ago.
|
Member
Registered: Feb 2017
Location: Lahore, Punjab, Pakistan
Topic owner
|
Thanks keke, it worked . Thanks for your quick response.
|
|
#6 Wed Jul 15, 2020 13:01, 54 months ago.
|
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, 54 months ago. »
|