From gomes, 1 Year ago, written in Plain Text.
  1. Hi guys,
  2.  
  3. i wrote a C++ application which creates a dbus service using QtDbus. Then i wrote both my-service.service (which i placed in /etc/systemd/system) and my-dbus-service.service(which i placed in /usr/share/dbus-1/system-services)
  4.  
  5. Both files are the following:
  6.  
  7. my-service.service
  8.  
  9. [Unit]
  10. Description=Natasha application
  11. After=network.target dbus.service
  12.  
  13. [Service]
  14. Type=dbus
  15. BusName=org.natasha.restapi
  16. ExecStart=/home/nucleus/natasha
  17. StandardOutput=inherit
  18. StandardError=inherit
  19. Restart=on-failure
  20. RestartSec=1s
  21. TimeoutStopSec=infinity
  22. User=pi
  23. [Install]
  24. WantedBy=multi-user.target
  25.  
  26.  
  27.  
  28. my-dbus-service.service
  29.  
  30. [D-BUS Service]
  31. Name=org.natasha.restapi
  32. Exec=/home/nucleus/natasha
  33. SystemdService=natasha.service
  34.  
  35.  
  36. I had to set the user as 'pi' because of X11 that was unable to launch dbus-service with root user.
  37.  
  38. I'm currently running a debian on a Raspberry pi 3 and the follow output is driving me insane:
  39.  
  40. systemctl status my-service
  41.  
  42. natasha.service - Natasha application
  43.    Loaded: loaded (/etc/systemd/system/natasha.service; enabled; vendor preset: enabled)
  44.    Active: activating (start) since Wed 2018-07-04 18:50:41 UTC; 55s ago
  45.  Main PID: 4102 (natasha)
  46.    CGroup: /system.slice/natasha.service
  47.            ├─4102 /home/nucleus/natasha
  48.            ├─4108 dbus-launch --autolaunch 5e721b8082c341998329d19e29afee61 --binary-syntax --close-stderr
  49.            └─4109 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
  50.  
  51. Jul 04 18:50:41 raspberrypi systemd[1]: Starting Natasha application...
  52.  
  53.  
  54. and journalctl -u my-service
  55.  
  56. Jul 04 15:22:54 raspberrypi systemd[1]: Starting Natasha application...
  57. Jul 04 15:24:24 raspberrypi systemd[1]: natasha.service: Start operation timed out. Terminating.
  58. Jul 04 15:24:24 raspberrypi systemd[1]: Failed to start Natasha application.
  59. Jul 04 15:24:24 raspberrypi systemd[1]: natasha.service: Unit entered failed state.
  60. Jul 04 15:24:24 raspberrypi systemd[1]: natasha.service: Failed with result 'timeout'.
  61. Jul 04 15:24:25 raspberrypi systemd[1]: natasha.service: Service hold-off time over, scheduling restart.
  62. Jul 04 15:24:25 raspberrypi systemd[1]: Stopped Natasha application.
  63. Jul 04 15:24:25 raspberrypi systemd[1]: Starting Natasha application...
  64.  
  65.  
  66. my-service = natasha.service
  67.  
  68.  
  69. Can anyone help me out? My application is unable to complete its start up.
  70.  
  71. Thank you guys.
captcha