LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-01-2016, 10:25 PM   #1
oddasee
LQ Newbie
 
Registered: Mar 2016
Posts: 3

Rep: Reputation: Disabled
help with dbus-daemon


I develop c++ apps on Linux . I understand c++ but only somewhat Linux. I use Fedora 23.

Every time I call posix_spawn, the OS boots a new copy of dbus-daemon together with the spawned application. When the app terminates the daemon remains resident.

ANY clues as to what is going on would be appreciated.

And, Being a newbie, suggestions as to the appropriate forum to direct this question would be helpful.

Thanks.
 
Old 03-03-2016, 10:13 AM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,654

Rep: Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255
I think it is going to depend on what the file actions side effects are. If a connection to dbus is continued, then a new identity for that connection should be present, and that could cause another dbus daemon to be spawned to handle it.
 
Old 03-05-2016, 12:48 PM   #3
oddasee
LQ Newbie
 
Registered: Mar 2016
Posts: 3

Original Poster
Rep: Reputation: Disabled
Hmmm. Thanks for the reply. As I say the dbus is a mystery to me. Complete.

In previous versions of fedora I ran the identical posix_spawn code without dbus-daemons being launched, at least not visibly in the gnome-system-monitor. The dbus daemons only appeared somewhere around fedora 22 or fedora 23. They weren't there in earlier fedora releases, eg 15.


I don't understand why a call to posix_spawn launches a dbus session. I certainly didn't request it. The apps I build use QT, and they all talk to each other via TCP/IP . QTWebKit is also linked.

The apps have read/write/execute access to the disk, and the TCP/IP interfaces open and close on each message. I don't do any fancy file sharing between parent and child processes. The launched apps operate independently of the parent.

What might cause a new identity for the connection to be generated ?

Could it be in the environment variables? I pass these environmental variables to posix_spawn:

USERNAME
USER
PATH
LD_LIBRARY_PATH
DISPLAY
DESKTOP_SESSION
HOME
XAUTHORITY

My understanding is that all my apps should be using the dbus attached to my gnome user session, and, not launching new ones at all.
 
Old 03-23-2016, 11:01 PM   #4
oddasee
LQ Newbie
 
Registered: Mar 2016
Posts: 3

Original Poster
Rep: Reputation: Disabled
No answers, I observe. To solve my problem practically I did the following.



(1) put a .desktop file in /.config/autostart to call a bash file
(2) have that bash script
(a) write the dbus-daemon pids at startup to a file.
(b) periodically kill all dbus-daemon pids not matching the original set

For those, like myself, who appreciate, but don't really "get" bash, I've include the 3 scripts I use

// manage-dbus:

pgrep -f dbus-daemon > /home/aurel/dbus-pids
sleep 60
do-dbus-cleanup &


// do-dbus-cleanup :

while true ; do
clean-dbus
sleep 60
done

// clean-dbus :


while read line ; do
pids+=" $line "
done < ~/dbus-pids
echo $pids
now=$( pgrep -f dbus-daemon )
echo $now
for p in $now
do
echo $p
if [[ $pids == *" $p "* ]]
then
echo "$p found"
else
kill -9 $p
fi
done

Any votes as to whether my login-session is incorrectly defined would be appreciated. Alternately, if it is a fedora/gnome problem.
The solution to run a clean up script was suggested in other posts.
 
Old 06-28-2016, 09:50 PM   #5
sheebuk
LQ Newbie
 
Registered: Jun 2016
Posts: 1

Rep: Reputation: Disabled
@oddasee, May I know how did you pass the environment variables to posix_spawn? It would be helpful with an example.
 
  


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-daemon hogging CPU Linux Mint 12 dsschanze Linux - Desktop 1 06-10-2012 07:13 PM
dbus-daemon is stopping applications from opening KickMeElmo Ubuntu 1 09-10-2011 06:45 PM
Running current + Alien Bob's KDE4.6 pkg. Dbus Daemon uses 50% processor. vdemuth Slackware 1 03-01-2011 08:14 PM
Dbus-daemon hogging on RAM usage Shark82 Linux - Desktop 3 01-20-2011 09:00 PM
[SOLVED] -current dbus-daemon shows Reject messages danielldaniell Slackware 4 08-03-2009 04:36 AM


All times are GMT -5. The time now is 01:17 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration