LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-06-2016, 06:19 PM   #16
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251

Quote:
Originally Posted by Steven_G View Post
It didn't work.

Yeah, it's the only xfce4-terminal running but that didn't work either.

And your solution is not all that different from ones I've tried by throwing spaghetti at the wall based on stuff I've found on the web.

This is starting to tick me off b/c it doesn't make any sense. (Not you guys. I appreciate the help. But things are not working the way I understand they should be based on my reading and advice from those more experienced than myself.)
What exactly didn't work? Can you describe it in more detail?
 
1 members found this post helpful.
Old 01-06-2016, 07:16 PM   #17
Steven_G
Member
 
Registered: Dec 2015
Location: Western US
Distribution: Home spun
Posts: 142

Original Poster
Rep: Reputation: 67
Clarification: It didn't achieve the desired goal.

Code:
/home/user/folder/firefox
xfce4-terminal -e "bash -c 'bleachbit -c firefox.* chromium.history;$SHELL'"
PID_TERM=$(pidof xfce4-terminal)
Kill -TERM -P $PID_TERM
When launched with a menu short cut FF runs.

When FF is closed xfce4 terminal opens and I see the visible output of it running bleachbit.

This is the desired behaviour.

Then the terminal window stays open and nothing I do will close the stupid thing; including your suggestion.

This is not the desired behaviour. IE: it "didn't work". And I'll be danged if I can figure out why the friggin terminal window cannot be made to close from inside this script.
 
Old 01-06-2016, 07:29 PM   #18
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Quote:
Originally Posted by Steven_G View Post
Clarification: It didn't achieve the desired goal.

Code:
/home/user/folder/firefox
xfce4-terminal -e "bash -c 'bleachbit -c firefox.* chromium.history;$SHELL'"
PID_TERM=$(pidof xfce4-terminal)
Kill -TERM -P $PID_TERM
When launched with a menu short cut FF runs.

When FF is closed xfce4 terminal opens and I see the visible output of it running bleachbit.

This is the desired behaviour.

Then the terminal window stays open and nothing I do will close the stupid thing; including your suggestion.

This is not the desired behaviour. IE: it "didn't work". And I'll be danged if I can figure out why the friggin terminal window cannot be made to close from inside this script.
I don't know what this bleachbit does but perhaps you should kill it first (the same way you do xfce4-terminal) and then kill the terminal?
 
1 members found this post helpful.
Old 01-06-2016, 07:55 PM   #19
Steven_G
Member
 
Registered: Dec 2015
Location: Western US
Distribution: Home spun
Posts: 142

Original Poster
Rep: Reputation: 67
Quote:
Originally Posted by sycamorex View Post
I don't know what this bleachbit does but perhaps you should kill it first (the same way you do xfce4-terminal) and then kill the terminal?
Bleachbit is a cleaning tool with a GUI frontend and a CLI interface. In CLI it executes the argument then closes itself. When I run pstree from the terminal instance that refuses to close bleachbit is not in the tree.

If I query the pidof the terminal instance manually from inside the terminal and then manually kill that pid the terminal instance will close. But not matter what syntax / structure I try to get the window to close from inside the script it just won't close.

Can you recommend a debug tool that would be good for a use case like this so I can get a closer look at what's going on and see why the last two lines appear to be failing to execute b/c it's not throwing any errors in the terminal instance.
 
Old 01-06-2016, 08:24 PM   #20
Steven_G
Member
 
Registered: Dec 2015
Location: Western US
Distribution: Home spun
Posts: 142

Original Poster
Rep: Reputation: 67
strace won't run it. It throws exec errors.

bash -x runs the script and is verbose about what is going on until it hits the last two lines, the ones that aren't executing, and then it just hangs indefinitely w/ no output?
 
Old 01-06-2016, 08:42 PM   #21
Steven_G
Member
 
Registered: Dec 2015
Location: Western US
Distribution: Home spun
Posts: 142

Original Poster
Rep: Reputation: 67
Code:
/home/user/folder/firefox
xfce4-terminal -e "bash -c 'bleachbit -c firefox.* chromium.history;$SHELL'"
PID_TERM1=$(pidof bleachbit)
Kill -TERM -P $PID_TERM1
sleep 3
PID_TERM2=$(pidof xfce4-terminal)
Kill -TERM -P $PID_TERM2
exit

Also achieves the exact same result as above: Lines one and two execute and then nothing else happens.
 
Old 01-07-2016, 01:58 AM   #22
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
in that case I would suggest you to make another wrapper, so xfce4-terminal -e bash -c your_script and in your_script you will be able to kill all the related processes, so xfce4-terminal will be able to close.
 
1 members found this post helpful.
Old 01-07-2016, 11:22 AM   #23
Steven_G
Member
 
Registered: Dec 2015
Location: Western US
Distribution: Home spun
Posts: 142

Original Poster
Rep: Reputation: 67
I appreciate the help. I marked all posts as helpful and the thread as solved b/c my original question was answered and I learned quite a few things.

I'm in the middle of building a custom system and have a million more important things to do. For now I will live with having to close the window manually and come back to this when I have more time to figure out why it's not working the way it should.

Thanx.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting shutdown message when I try to login as anyone but root on CLI alarazr Linux - Newbie 5 07-11-2012 01:22 PM
[SOLVED] unable to execute /bin/chmod: Argument list too long veeruk101 Linux - Newbie 2 10-14-2011 06:16 AM
execute script shell with regex as argument eguider Linux - Newbie 2 12-15-2009 07:26 PM
I can execute shell script from CLI but failed to do via cron UltraSoul Linux - Software 2 06-24-2008 10:10 PM
MDV06, KDE 3.4.2 will only shutdown through CLI. Lordandmaker Linux - Newbie 1 12-05-2005 12:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration