Suggestion to avoid a lot of bamfdaemon failure messages during shutdown

Asked by John Doe

Hi all, during the shutdown, using systemctl poweroff (or poweroff which is a link to systemctl) the X server is stopped before bamfdaemon.service. As bamfdaemon service uses Restart=on-failure the following happens:

-- Reboot --
mars 28 09:33:14 blackhole systemd[1024]: Starting BAMF Application Matcher Framework...
mars 28 09:33:14 blackhole systemd[1024]: Started BAMF Application Matcher Framework.
mars 29 18:07:53 blackhole bamfdaemon[1492]: bamfdaemon: Fatal IO error 11 (Ressource temporairement non disponible) on X server :0.
mars 29 18:07:53 blackhole systemd[1024]: bamfdaemon.service: Main process exited, code=exited, status=1/FAILURE
mars 29 18:07:53 blackhole systemd[1024]: bamfdaemon.service: Failed with result 'exit-code'.
mars 29 18:07:53 blackhole systemd[1024]: bamfdaemon.service: Scheduled restart job, restart counter is at 1.
mars 29 18:07:53 blackhole systemd[1024]: Stopped BAMF Application Matcher Framework.
mars 29 18:07:53 blackhole systemd[1024]: Starting BAMF Application Matcher Framework...
mars 29 18:07:54 blackhole bamfdaemon[146009]: Unable to init server: Impossible de se connecter : Connexion refusée
mars 29 18:07:54 blackhole bamfdaemon[146009]: cannot open display: :0
mars 29 18:07:54 blackhole systemd[1024]: bamfdaemon.service: Main process exited, code=exited, status=1/FAILURE
mars 29 18:07:54 blackhole systemd[1024]: bamfdaemon.service: Failed with result 'exit-code'.
mars 29 18:07:54 blackhole systemd[1024]: Failed to start BAMF Application Matcher Framework.
mars 29 18:07:54 blackhole systemd[1024]: bamfdaemon.service: Scheduled restart job, restart counter is at 2.
mars 29 18:07:54 blackhole systemd[1024]: Stopped BAMF Application Matcher Framework.
mars 29 18:07:54 blackhole systemd[1024]: Starting BAMF Application Matcher Framework...
mars 29 18:07:54 blackhole bamfdaemon[146040]: Unable to init server: Impossible de se connecter : Connexion refusée
mars 29 18:07:54 blackhole bamfdaemon[146040]: cannot open display: :0
mars 29 18:07:54 blackhole systemd[1024]: bamfdaemon.service: Main process exited, code=exited, status=1/FAILURE
mars 29 18:07:54 blackhole systemd[1024]: bamfdaemon.service: Failed with result 'exit-code'.
mars 29 18:07:54 blackhole systemd[1024]: Failed to start BAMF Application Matcher Framework.
mars 29 18:07:54 blackhole systemd[1024]: bamfdaemon.service: Scheduled restart job, restart counter is at 3.
mars 29 18:07:54 blackhole systemd[1024]: Stopped BAMF Application Matcher Framework.
mars 29 18:07:54 blackhole systemd[1024]: Starting BAMF Application Matcher Framework...
mars 29 18:07:54 blackhole bamfdaemon[146043]: Unable to init server: Impossible de se connecter : Connexion refusée
mars 29 18:07:54 blackhole bamfdaemon[146043]: cannot open display: :0
mars 29 18:07:54 blackhole systemd[1024]: bamfdaemon.service: Main process exited, code=exited, status=1/FAILURE
mars 29 18:07:54 blackhole systemd[1024]: bamfdaemon.service: Failed with result 'exit-code'.
mars 29 18:07:54 blackhole systemd[1024]: Failed to start BAMF Application Matcher Framework.
mars 29 18:07:54 blackhole systemd[1024]: bamfdaemon.service: Scheduled restart job, restart counter is at 4.
mars 29 18:07:54 blackhole systemd[1024]: Stopped BAMF Application Matcher Framework.
mars 29 18:07:54 blackhole systemd[1024]: Starting BAMF Application Matcher Framework...
mars 29 18:07:54 blackhole bamfdaemon[146044]: Unable to init server: Impossible de se connecter : Connexion refusée
mars 29 18:07:54 blackhole bamfdaemon[146044]: cannot open display: :0
mars 29 18:07:54 blackhole systemd[1024]: bamfdaemon.service: Main process exited, code=exited, status=1/FAILURE
mars 29 18:07:54 blackhole systemd[1024]: bamfdaemon.service: Failed with result 'exit-code'.
mars 29 18:07:54 blackhole systemd[1024]: Failed to start BAMF Application Matcher Framework.
mars 29 18:07:54 blackhole systemd[1024]: bamfdaemon.service: Scheduled restart job, restart counter is at 5.
mars 29 18:07:54 blackhole systemd[1024]: Stopped BAMF Application Matcher Framework.
mars 29 18:07:54 blackhole systemd[1024]: Starting BAMF Application Matcher Framework...
mars 29 18:07:54 blackhole bamfdaemon[146045]: Unable to init server: Impossible de se connecter : Connexion refusée
mars 29 18:07:54 blackhole bamfdaemon[146045]: cannot open display: :0
mars 29 18:07:54 blackhole systemd[1024]: bamfdaemon.service: Main process exited, code=exited, status=1/FAILURE
mars 29 18:07:54 blackhole systemd[1024]: bamfdaemon.service: Failed with result 'exit-code'.
mars 29 18:07:54 blackhole systemd[1024]: Failed to start BAMF Application Matcher Framework.
mars 29 18:07:54 blackhole systemd[1024]: bamfdaemon.service: Scheduled restart job, restart counter is at 6.
mars 29 18:07:54 blackhole systemd[1024]: Stopped BAMF Application Matcher Framework.
mars 29 18:07:54 blackhole systemd[1024]: bamfdaemon.service: Start request repeated too quickly.
mars 29 18:07:54 blackhole systemd[1024]: bamfdaemon.service: Failed with result 'exit-code'.
mars 29 18:07:54 blackhole systemd[1024]: Failed to start BAMF Application Matcher Framework.

In order to avoid that many restart attempts which will never be successful I suggest using RestartSec=Xs with X to be defined provided it's no trouble to wait a few seconds before each restart attempt in any possible use case i.e. not only at shutdown. Otherwise the default delay is 100ms. Another solution would be making this unit a dependency of some other unit in order to make it stop before X server become unreachable. Obviously that would be the cleanest option but I do not know enough of systemd to make a relevant proposal.

Regards,

Question information

Language:
English Edit question
Status:
Expired
For:
BAMF Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
John Doe (rba777) said :
#1

Question: would it be possible to solve it this way ? and would it be acceptable ?

Revision history for this message
John Doe (rba777) said :
#2

One precision, bamfdaeon.service is started/stopped with the graphical session, as indicated by PartOf=graphical-session.target . That is perfect for people using the mainstream Desktop Environments (KDE and Gnome) however for Openbox users by default there isn't any session manager, that's why this issue appears at shutdown.

Regards,

Revision history for this message
Launchpad Janitor (janitor) said :
#3

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
John Doe (rba777) said :
#4

Do people need to use one of the mainstream DE to be able to benefit from bamfdaemon ? FYI openbox advertise its binary as a «session manager» however it is not one stricto sensu.

Revision history for this message
Launchpad Janitor (janitor) said :
#5

This question was expired because it remained in the 'Open' state without activity for the last 15 days.