<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Do I understand correctly that the dbus daemons run as usual
      systemd --user daemons and simply communicate over dbus?<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 18.02.2018 22:59, Kimmo Lindholm
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:HE1PR0701MB26516038E4C7E257C2ED0596FAC90@HE1PR0701MB2651.eurprd07.prod.outlook.com">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML-esimuotoiltu Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
span.HTML-esimuotoiltuChar
        {mso-style-name:"HTML-esimuotoiltu Char";
        mso-style-priority:99;
        mso-style-link:HTML-esimuotoiltu;
        font-family:Consolas;
        color:black;}
span.Shkpostityyli21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 2.0cm 70.85pt 2.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span
            style="color:windowtext;mso-fareast-language:EN-US">One
            small daemon you can take a look is my call fhasher
            <a href="https://github.com/kimmoli/callflasher"
              moz-do-not-send="true">https://github.com/kimmoli/callflasher</a><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="color:windowtext;mso-fareast-language:EN-US">for
            complex one, take a look at tohkbd2 . it has 2 daemons,
            system and user, and ui app that all communicate together
            over dbus<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="color:windowtext;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
            style="color:windowtext;mso-fareast-language:EN-US">-kimmo<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="color:windowtext;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
        <div>
          <div style="border:none;border-top:solid #E1E1E1
            1.0pt;padding:3.0pt 0cm 0cm 0cm">
            <p class="MsoNormal"><b><span style="color:windowtext">Lähettäjä:</span></b><span
                style="color:windowtext"> Devel
                [<a class="moz-txt-link-freetext" href="mailto:devel-bounces@lists.sailfishos.org">mailto:devel-bounces@lists.sailfishos.org</a>]
                <b>Puolesta </b>Marcin Mielniczuk<br>
                <b>Lähetetty:</b> sunnuntai 18. helmikuuta 2018 21.29<br>
                <b>Vastaanottaja:</b> Adam Pigg
                <a class="moz-txt-link-rfc2396E" href="mailto:adam@piggz.co.uk"><adam@piggz.co.uk></a>; Sailfish OS Developers
                <a class="moz-txt-link-rfc2396E" href="mailto:devel@lists.sailfishos.org"><devel@lists.sailfishos.org></a><br>
                <b>Aihe:</b> Re: [SailfishDevel] Keep an application
                running without keeping the window open<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal" style="margin-bottom:12.0pt">Is there any
          minimal example I could take a look at? I've never done
          anything more with dbus than dbus-send.
          <o:p></o:p></p>
        <div>
          <p class="MsoNormal">On 17.02.2018 22:06, Adam Pigg wrote:<o:p></o:p></p>
        </div>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <div>
            <div>
              <p class="MsoNormal" style="margin-bottom:12.0pt">Hi<br>
                <br>
                You could create a dbus service for the application to
                talk to.  The gui application can launch the dbus
                service if it isnt running, and connect next time it is
                opened, leaving it running in the background.<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal">Adam<o:p></o:p></p>
            </div>
            <p class="MsoNormal"><o:p> </o:p></p>
            <div>
              <div>
                <p class="MsoNormal">On Sat, 17 Feb 2018 at 20:58
                  rinigus <<a href="mailto:rinigus.git@gmail.com"
                    target="_blank" moz-do-not-send="true">rinigus.git@gmail.com</a>>
                  wrote:<o:p></o:p></p>
              </div>
              <blockquote style="border:none;border-left:solid #CCCCCC
                1.0pt;padding:0cm 0cm 0cm
                6.0pt;margin-left:4.8pt;margin-right:0cm">
                <div>
                  <p class="MsoNormal">Hi, <o:p></o:p></p>
                  <div>
                    <p class="MsoNormal"><o:p> </o:p></p>
                  </div>
                  <div>
                    <p class="MsoNormal">from the point of view of
                      portability, having a split GUI and backend should
                      be nicely portable. Even focusing on systemd would
                      cover large portion of Linux distributions, but
                      you don't have to include any systemd dependencies
                      as such. On desktop, it would allow you to move
                      the backend into dedicated hardware, if you wish.
                      Also, it would survive X11 crashes as a bonus. So,
                      if you plan to run it 24x7, service running on the
                      background is a good way of doing it.<o:p></o:p></p>
                  </div>
                  <div>
                    <p class="MsoNormal"><o:p> </o:p></p>
                  </div>
                  <div>
                    <p class="MsoNormal">But maybe someone has better
                      idea.<o:p></o:p></p>
                  </div>
                  <div>
                    <p class="MsoNormal"><o:p> </o:p></p>
                  </div>
                  <div>
                    <p class="MsoNormal">Cheers,<o:p></o:p></p>
                  </div>
                  <div>
                    <p class="MsoNormal"><o:p> </o:p></p>
                  </div>
                  <div>
                    <p class="MsoNormal">Rinigus<o:p></o:p></p>
                  </div>
                </div>
                <div>
                  <p class="MsoNormal"><o:p> </o:p></p>
                  <div>
                    <p class="MsoNormal">On Sat, Feb 17, 2018 at 9:16
                      PM, Marcin Mielniczuk <<a
                        href="mailto:marmistrzmar@gmail.com"
                        target="_blank" moz-do-not-send="true">marmistrzmar@gmail.com</a>>
                      wrote:<o:p></o:p></p>
                    <blockquote style="border:none;border-left:solid
                      #CCCCCC 1.0pt;padding:0cm 0cm 0cm
                      6.0pt;margin-left:4.8pt;margin-right:0cm">
                      <div>
                        <p>I'm not sure if that's a good choice when
                          trying to achieve portability. Usually on
                          desktop you'd rather have a monolithic
                          application with just minimize to tray.<o:p></o:p></p>
                        <p>Any other options?<o:p></o:p></p>
                        <div>
                          <div>
                            <p class="MsoNormal"><o:p> </o:p></p>
                            <div>
                              <p class="MsoNormal">On 05.02.2018 10:33,
                                rinigus wrote:<o:p></o:p></p>
                            </div>
                            <blockquote
                              style="margin-top:5.0pt;margin-bottom:5.0pt">
                              <div>
                                <p class="MsoNormal">Hi, <o:p></o:p></p>
                                <div>
                                  <p class="MsoNormal"><o:p> </o:p></p>
                                </div>
                                <div>
                                  <p class="MsoNormal">the obvious
                                    solution is to run service that is
                                    24/7 on and separate client for GUI.
                                    That's what stock messaging is
                                    doing. I would recommend it and use
                                    some simple messaging API for
                                    communicating between them. There
                                    are probably many APIs to choose
                                    that will allow you to set it up
                                    simply.<o:p></o:p></p>
                                </div>
                                <div>
                                  <p class="MsoNormal"><o:p> </o:p></p>
                                </div>
                                <div>
                                  <p class="MsoNormal">If you can
                                    withstand short shutdown of the
                                    service then you can combine it into
                                    the same application. It would
                                    require that application will start
                                    in GUI or server mode depending on
                                    command line option. If started in
                                    GUI mode, you would have to <o:p></o:p></p>
                                </div>
                                <div>
                                  <p class="MsoNormal"><o:p> </o:p></p>
                                </div>
                                <div>
                                  <p class="MsoNormal">* shut down
                                    service via systemd<o:p></o:p></p>
                                </div>
                                <div>
                                  <p class="MsoNormal">* establish new
                                    connections<o:p></o:p></p>
                                </div>
                                <div>
                                  <p class="MsoNormal"><o:p> </o:p></p>
                                </div>
                                <div>
                                  <p class="MsoNormal">and on GUI exit
                                    you would have to <o:p></o:p></p>
                                </div>
                                <div>
                                  <p class="MsoNormal"><o:p> </o:p></p>
                                </div>
                                <div>
                                  <p class="MsoNormal">* drop all
                                    connections<o:p></o:p></p>
                                </div>
                                <div>
                                  <p class="MsoNormal">* start service
                                    via systemd<o:p></o:p></p>
                                </div>
                                <div>
                                  <p class="MsoNormal"><o:p> </o:p></p>
                                </div>
                                <div>
                                  <p class="MsoNormal">The latter is the
                                    way OSM Scout Server works with the
                                    adjustment that its using systemd
                                    sockets to keep it switched off when
                                    user is not accessing it. Note that
                                    it was done for historical reasons
                                    (signaling between parts was
                                    implemented via Qt) and since its
                                    mostly used as a service anyway
                                    (users don't need to access GUI for
                                    weeks).<o:p></o:p></p>
                                </div>
                                <div>
                                  <p class="MsoNormal"><o:p> </o:p></p>
                                </div>
                                <div>
                                  <p class="MsoNormal">I would still
                                    recommend splitting service/GUI
                                    parts and use some messaging
                                    protocol in between. Myself I would
                                    have used zeromq, but you could
                                    choose probably many others.<o:p></o:p></p>
                                </div>
                                <div>
                                  <p class="MsoNormal"><o:p> </o:p></p>
                                </div>
                                <div>
                                  <p class="MsoNormal">Cheers,<o:p></o:p></p>
                                </div>
                                <div>
                                  <p class="MsoNormal"><o:p> </o:p></p>
                                </div>
                                <div>
                                  <p class="MsoNormal">Rinigus<o:p></o:p></p>
                                </div>
                              </div>
                              <div>
                                <p class="MsoNormal"><o:p> </o:p></p>
                                <div>
                                  <p class="MsoNormal">On Mon, Feb 5,
                                    2018 at 11:17 AM, Marcin Mielniczuk
                                    <<a
                                      href="mailto:marmistrzmar@gmail.com"
                                      target="_blank"
                                      moz-do-not-send="true">marmistrzmar@gmail.com</a>>
                                    wrote:<o:p></o:p></p>
                                  <blockquote
                                    style="border:none;border-left:solid
                                    #CCCCCC 1.0pt;padding:0cm 0cm 0cm
                                    6.0pt;margin-left:4.8pt;margin-right:0cm">
                                    <p class="MsoNormal">Hi,<br>
                                      <br>
                                      When creating SFOS applications
                                      which should run 24/7 (e.g. IMs)
                                      we<br>
                                      would like to achieve similar
                                      behavior as the stock
                                      applications, e.g.<br>
                                      the stock e-mail client: the sync
                                      (*) runs in the background, even<br>
                                      though the application is closed.
                                      A window staying open just to make<br>
                                      sure the sync goes on clutters the
                                      open app view and makes it more<br>
                                      difficult to manage the open
                                      applications.<br>
                                      <br>
                                      On a desktop DE one would simply
                                      minimize the application to tray.<br>
                                      Alternatively, one could create a
                                      daemon which the client app would<br>
                                      communicate with using UNIX
                                      sockets, but it greatly increases
                                      the<br>
                                      complexity of the application and
                                      slows down the development.<br>
                                      <br>
                                      What's the easiest way to keep the
                                      sync process in the background<br>
                                      without keeping the window open?<br>
                                      <br>
                                      Regards,<br>
                                      Marcin<br>
                                      <br>
                                      (*) when speaking sync, I mean any
                                      kind of waiting for a remote
                                      event,<br>
                                      no matter if it's done by idle TCP
                                      (which is good) or HTTP polling<br>
                                      (which is not good)<br>
                                      <br>
                                      <br>
_______________________________________________<br>
                                      SailfishOS.org Devel mailing list<br>
                                      To unsubscribe, please send a mail
                                      to <a
                                        href="mailto:devel-unsubscribe@lists.sailfishos.org"
                                        target="_blank"
                                        moz-do-not-send="true">
devel-unsubscribe@lists.sailfishos.org</a><o:p></o:p></p>
                                  </blockquote>
                                </div>
                                <p class="MsoNormal"><o:p> </o:p></p>
                              </div>
                              <p class="MsoNormal"><br>
                                <br>
                                <o:p></o:p></p>
                              <pre>_______________________________________________<o:p></o:p></pre>
                              <pre>SailfishOS.org Devel mailing list<o:p></o:p></pre>
                              <pre>To unsubscribe, please send a mail to <a href="mailto:devel-unsubscribe@lists.sailfishos.org" target="_blank" moz-do-not-send="true">devel-unsubscribe@lists.sailfishos.org</a><o:p></o:p></pre>
                            </blockquote>
                            <p class="MsoNormal"><o:p> </o:p></p>
                          </div>
                        </div>
                      </div>
                    </blockquote>
                  </div>
                  <p class="MsoNormal"><o:p> </o:p></p>
                </div>
                <p class="MsoNormal">_______________________________________________<br>
                  SailfishOS.org Devel mailing list<br>
                  To unsubscribe, please send a mail to <a
                    href="mailto:devel-unsubscribe@lists.sailfishos.org"
                    target="_blank" moz-do-not-send="true">
                    devel-unsubscribe@lists.sailfishos.org</a><o:p></o:p></p>
              </blockquote>
            </div>
          </div>
        </blockquote>
        <p class="MsoNormal"><o:p> </o:p></p>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to <a class="moz-txt-link-abbreviated" href="mailto:devel-unsubscribe@lists.sailfishos.org">devel-unsubscribe@lists.sailfishos.org</a></pre>
    </blockquote>
    <br>
  </body>
</html>