LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-06-2015, 12:11 AM   #1
alanstead
LQ Newbie
 
Registered: Aug 2015
Posts: 4

Rep: Reputation: Disabled
Trouble getting mysql trigger to connect to d-bus session


I have a qt app with a mysql backend. I want the app to get updated whenever the database changes, as I'm planning on having other methods to change the db.
I've successfully installed the lib_mysqludf_sys UDF which allows mysql triggers to run commands via sys_exec or sys_eval. I was hoping to have the sql trigger run a small program which would connect to my main qt app over a d-bus session to force an update in the app without having to do a bunch of polling.
When I try and connect to the d-bus session I get the following error:
Cannot connect to the D-Bus session bus.

I also get an error about connecting to display:0, and I've somewhat worked around that by running: xhost +local:mysql

I figured I'd post something since I've been stuck on this for a couple days now, but I have found the following, which seems like it might be on the right track:
http://unix.stackexchange.com/questi...the-session-id

Thanks.
 
Old 08-06-2015, 03:03 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599
Quote:
Originally Posted by alanstead View Post
I've successfully installed the lib_mysqludf_sys UDF which allows mysql triggers to run commands via sys_exec or sys_eval. I was hoping to have the sql trigger run a small program which would connect to my main qt app over a d-bus session to force an update in the app without having to do a bunch of polling.
When I try and connect to the d-bus session I get the following error: Cannot connect to the D-Bus session bus.
I haven't the faintest clue but that never stopped me from asking questions ;-p
- What's your OS and release?
- Can you run any of the example UDFs like touching a file?
- Does dbus run?
- Do you get the right dbus session?
- Can you perform any other action within that right dbus session, say a dbus-launch?
- What's the actual dbus command you're trying to trigger with the UDF?
- Do you know how to run dbus and that trigger in debug mode?
 
Old 08-06-2015, 07:00 PM   #3
alanstead
LQ Newbie
 
Registered: Aug 2015
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks for the reply! Here

- What's your OS and release?
I'm using debian, kernel 3.16.0-4

- Can you run any of the example UDFs like touching a file?
Yes, I've successfully run 'touch /tmp/blah.txt', and stuff like 'pwd' and 'whoami'

- Does dbus run?
It's running fine when I just launch my Qt app using a non-mysql user. I can run the app which establishes the dbus session, then run it again with a parameter to signal a message to the first instance and it works fine.

- Do you get the right dbus session?
When I run it as mysql (just creating a bash session using mysql or using the UDF) it doesnt connect to dbus at all.

- Can you perform any other action within that right dbus session, say a dbus-launch?
dbus-launch was having issues, will try that some more. I was previously using my qt app.

- What's the actual dbus command you're trying to trigger with the UDF?
I'm trying to run the qt app, but going to try and use dbus-launch.

- Do you know how to run dbus and that trigger in debug mode?
No, I'll look into it.
 
Old 08-07-2015, 01:00 AM   #4
alanstead
LQ Newbie
 
Registered: Aug 2015
Posts: 4

Original Poster
Rep: Reputation: Disabled
I was able to see the everything and run the methods using dbus-send and d-feet using my normal user account.
When I use the mysql account, d-feet is able to load the system bus but not the session bus.

I'll see if I can switch it to use the system bus.
 
Old 08-07-2015, 01:44 AM   #5
alanstead
LQ Newbie
 
Registered: Aug 2015
Posts: 4

Original Poster
Rep: Reputation: Disabled
Switching to a system bus seems to be working. Thanks!
 
Old 08-07-2015, 11:40 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599
Thanks for posting your solution.
Please mark thread solved.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DBUS - Is it possible to have 2 instance of session bus or something similar? manojjk Programming 0 12-07-2012 05:44 PM
Dbus System bus and Session bus mainloops deimus Linux - Distributions 0 08-20-2010 06:49 AM
[SOLVED] No DBUS session-bus found Widgeteye Slackware 1 06-22-2010 03:46 PM
error msg"Coud not acquire name on session bus" always when try to connect Ubuntu vnc ayongying Linux - Newbie 1 03-03-2010 02:42 AM
Session D-Bus not accessible poobaire Linux - Newbie 0 05-21-2009 06:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration