Flameshot: "flameshot config" and "flameshot gui" won't start flameshot with recent git snapshot

Created on 22 Feb 2018  Â·  11Comments  Â·  Source: flameshot-org/flameshot

With the git snapsnot on 20180114, I was able to start flameshot indirectly with a call of flameshot config or flameshot gui. However with today's build (20180221), flameshot won't start (or pop-up config window) unless I start flameshot in advance. Otherwise plain call to flameshot config would only return with exit code 0, nothing else happens.

Perhaps we need git bisect to find out which commit introduced this bug?

Most helpful comment

Same here in 6.0 release:
https://github.com/lupoDharkael/flameshot/releases/download/v0.6.0/flameshot_0.6.0_bionic_x86_64.deb

You can fix it by changing this file:
/usr/share/dbus-1/services/org.dharkael.Flameshot.service:

[D-BUS Service]
Name=org.dharkael.Flameshot
Exec=/usr/local/bin/flameshot <--- here you have to remove "local"

All 11 comments

Some users have been reporting this issue from multiple distros, but not every user is having this problem.

It could be a problem in the service configuration.
I have 2 service files:
This one is configured to be used when you define the qmake variable for packaging https://github.com/lupoDharkael/flameshot/blob/master/dbus/package/org.dharkael.Flameshot.service
The second is used by default and points to the binary in /usr/local/bin https://github.com/lupoDharkael/flameshot/blob/master/dbus/make/org.dharkael.Flameshot.service

Using this file the service should be launched when you send a dbus call and the target receiver isn't running.

Does it work as before if you use an older version?

hey @hosiet, does the journal say something? It looks like an error in the dbus daemon tring to start flameshot before the dbus call.
Try to launch it and check journalctl

2月 24 09:00:30 hosiet-tp dbus-daemon[2649]: [session uid=1000 pid=2649] Activating service name='org.dharkael.Flameshot' requested by ':1.95' (uid=1000 pid=5304 comm="flameshot config ")
2月 24 09:00:30 hosiet-tp dbus-daemon[2649]: [session uid=1000 pid=2649] Activated service 'org.dharkael.Flameshot' failed: Failed to execute program org.dharkael.Flameshot: No such file or directory

@lupoDharkael yes, there are some error messages.

Okay, this should be a packaging problem. I found that /usr/share/dbus-1/services/org.dharkael.Flameshot.service on my system claims /usr/local/bin/flameshot.

I'll investigate into it.

I just comment my case in other similar issue.
https://github.com/lupoDharkael/flameshot/issues/403#issuecomment-441126951

Same here in 6.0 release:
https://github.com/lupoDharkael/flameshot/releases/download/v0.6.0/flameshot_0.6.0_bionic_x86_64.deb

You can fix it by changing this file:
/usr/share/dbus-1/services/org.dharkael.Flameshot.service:

[D-BUS Service]
Name=org.dharkael.Flameshot
Exec=/usr/local/bin/flameshot <--- here you have to remove "local"

Why not just fix the file at « flameshot/dbus/make/org.dharkael.Flameshot.service » ???

@Creteil No, we must not fix that file.

As in https://github.com/lupoDharkael/flameshot/blob/94daa4fecdfaf6188853625d4798b4c5804a20a3/flameshot.pro#L269-L273 ,
it really depends on whether we are packaging or not. As a result,
it's a mistake from the packager, not the build system.

What does it mean exactly ?

If « packaging » defined then we use file from « dbus/package/org.dharkael.Flameshot.service » (pointing to /usr/bin)
If not, then we use file from « dbus/make/org.dharkael.Flameshot.service » (pointing to /usr/local/bin)

True ?

If so, the question is why « packaging » not defined in case of debian/ubuntu packaging build.

That can only be answered by the person who provided the .deb package on the release page (which is not me).

On my side I made the package myself by fetching the source code from « github » and the problem also occur.

I found this :

README.md:In order to generate the instructions in the `Makefile` to install the application in `/usr` instead of in `/usr/local` you can pass the `packaging` option to `qmake` (`qmake CONFIG+=packaging`).
README.md:qmake CONFIG+=packaging

So for everyone that want to build the package by themself, here is the building magic in one line command. Notice that as long as you have all dependencies, it must build under every distro release (debian/ubuntu) :

mkdir ~/flameshot-packaging && cd ~/flameshot-packaging && git clone https://github.com/lupoDharkael/flameshot.git && cd flameshot && DEBEMAIL="COLIN Stephane <[email protected]>" dch -b -v $(git --git-dir .git --work-tree . describe --always --tags | cut -c2- | sed 's/-/./g') "Update to latest GIT Version ..." && sed -i '$!N; /^\(.*\)\n\1$/!P; D' debian/changelog ; head -10 debian/changelog && sed -i "s/#CONFIG += packaging/CONFIG += packaging/g" flameshot.pro && tar cJf ../flameshot_$(git --git-dir .git --work-tree . describe --always --tags | cut -c2- | sed 's/-/./g').orig.tar.xz ../flameshot && rm debian/*~ ; dpkg-buildpackage -rfakeroot ; cd .. && ls -alrtN --full-time --color=auto

This resulting as a package you can use with « dpkg -i » in « /home/$USER/flameshot-packaging/ » directory.

image

Hope it help...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

makz27 picture makz27  Â·  4Comments

dajare picture dajare  Â·  4Comments

mrinvisible0 picture mrinvisible0  Â·  4Comments

soundsbeard picture soundsbeard  Â·  4Comments

omkarnathsingh picture omkarnathsingh  Â·  4Comments