Version: 2.6.4 (using KDE 4.6.5) OS: Linux "daemon" is tool to daemonize processes. When I type "exec daemon konsole" to konsole, this command sometimes fails. This bug appears both in Debian Squeeze and Debian Sid. I use version 0.6.4-1 of daemon. Reproducible: Always Steps to Reproduce: I type "exec daemon konsole" to konsole. Window closes and new window appears (this is normal). Then I type this command again etc. Actual Results: After several steps window closes, but new doesn't appear Expected Results: Windows must appear infinite
"exec konsole" and "exec dolphin" fail, too
When there is a problem trace of "exec daemon konsole" is: unnamed app(9697): KUniqueApplication: Registering failed! unnamed app(9697): Communication problem with "konsole" , it probably crashed. Error message was: "org.freedesktop.DBus.Error.ServiceUnknown" : " "The name org.kde.konsole was not provided by any .service files" " Also you can see our letters with Raf (author of "daemon") for more detailed information: http://paste.kde.org/110017/
Bug also appears in Debian's and Ubuntu's start-stop-daemon. Repeating (in konsole): # cat << EOF > /tmp/k > #!/bin/sh > exec konsole "$@" > EOF # chmod +x /tmp/k # exec start-stop-daemon -x /tmp/k -S
I do not quite understand what 'daemon' and 'start-stop-daemon' do, but I would like to remind you of a not-well-noticed behavior of konsole: it by default forks itself and runs in background, unless --nofork option is specified. See bug #262169. I have no idea of the expected result in that start-stop-daemon example, but replacing 'konsole' with 'konsole --nofork' will open a konsole window for me.
> I do not quite understand what 'daemon' and 'start-stop-daemon' do They daemonize processes (and can do some additional work). > I would like to remind you of a not-well-noticed behavior of konsole This doesn't matter. > I have no idea of the expected result in that start-stop-daemon example Expected result is closing current konsole and opening another konsole. Actual result is closing current konsole and no opening. Also, I forget "-b" option for start-stop-daemon. This option makes real daemonizing. So, command is: "start-stop-daemon -bx /tmp/k -S". * start-stop-daemon should create and daemonize process "konsole" * "-S" means "start" (not stop) * "-x" means "path to executable" * I use script /tmp/k instead of real /usr/bin/konsole, because start-stop-daemon doesn't start process, if we already have one I did following experiment: http://paste.kde.org/115015/. So, I found another bug (2nd row in pastebin)!
Some another bugs: Command: daemon -- konsole --nofork Expected: new konsole opens Actual: nothing Command: exec daemon -- konsole --nofork Expected: current closes and new opens Actual: current closes
(In reply to comment #6) > I got some clue. The actual behavior depends upon how the original konsole is stared. 1) if the original konsole is started from menu or krunner(ps command shows it as "kdeinit4: konsole [kdeinit]"), it behaves as described in that comment. 2) if the original konsole is started from another terminal(say, xterm), it behaves as expected in that comment.
> if the original konsole is started from another terminal(say, xterm), it behaves as expected in that comment. I tested and got bugs again. I pressed Alt-F2, typed xterm, then typed konsole to xterm and then typed "daemon -- konsole --nofork" to konsole. Now window didn't appear.
I understand all! "konsole" sometimes cannot work if stdout is /dev/null, for example: # konsole --nofork > /dev/null <unknown program name>(2946)/: KUniqueApplication: Can't setup D-Bus service. Probably already running. (expected: new window opens, actual: error) But all daemonizing programs redirect stdout to /dev/null, so "konsole" fails. But I think there is another bugs, because following doesn't work: # exec daemon sh -c 'exec konsole > /tmp/out' (expected: current window closes, new opens, actual: current closes)
> if the original konsole is started from another terminal(say, xterm), it behaves as expected in that comment Sorry, you are right. If I start konsole from menu and type "exec daemon konsole", it will fail. If I start konsole form another konsole, it doesn't fail. Also, read prev. comment!
* "konsole --nofork > /dev/null" bug fixed (see bug 288200) * "exec daemon konsole" bug still exists * If you don't want to deal with "daemon", "start-stop-daemon" etc, I recommend another command: "trap '' HUP; setsid konsole < /dev/null > /dev/null 2> /tmp/log & exit". This command actually daemonizes konsole without special tools. Also you can see error message in /tmp/log: unnamed app(2118): Communication problem with "konsole" , it probably crashed. Error message was: "org.freedesktop.DBus.Error.NoReply" : " "Message did not receive a reply (timeout by message bus)" " * Bug exists only if konsole started from menu, icon or by command "kdeinit4 konsole" from xterm * Bug depends of Linux kernel version!! o_O I can reproduce bug on Debian Sid or Wheezy with "linux-image-3.0.0-12-generic" from Ubuntu with proprietary blobs. But I cannot reproduce on the same system with "linux-image-3.1.0-1-amd64" from Debian without proprietary blobs * I think reason is following: when I type "trap...", new konsole runs, but old still running too. New konsole runs function KUniqueApplication::start(...) from libkdeui and forks (in this function). Child tries to register in DBus, but DBus says that service already registred (because old konsole runs). Then old konsole terminates, and parent tries to connect to DBus. But it cannot, because old konsole terminated and service is not registred anymore. So, parent prints: "Communication problem..." * When I add debug output, bug disappears o_O. This is Heisenbug. Bug is very sensible to time intervals * This is better way to reproduce bug: run konsole from menu (or icon), type "trap...". If new konsole window appear, close it and run konsole from menu again etc ************* I think bug is very hard to fix, because one cannot make atomic registering in DBus in one process and connecting to it in another process. So, I want to ask developers: it is really important (and possible) to fix the bug? If no, I will remove this bug with "RESOLVED/LATER" or something like that
Ooops
Hi Askar Safin : Thanks for your feedback and investigation ! Frankly, I don't know whether this problem can be easily fixed at the moment. And I personally do not take this problem with high priority. I would bet over 99% of konsole users had never used or will use konsole in this way :) But it is better to leave this report open for a while. It is a good example of the side effect of konsole using KUniqueApplication. And maybe I will find some workaround sometime later.
What happened? Why closed with RESOLVED UNMAINTAINED?
KDE4 is not maintained any longer as there won't be any new releases. The newest KF5 versions have changed how the --nofork and process / tab works.
Closing per comment 15.