Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 28 Nov 2014, 21:37
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Pfind, Pmusic, etc still running?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [11 Posts]  
Author Message
DaveS


Joined: 09 Oct 2008
Posts: 3726
Location: UK

PostPosted: 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
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7084
Location: Perth, Western Australia

PostPosted: 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/news/
Back to top
View user's profile Send private message Visit poster's website 
zigbert


Joined: 29 Mar 2006
Posts: 5789
Location: Valåmoen, Norway

PostPosted: 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
View user's profile Send private message Visit poster's website 
zigbert


Joined: 29 Mar 2006
Posts: 5789
Location: Valåmoen, Norway

PostPosted: 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
View user's profile Send private message Visit poster's website 
trio


Joined: 21 Dec 2008
Posts: 1892
Location: अनुमोदना

PostPosted: 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 Laughing , I don't know if it can be applied in this case or not

_________________
My apps
Back to top
View user's profile Send private message 
aragon

Joined: 15 Oct 2007
Posts: 1698
Location: Germany

PostPosted: 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
View user's profile Send private message 
zigbert


Joined: 29 Mar 2006
Posts: 5789
Location: Valåmoen, Norway

PostPosted: 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 Very Happy ) 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
View user's profile Send private message Visit poster's website 
aragon

Joined: 15 Oct 2007
Posts: 1698
Location: Germany

PostPosted: Wed 22 Apr 2009, 09:15    Post subject:  

ok, starting to understand the problem a litlle bit... Wink

aragon

_________________
PUPPY SEARCH: http://wellminded.com/puppy/pupsearch.html
Back to top
View user's profile Send private message 
ecomoney


Joined: 25 Nov 2005
Posts: 2183
Location: Lincolnshire, England

PostPosted: 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
View user's profile Send private message Visit poster's website MSN Messenger 
trio


Joined: 21 Dec 2008
Posts: 1892
Location: अनुमोदना

PostPosted: Thu 23 Apr 2009, 06:17    Post subject:  

Hi,

just wanna share a workaround, will kill all gtkdialog at start up, or supposed to Laughing just try
gtkdialogkiller.pet
Description 
pet

 Download 
Filename  gtkdialogkiller.pet 
Filesize  432 Bytes 
Downloaded  421 Time(s) 

_________________
My apps
Back to top
View user's profile Send private message 
ecomoney


Joined: 25 Nov 2005
Posts: 2183
Location: Lincolnshire, England

PostPosted: 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
View user's profile Send private message Visit poster's website MSN Messenger 
Display posts from previous:   Sort by:   
Page 1 of 1 [11 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0765s ][ Queries: 13 (0.0056s) ][ GZIP on ]