[systemd-devel] systemd service not connecting to session dbus
Jérémy Rosen
jeremy.rosen at smile.fr
Mon Aug 13 08:10:21 UTC 2018
There are two types of systemd instances
* system instance (PID1) which controls the machine as a whole
* user instances that are started when the user logs in.
You seem to have a system service (started by the system session). A
system service can't (easily) access the user bus.
The session bus is started by the user instance when the user login. If
the user hasn't logged in yet, the bus isn't started.
Moreover, the user bus is found via an environment variable, which is
not set for system services (even when User= is used)
What are you trying to do exactly ? should your service be a session
service ?
Regards
Jeremy
On 13/08/2018 09:17, Deepan Muthusamy wrote:
> I have an application which has to communicate with session dbus. If I start my application binary manually or start using Init.d, it is connecting to session d-bus.
>
> But if I start my application through systemd, it is failing to start. I tried to start using systemctl start my-service-name, this time also it is failing.
>
>
> And also I go through the answer given by keithel in https://serverfault.com/questions/892465/starting-systemd-services-sharing-a-session-d-bus-on-headless-system .
>
> Still Iam facing the same error.
>
>
> The .service fail is as follows:
>
>
> [Unit]
> Requires= dbus.socket
> After= dbus.socket
>
> [Service]
> Type=dbus
> BusName=org.client
> ExecStart=/usr/local/bin/myExe
> TimeoutSec=300
> WatchdogSec=20
>
> [Install]
> WantedBy=basic.target
>
>
> Operating system:
> Ubuntu 16.04 (64-bit)
>
>
>
>
>
>
>
>
>
> DEEPAN MUTHUSAMY,
> TATA CONSULTANCY SERVICE,
> mobile no: +91 8012309210
> =====-----=====-----=====
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain
> confidential or privileged information. If you are
> not the intended recipient, any dissemination, use,
> review, distribution, printing or copying of the
> information contained in this e-mail message
> and/or attachments to it are strictly prohibited. If
> you have received this communication in error,
> please notify us by reply e-mail or telephone and
> immediately and permanently delete the message
> and any attachments. Thank you
>
>
>
>
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
SMILE <http://www.smile.eu/>
20 rue des Jardins
92600 Asnières-sur-Seine
*Jérémy ROSEN*
Architecte technique
Responsable de l'expertise Smile-ECS
email jeremy.rosen at smile.fr <mailto:jeremy.rosen at smile.fr>
phone +33141402967
url http://www.smile.eu
Twitter <https://twitter.com/GroupeSmile> Facebook
<https://www.facebook.com/smileopensource> LinkedIn
<https://www.linkedin.com/company/smile> Github
<https://github.com/Smile-SA>
Découvrez l’univers Smile, rendez-vous sur smile.eu
<http://smile.eu/?utm_source=signature&utm_medium=email&utm_campaign=signature>
eco Pour la planète, n'imprimez ce mail que si c'est nécessaire
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20180813/85c77428/attachment.html>
More information about the systemd-devel
mailing list