Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo User (http://www.linux-archive.org/gentoo-user/)
-   -   Problem with script calling OOCalc on amd64 (http://www.linux-archive.org/gentoo-user/342139-problem-script-calling-oocalc-amd64.html)

Mick 03-15-2010 10:41 PM

Problem with script calling OOCalc on amd64
 
Hi All,

I have run into a problem which I cannot explain. I am trying to run this
script in a amd64 installation:

xterm -fg green -bg black -e 'gpg Personal/data.ods.gpg && oocalc
Personal/data.ods; shred --remove -z -v DATA/data.ods'

On a x86 system, oocalc launches, I use the file and when I close it shred
removes it. On the amd64 system, the file is shredded as soon as it is
opened. This is what happens:

[snip ...]
gpg: AES256 encrypted data
gpg: original file name='data.ods'
random usage: poolsize=600 mixed=0 polls=0/0 added=0/0
outmix=0 getlvl1=0/0 getlvl2=0/0
secmem usage: 64/32768 bytes in 1 blocks
I18N: Operating system doesn't support locale "en_US"
shred: Personal/data.ods: pass 1/4 (random)...
shred: Personal/data.ods: pass 2/4 (random)...
shred: Personal/data.ods: pass 3/4 (random)...
shred: Personal/data.ods: pass 4/4 (000000)...
shred: Personal/data.ods: removing
shred: Personal/data.ods: renamed to Personal/00000000
shred: Personal/00000000: renamed to Personal/0000000
shred: Personal/0000000: renamed to Personal/000000
shred: Personal/000000: renamed to Personal/00000
shred: Personal/00000: renamed to Personal/0000
shred: Personal/0000: renamed to Personal/000
shred: Personal/000: renamed to Personal/00
shred: Personal/00: renamed to Personal/0
shred: Personal/data.ods: removed

Is this something 64bit specific? Shouldn't xrterm behave the same in both
x86 and amd64 with regards to this script? How do I get it to keep oocalc
open and shred to kick in only after the oocalc application is closed?
--
Regards,
Mick

Amit Dor-Shifer 03-16-2010 06:40 AM

Problem with script calling OOCalc on amd64
 
What does

xterm -fg green -bg black -e 'gpg Personal/data.ods.gpg;echo $?' tell you? I'm thinking that gpg fails, so oocalc never launches (because you conditioned its execution with '&&', and the script continues to shred the file.

My amd64 succeeds executing this (s/gpg/echo-to-tmpfile/). I would initially assume it's the usage causing the issue, rather than some arch-dependent thing.

Amit


Mick wrote:

Hi All,

I have run into a problem which I cannot explain. I am trying to run this
script in a amd64 installation:


xterm -fg green -bg black -e 'gpg Personal/data.ods.gpg && oocalc
Personal/data.ods; shred --remove -z -v DATA/data.ods'


On a x86 system, oocalc launches, I use the file and when I close it shred
removes it. On the amd64 system, the file is shredded as soon as it is
opened. This is what happens:


[snip ...]
gpg: AES256 encrypted data
gpg: original file name='data.ods'
random usage: poolsize=600 mixed=0 polls=0/0 added=0/0
outmix=0 getlvl1=0/0 getlvl2=0/0
secmem usage: 64/32768 bytes in 1 blocks
I18N: Operating system doesn't support locale "en_US"
shred: Personal/data.ods: pass 1/4 (random)...
shred: Personal/data.ods: pass 2/4 (random)...
shred: Personal/data.ods: pass 3/4 (random)...
shred: Personal/data.ods: pass 4/4 (000000)...
shred: Personal/data.ods: removing
shred: Personal/data.ods: renamed to Personal/00000000
shred: Personal/00000000: renamed to Personal/0000000
shred: Personal/0000000: renamed to Personal/000000
shred: Personal/000000: renamed to Personal/00000
shred: Personal/00000: renamed to Personal/0000
shred: Personal/0000: renamed to Personal/000
shred: Personal/000: renamed to Personal/00
shred: Personal/00: renamed to Personal/0
shred: Personal/data.ods: removed

Is this something 64bit specific? Shouldn't xrterm behave the same in both
x86 and amd64 with regards to this script? How do I get it to keep oocalc
open and shred to kick in only after the oocalc application is closed?

Mick 03-17-2010 05:54 AM

Problem with script calling OOCalc on amd64
 
On Tuesday 16 March 2010 07:40:04 Amit Dor-Shifer wrote:
> What does
>
> xterm -fg green -bg black -e 'gpg Personal/data.ods.gpg;echo $?' tell you?

It doesn't return anything on the terminal I launch it from, but decrypts the
file in an xterm and then closes it (the xterm). So the gpg part works fine.

> I'm thinking that gpg fails, so oocalc never launches (because you
> conditioned its execution with '&&', and the script continues to shred the
> file.

The gpg part does not fail, because when I run:

xterm -fg green -bg black -e 'gpg Personal/data.ods.gpg && oocalc
Personal/data.ods'

An xterm opens up asks for a passwd to decrypt the file, decrypts it and
launches OOo. However, the xterm dies immediately after that.

On my x86 machine, the xterm stays open until I close OOo. This is how it
should work; i.e. the xterm should continue to run as long as any processes
within it are still running.

This makes me think that it may be some env or profile difference ...? What
would control this behaviour in an xterm?
--
Regards,
Mick

Amit Dor-Shifer 03-17-2010 08:15 AM

Problem with script calling OOCalc on amd64
 
ok. I didn't realize that oocalc actually executed in your first attempt.
Out of ideas then.

FWIW - a few guesses: I'd execute oocalc under strace, and try to find
what is killing oocalc (does it decide to exit, or is it sent some
signal). If your suspecting xterm to be the culprit (i.e., yr script
works-as-expected w/o the xterm wrap) then maybe it'll be worthwhile
looking into the X resources yr xterm is reading.

HTH
Amit

Mick wrote:

On Tuesday 16 March 2010 07:40:04 Amit Dor-Shifer wrote:


What does

xterm -fg green -bg black -e 'gpg Personal/data.ods.gpg;echo $?' tell you?



It doesn't return anything on the terminal I launch it from, but decrypts the
file in an xterm and then closes it (the xterm). So the gpg part works fine.




I'm thinking that gpg fails, so oocalc never launches (because you
conditioned its execution with '&&', and the script continues to shred the
file.



The gpg part does not fail, because when I run:

xterm -fg green -bg black -e 'gpg Personal/data.ods.gpg && oocalc
Personal/data.ods'

An xterm opens up asks for a passwd to decrypt the file, decrypts it and
launches OOo. However, the xterm dies immediately after that.


On my x86 machine, the xterm stays open until I close OOo. This is how it
should work; i.e. the xterm should continue to run as long as any processes
within it are still running.


This makes me think that it may be some env or profile difference ...? What
would control this behaviour in an xterm?

Mick 03-17-2010 09:57 PM

Problem with script calling OOCalc on amd64
 
On Wednesday 17 March 2010 09:15:17 Amit Dor-Shifer wrote:
> ok. I didn't realize that oocalc actually executed in your first attempt.
> Out of ideas then.
>
> FWIW - a few guesses: I'd execute oocalc under strace, and try to find
> what is killing oocalc (does it decide to exit, or is it sent some
> signal). If your suspecting xterm to be the culprit (i.e., yr script
> works-as-expected w/o the xterm wrap) then maybe it'll be worthwhile
> looking into the X resources yr xterm is reading.

That's interesting ... which Xresources is xterm reading? I have this in my
~/.Xresources:

aterm*loginShell:true
aterm*saveLines:32767
aterm*transparent:true
aterm*transpscrollbar:true
aterm*shading:40
aterm*fading:55
aterm*font:-*-fixed-*-*-*-*-20-*-100-*-*-*-*-*

but xterm (judging by the size of the font) does not use it.
--
Regards,
Mick

Dan Wallis 03-18-2010 02:29 AM

Problem with script calling OOCalc on amd64
 
On 16 March 2010 12:41, Mick <michaelkintzios@gmail.com> wrote:
> Hi All,
>
> I have run into a problem which I cannot explain. *I am trying to run this
> script in a amd64 installation:
>
> xterm -fg green -bg black -e 'gpg Personal/data.ods.gpg && oocalc
> Personal/data.ods; shred --remove -z -v DATA/data.ods'
>
> On a x86 system, oocalc launches, I use the file and when I close it shred
> removes it. *On the amd64 system, the file is shredded as soon as it is
> opened. *This is what happens:

I get something similar with firefox: if it's the first instance, it
will block until I terminate firefox; but if there's already a firefox
running, it'll send a "open this URL" command to the other instance,
and close this new one.

I'm not sure if OOo is the same, but I'd recommend giving it a try.

Mick 03-18-2010 05:40 AM

Problem with script calling OOCalc on amd64
 
On Wednesday 17 March 2010 22:57:41 you wrote:
> On Wednesday 17 March 2010 09:15:17 Amit Dor-Shifer wrote:
> > ok. I didn't realize that oocalc actually executed in your first attempt.
> > Out of ideas then.
> >
> > FWIW - a few guesses: I'd execute oocalc under strace, and try to find
> > what is killing oocalc (does it decide to exit, or is it sent some
> > signal). If your suspecting xterm to be the culprit (i.e., yr script
> > works-as-expected w/o the xterm wrap) then maybe it'll be worthwhile
> > looking into the X resources yr xterm is reading.

I'm posting this to the list on behalf of Jack, because his posts don't make
it to the list for some reason:

============================================
You didn't see it in the list because it hasn't shown up there yet,
despite three tries to post.....

What I mean is that if I type "oocalc somefile" in a term (it doesn't
seem to matter xterm, konsole, ...) I almost immediately get the next
shell prompt, even before the oocalc (or oodraw or oowrite) window is
fully displayed and ready to work. It does not smell to me like
anything to do with the terminal program, or even the shell, although
there may well be an environment variable that OO is checking.
oowriter --help (and any variation I have tried) seems to ignore the
request for help. If you look at the ooffice help on command line
parameters, there is a note about gentoo having a custom version - but
I haven't been able to find anything at the gentoo site either. I have
not yet tried launching from a script in case that behaves any
differently.

Note that since the shell has given the next prompt - the terminal will
certainly think everything is done, and happily close if the script is
finished. The trick will be to explicitly find a way to check that oo
has finished.

If you just launch oo from a command line in a terminal, do you get the
next shell prompt immediately, or not until you exit oo?

Jack
============================================

Thanks Jack, this is rather interesting:

On two machines including the amd64 laptop the terminal exits immediately,
while the OOo is being launched. Both of these have OOo compiled from
source. The third machine (an old x86 laptop) has the OOo binary installed.
The binary installation behaves as I thought was the norm, i.e. the terminal
does not exit, but remains open until I close OOo. So this problem that
reported I guess is due to a difference between the two types of OOo, built
from source or binary.

I looked at the CLI help options by running 'ooffice -help'but I can't see
anything in there that will change this behaviour on the OOo built from
sources.

Any other ideas?
--
Regards,
Mick

Mick 03-18-2010 06:42 PM

Problem with script calling OOCalc on amd64
 
On Thursday 18 March 2010 03:29:00 Dan Wallis wrote:
> On 16 March 2010 12:41, Mick <michaelkintzios@gmail.com> wrote:

> > On a x86 system, oocalc launches, I use the file and when I close it
> > shred removes it. On the amd64 system, the file is shredded as soon as
> > it is opened. This is what happens:
>
> I get something similar with firefox: if it's the first instance, it
> will block until I terminate firefox; but if there's already a firefox
> running, it'll send a "open this URL" command to the other instance,
> and close this new one.
>
> I'm not sure if OOo is the same, but I'd recommend giving it a try.

Hi Dan, my problem is not exactly the same. It occurs on the first instance
that I launch OOo from the terminal.

Is there some bash incantation I can use then with OOo compiled from source,
to keep the terminal open until I close OOo?
--
Regards,
Mick

Dan Wallis 03-18-2010 11:34 PM

Problem with script calling OOCalc on amd64
 
On 19 March 2010 08:42, Mick <michaelkintzios@gmail.com> wrote:
> Is there some bash incantation I can use then with OOo compiled from source,
> to keep the terminal open until I close OOo?

I guess something like this might do the trick:
while pgrep ooffice >/dev/null; do sleep 1; done
Although I'm not at my Gentoo box at the moment to test. The version
of pgrep on this Debian box doesn't have a -q option, hence the
redirect to devnull.

Mick 03-19-2010 06:14 PM

Problem with script calling OOCalc on amd64
 
On Friday 19 March 2010 00:34:44 Dan Wallis wrote:
> On 19 March 2010 08:42, Mick <michaelkintzios@gmail.com> wrote:
> > Is there some bash incantation I can use then with OOo compiled from
> > source, to keep the terminal open until I close OOo?
>
> I guess something like this might do the trick:
> while pgrep ooffice >/dev/null; do sleep 1; done
> Although I'm not at my Gentoo box at the moment to test. The version
> of pgrep on this Debian box doesn't have a -q option, hence the
> redirect to devnull.

Thanks Dan, I tried this but the terminal did not wait for OOo to close. It
exited straight away:

xterm -fg green -bg black -e 'gpg DATA/data.ods.gpg && oocalc DATA/data.ods;
while pgrep oocalc >/dev/null; do sleep 1; done'

I also tried /usr/bin/oocalc, but it didn't work. :-(
--
Regards,
Mick


All times are GMT. The time now is 12:50 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.