Pfind, Pmusic, etc still running?

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
DaveS
Posts: 3685
Joined: Thu 09 Oct 2008, 16:01
Location: UK

Pfind, Pmusic, etc still running?

#1 Post by DaveS »

I keep reading about these applications needing to be shut down 'properly' to prevent them from running in the background. From Pmusic experience, I guess this means that just closing the window is not enough, and the 'quit' or whatever command must be used to kill the process? If one just closes the window, does this mean that when activating the program again, a second instance is initiated, or does the original which is running in the background, reappear?
Spup Frugal HD and USB
Root forever!

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#2 Post by BarryK »

Well, zigbert can answer this better than me. I know there are issues with processes left running and that annoys me when I want to unmount a partition. I don't know if it affects anything when you want to rerun the application.

It may be that those apps need to have the user interface redesigned to remove this problem. I think it is because of the pulldown menus.

Or, it may be possible to create a workaround to fix it. There can be a wrapper for the actual application. When the app is killed, execution returns to the wrapper which then makes sure all processes are killed before exiting. Well, that is more than possible, its doable.
[url]https://bkhome.org/news/[/url]

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#3 Post by zigbert »

BarryK wrote:Or, it may be possible to create a workaround to fix it. There can be a wrapper for the actual application. When the app is killed, execution returns to the wrapper which then makes sure all processes are killed before exiting. Well, that is more than possible, its doable.
I'll look into this in the weekend. Just too busy these days.


Sigmund

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#4 Post by zigbert »

I have made a simple workaround that kills pid after closing gtkdialog-script (including drop-down menu). This example is Pburn. I have edited the startup-script in /usr/bin/. Since I'm not really a programmer, I would like someone with more knowledge to look through the codelines. There could be many other ways to do this, that are much better. - I don't know, just happy it works.

I will include this (or another) workaround in the next release of
Pburn
Pmusic
Pfind
Pbackup
Pwidgets
Hopefully other Pscripts with same issue could use this.
Pdvdrsab
Pcdripper
Pmetatagger
Psip
Pctorrent
Wallpaper

Code: Select all

#!/bin/bash
"/usr/local/pburn/pburn" "$@" &

#Start loop to kill PID when window closes.
#This is a workaround for a bug in gtkdialog.
sleep 10
while [ A != B ]; do
	TMP="`xwininfo -stats -name Pburn`"
	if [ ! "$TMP" ]; then
		for I in `ps | grep Pburn | grep gtkdialog | awk '{print $1}'`; do kill -9 $I 2> /dev/null; done
		for I in `ps | grep -i pburn | awk '{print $1}'`; do kill -9 $I 2> /dev/null; done
		exit 0
	fi
	sleep 3
done

Sigmund

User avatar
trio
Posts: 2076
Joined: Sun 21 Dec 2008, 15:50
Location: अनà¥￾मोदना

#5 Post by trio »

Ziggy,

This is how I do it (in the wallpaper express - preview function)

TMP=`ps | grep 'Pburn' | awk '{print $1}'`

kill $TMP

Taken from your pprocess' script :lol: , I don't know if it can be applied in this case or not

aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

#6 Post by aragon »

Don't know if this is related/helps but you maybe want to have a look at

Code: Select all

/usr/local/bin/prename
line 343 ff

Code: Select all

...
RESULTS="`$GTKDIALOG --program=MAIN_DIALOG --center`"

###exit the program if the X button is pushed
if [ "`echo $RESULTS | grep abort`" != "" ]; then
exit 0
fi

##incase quit was selected, let's exit the program
if [ "`echo $RESULTS | grep EXIT_NOW`" != "" ]; then
exit 0
fi
...
aragon

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#7 Post by zigbert »

aragon
Prename does not have the same issue, because it has no menus. the Prename script gets the control back after child process is done. - That's why I have started a loop instead of waiting for child-process to return to parent.

trio
The main issue is not the killing, but to scan X to see if pburn-window is actually up. Your (mine :D ) code is simpler, but I had some trouble in the past killing ALL child processes. That was with Pfind, - and I still have the same problems, so your code might fit better in the end. I guess my 2 'for-loops' takes much more time than your grep.


Thanks for input !!!!!
Sigmund

aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

#8 Post by aragon »

ok, starting to understand the problem a litlle bit... ;-)

aragon

User avatar
ecomoney
Posts: 2178
Joined: Fri 25 Nov 2005, 07:00
Location: Lincolnshire, England
Contact:

#9 Post by ecomoney »

Hi, I just want to mention that the P series apps have brought a lot of useability to puppy linux, from what I have seen of the end users I have using 4 series puppy. Zig, you definetely qualify as a "programmer" in my book.

I hope someone with a bit more in-depth knowledge helps you sort these problems out, and lets you get back to designing great front ends!
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

User avatar
trio
Posts: 2076
Joined: Sun 21 Dec 2008, 15:50
Location: अनà¥￾मोदना

#10 Post by trio »

Hi,

just wanna share a workaround, will kill all gtkdialog at start up, or supposed to :lol: just try
Attachments
gtkdialogkiller.pet
(432 Bytes) Downloaded 664 times

User avatar
ecomoney
Posts: 2178
Joined: Fri 25 Nov 2005, 07:00
Location: Lincolnshire, England
Contact:

#11 Post by ecomoney »

This problem has been fixed by Zigbert in 0.8 which he just released. It needs testing though (like anything with a zero on the end).

Get it from here.

http://www.murga-linux.com/puppy/viewtopic.php?t=31206
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

Post Reply