[GRASS-dev] $GISBASE/etc/run what does this do?

I am trying to understand $GISBASE/etc/Init.sh

The final call is to a program $GIS/etc/run $SHELL

What does "run" do exactly?

--
David Finlayson

David Finlayson wrote:

I am trying to understand $GISBASE/etc/Init.sh

The final call is to a program $GIS/etc/run $SHELL

What does "run" do exactly?

It runs a command with SIGINT and SIGQUIT re-enabled (the Init.sh
script ignores those signals, as well as SIGTERM).

--
Glynn Clements <glynn@gclements.plus.com>

We're trying to figure this out too to get Java and GRASS to talk to each
other.

Could you explain a bit more? What you say sounds like it doesn't really do
anything useful.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: Glynn Clements <glynn@gclements.plus.com>
Date: Sun, 11 Jun 2006 08:17:25 +0100
To: David Finlayson <david.p.finlayson@gmail.com>
Cc: GRASS developers list <grass-dev@grass.itc.it>
Subject: Re: [GRASS-dev] $GISBASE/etc/run what does this do?

David Finlayson wrote:

I am trying to understand $GISBASE/etc/Init.sh

The final call is to a program $GIS/etc/run $SHELL

What does "run" do exactly?

It runs a command with SIGINT and SIGQUIT re-enabled (the Init.sh
script ignores those signals, as well as SIGTERM).

--
Glynn Clements <glynn@gclements.plus.com>

Last night I got GRASS to launch and run entirely from Python. No
bourne shell at all. I'm not sure what to do with the signal catching
in the Init.sh script. I was going to look them up on Google and see
what they do. Then decide whether this is a feature that should be
duplicated in Python

Does it control how canceling commands (Ctrl+D, etc.) work?

On 6/11/06, Michael Barton <michael.barton@asu.edu> wrote:

We're trying to figure this out too to get Java and GRASS to talk to each
other.

Could you explain a bit more? What you say sounds like it doesn't really do
anything useful.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

> From: Glynn Clements <glynn@gclements.plus.com>
> Date: Sun, 11 Jun 2006 08:17:25 +0100
> To: David Finlayson <david.p.finlayson@gmail.com>
> Cc: GRASS developers list <grass-dev@grass.itc.it>
> Subject: Re: [GRASS-dev] $GISBASE/etc/run what does this do?
>
> David Finlayson wrote:
>
>> I am trying to understand $GISBASE/etc/Init.sh
>>
>> The final call is to a program $GIS/etc/run $SHELL
>>
>> What does "run" do exactly?
>
> It runs a command with SIGINT and SIGQUIT re-enabled (the Init.sh
> script ignores those signals, as well as SIGTERM).
>
> --
> Glynn Clements <glynn@gclements.plus.com>
>

--
David Finlayson

David Finlayson wrote:

Last night I got GRASS to launch and run entirely from Python. No
bourne shell at all. I'm not sure what to do with the signal catching
in the Init.sh script. I was going to look them up on Google and see
what they do. Then decide whether this is a feature that should be
duplicated in Python

Does it control how canceling commands (Ctrl+D, etc.) work?

If you don't run $SHELL via etc/run, the spawned shell will have
SIGINT and SIGQUIT disabled. In practice, this will typically disable
Ctrl-C and Ctrl-\ (the codes which generate the signals can be
changed, but those are the usual defaults).

AFAICT, the reason that Init.sh disables those signals is so that
Ctrl-C and Ctrl-\ go to the interactive session shell, not the shell
running the Init.sh script.

On a system which supports job control (which is likely to be every
Unix system still in use), that shouldn't be necessary, as the signals
will go to the foreground process group, which will be either the
spawned shell or its children.

--
Glynn Clements <glynn@gclements.plus.com>

Thanks to both of you for these informative answers. They are very helpful.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: Glynn Clements <glynn@gclements.plus.com>
Date: Sun, 11 Jun 2006 23:33:18 +0100
To: David Finlayson <david.p.finlayson@gmail.com>
Cc: Michael Barton <michael.barton@asu.edu>, GRASS developers list
<grass-dev@grass.itc.it>
Subject: Re: [GRASS-dev] $GISBASE/etc/run what does this do?

David Finlayson wrote:

Last night I got GRASS to launch and run entirely from Python. No
bourne shell at all. I'm not sure what to do with the signal catching
in the Init.sh script. I was going to look them up on Google and see
what they do. Then decide whether this is a feature that should be
duplicated in Python

Does it control how canceling commands (Ctrl+D, etc.) work?

If you don't run $SHELL via etc/run, the spawned shell will have
SIGINT and SIGQUIT disabled. In practice, this will typically disable
Ctrl-C and Ctrl-\ (the codes which generate the signals can be
changed, but those are the usual defaults).

AFAICT, the reason that Init.sh disables those signals is so that
Ctrl-C and Ctrl-\ go to the interactive session shell, not the shell
running the Init.sh script.

On a system which supports job control (which is likely to be every
Unix system still in use), that shouldn't be necessary, as the signals
will go to the foreground process group, which will be either the
spawned shell or its children.

--
Glynn Clements <glynn@gclements.plus.com>

David wrote:

I'm not sure what to do with the signal catching in the Init.sh
script. I was going to look them up on Google and see what they do.

http://www.everything2.com/index.pl?node_id=467946

Hamish