| Author |
Message |
DaveS

Joined: 09 Oct 2008 Posts: 3697 Location: UK
|
Posted: Tue 21 Apr 2009, 02:26 Post subject:
Pfind, Pmusic, etc still running? |
|
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!
|
|
Back to top
|
|
 |
BarryK
Puppy Master

Joined: 09 May 2005 Posts: 6874 Location: Perth, Western Australia
|
Posted: Tue 21 Apr 2009, 08:26 Post subject:
|
|
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.
_________________ http://bkhome.org/blog2/
|
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 5295 Location: Valåmoen, Norway
|
Posted: Tue 21 Apr 2009, 11:59 Post subject:
|
|
| 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
_________________ Stardust resources
|
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 5295 Location: Valåmoen, Norway
|
Posted: Wed 22 Apr 2009, 05:50 Post subject:
|
|
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: | #!/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
_________________ Stardust resources
|
|
Back to top
|
|
 |
trio

Joined: 21 Dec 2008 Posts: 1786 Location: अनुमोदना
|
Posted: Wed 22 Apr 2009, 05:56 Post subject:
|
|
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 , I don't know if it can be applied in this case or not
_________________ PET Maker|WbarCC|My Website
|
|
Back to top
|
|
 |
aragon
Joined: 15 Oct 2007 Posts: 1691 Location: Germany
|
Posted: Wed 22 Apr 2009, 06:28 Post subject:
|
|
Don't know if this is related/helps but you maybe want to have a look at
| Code: | | /usr/local/bin/prename |
line 343 ff
| Code: | ...
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
_________________ PUPPY SEARCH: http://wellminded.com/puppy/pupsearch.html
|
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 5295 Location: Valåmoen, Norway
|
Posted: Wed 22 Apr 2009, 07:51 Post subject:
|
|
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 ) 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
_________________ Stardust resources
|
|
Back to top
|
|
 |
aragon
Joined: 15 Oct 2007 Posts: 1691 Location: Germany
|
Posted: Wed 22 Apr 2009, 09:15 Post subject:
|
|
ok, starting to understand the problem a litlle bit...
aragon
_________________ PUPPY SEARCH: http://wellminded.com/puppy/pupsearch.html
|
|
Back to top
|
|
 |
ecomoney

Joined: 25 Nov 2005 Posts: 2183 Location: Lincolnshire, England
|
Posted: Wed 22 Apr 2009, 20:42 Post subject:
|
|
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 Mission
Sorry, my server is down atm!
|
|
Back to top
|
|
 |
trio

Joined: 21 Dec 2008 Posts: 1786 Location: अनुमोदना
|
Posted: Thu 23 Apr 2009, 06:17 Post subject:
|
|
Hi,
just wanna share a workaround, will kill all gtkdialog at start up, or supposed to just try
| Description |
|

Download |
| Filename |
gtkdialogkiller.pet |
| Filesize |
432 Bytes |
| Downloaded |
336 Time(s) |
_________________ PET Maker|WbarCC|My Website
|
|
Back to top
|
|
 |
ecomoney

Joined: 25 Nov 2005 Posts: 2183 Location: Lincolnshire, England
|
Posted: Tue 28 Apr 2009, 03:14 Post subject:
|
|
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 Mission
Sorry, my server is down atm!
|
|
Back to top
|
|
 |
|