<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v = 
"urn:schemas-microsoft-com:vml" xmlns:o = 
"urn:schemas-microsoft-com:office:office" xmlns:w = 
"urn:schemas-microsoft-com:office:word"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3395" name=GENERATOR><!--[if !mso]>
<STYLE>v\:* {
        BEHAVIOR: url(#default#VML)
}
o\:* {
        BEHAVIOR: url(#default#VML)
}
w\:* {
        BEHAVIOR: url(#default#VML)
}
.shape {
        BEHAVIOR: url(#default#VML)
}
</STYLE>
<![endif]-->
<STYLE>@font-face {
        font-family: Tahoma;
}
@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.EmailStyle17 {
        FONT-WEIGHT: normal; COLOR: blue; FONT-STYLE: normal; FONT-FAMILY: Arial; TEXT-DECORATION: none; mso-style-type: personal-reply
}
DIV.Section1 {
        page: Section1
}
</STYLE>
</HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV dir=ltr align=left><SPAN class=250471322-23092008><FONT face=Arial 
color=#0000ff size=2>Hi Sandeep,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=250471322-23092008><FONT face=Arial 
color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp; I have made the following fix into 
upstart to get this work.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=250471322-23092008><FONT face=Arial 
color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Made the following code 
sengment into a function.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=250471322-23092008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=250471322-23092008><FONT face=Arial 
color=#0000ff size=2>In the event_finished() function, I look for a "started" 
event for a special Job called "systembus"</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=250471322-23092008><FONT face=Arial 
color=#0000ff size=2>When the systembus job moves into started, I try to connect 
to the dbus again.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=250471322-23092008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=250471322-23092008><FONT face=Arial 
color=#0000ff size=2>This means that some one has to define a special upstart 
job file called "systembus" which will start the D-Bus daemon. 
</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=250471322-23092008><FONT face=Arial 
color=#0000ff size=2>And Upstart Iit will try to connect to it when it sees the 
started event for that special job.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=250471322-23092008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=250471322-23092008><FONT face=Arial 
color=#0000ff size=2>This works fine and I am able to create a dbus-glib client 
that is able to connect and query Upstart through DBus.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=250471322-23092008><FONT face=Arial 
color=#0000ff size=2>Haven;t tested signals yet. Thats next on the 
list.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=250471322-23092008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=250471322-23092008><FONT face=Arial 
color=#0000ff size=2>Is this approach reasonable. Once I am done can I send this 
as a patch over for integration</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=250471322-23092008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=250471322-23092008><FONT face=Arial 
color=#0000ff size=2>Sarvi</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> upstart-devel-bounces@lists.ubuntu.com 
[mailto:upstart-devel-bounces@lists.ubuntu.com] <B>On Behalf Of </B>Sandeep 
Puddupakkam (spuddupa)<BR><B>Sent:</B> Tuesday, September 23, 2008 3:10 
PM<BR><B>To:</B> upstart-devel@lists.ubuntu.com<BR><B>Subject:</B> RE: I don't 
see dbus-daemon being started by dbus?<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Has anyone successfully 
coded and used a dbus client for upstart using dbus-glib and talked to 
upstart?<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">We are not able to use 
dbus to connect to upstart.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">I see the following 
comment and code in init/main.c<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
/* Open connection to the system bus; we normally expect this 
to<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;* fail and will try again later - don't let ENOMEM stop us 
though.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;*/<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
while (control_bus_open () &lt; 0) {<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
NihError *err;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; number;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
err = nih_error_get ();<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; number = 
err-&gt;number;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
nih_free (err);<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
if (number != ENOMEM)<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
break;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Dbus-daemon is started 
from a job file and the above code is executed well before the job files are 
started. <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">I however don&#8217;t see 
code any place else that tries to connect to dbus-daemon later on as suggested 
in the comment above.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Is this functionality 
working or it needs to be fixed?<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Any pointers would be 
greatly appreciated.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Thanks,<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Sandeep<o:p></o:p></SPAN></FONT></P>
<DIV>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT 
face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal><B><FONT face=Tahoma size=2><SPAN 
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT 
face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"> 
upstart-devel-bounces@lists.ubuntu.com 
[mailto:upstart-devel-bounces@lists.ubuntu.com] <B><SPAN 
style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Saravanan Shanmugham 
(sarvi)<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Friday, September 
12, 2008 1:07 AM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> 
upstart-devel@lists.ubuntu.com<BR><B><SPAN 
style="FONT-WEIGHT: bold">Subject:</SPAN></B> I don't see dbus-daemon being 
started by dbus?</SPAN></FONT><o:p></o:p></P></DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
style="FONT-SIZE: 12pt"><o:p>&nbsp;</o:p></SPAN></FONT></P>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I am trying to write a dbus-glib 
client to talk to dbus.</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I have upstart running but don't see 
the dbus-daemon running. </SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The code inside init in main.c seems 
be attempting to connect to dbus-daemon. but i don't see it being started 
anywhere.</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Now when i try to define a job for 
dbus-daemon to be started, I don't see any code inside of dbus that tries to 
connect to </SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">dbus-daemon except the one mentioned 
above which seems to be doing it a little too early be able to work with a job 
file.</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Am I missing something, or does 
upstart doesn't yet work with dbus?</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Thx,</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Sarvi</SPAN></FONT><o:p></o:p></P></DIV></DIV></BODY></HTML>