custom/captive logins in Solaris 2.6 CDE

I have the basics of a captive login environment under CDE/Solaris 2.6.

Now what I need to do some furthur customization.

We have an application program which uses Motif to display a menu

for the user. Is there any way to have the exit button on this menu

force a logout.

========================================================================

Summary:

The response from David Thorburn-Gundlach <david@bae.uga.edu>

was the most usefull. After a bit of digging around, I found

a command accessible from the shell, dtaction.

I can now run my menu from a shell script at login.

Here is what I have now:

/etc/dt/config/Xsession.d/0090.cfmss:

#!/bin/ksh

#

# cfmss specific session initializations

#

if [ `groups | grep cfmss_sched` ]

then

. /usr/local/bin/local_profile

. run_mefis_menu&

fi

Note: local_profile defines PATH and other necessary environment

variables. Only users in the group cfmss_sched get the menu.

run_mefis_menu:

#!/bin/ksh

#

# Run mefis_menu and kill the session when done

#

env

mefis_menu

/usr/dt/bin/dtaction ExitSession

/etc/dt/config/sys.dtwmrc contains a modified root menu containing

only the logout command.

/etc/dt/app-defaults/C/Dtwm contains the line:

        Dtwm*useFrontPanel: False

Software developers and system administrators can get to a shell

if they have $HOME/.dt/dtwmrc with the default root menu.

In order to insure that we are not all locked out, I need to make

certain that privileged users have a $HOME/.dt/dtwmrc with a complete

menu.

Anyone see and loopholes in the above?

Thanks for all of the quick answers to my question.

Peter Schauss

ps4330@okc01.jccbi.gov

Gull Electronic Systems Division

Parker Hannifin Corporation

Smithtown, NY

_________________________________________________________________________

Details from responses:

From: "Brooke King (6532)" <jbking@sass1633.csua35.sandia.gov>

The exit button will lead to a logout if the shell invoking your

application exits immediately after the application exits.

From: Richard Skelton <rich@brake.demon.co.uk>

>From the file /usr/dt/config/C/sys.dtwmrc :-

     "Log out..." f.action ExitSession

From: David Thorburn-Gundlach <david@bae.uga.edu>

Peter --

I did a quick dig through /usr/dt/appconfig/types/C (where all of the

front panel images and actions are defined) and found that the exit

button calls the action "ExitSession", which calls "XSession_Exit".

Try binding XSession_Exit (probably a Motif command) or ExitSession (a

dtaction) to your exit button and see what you get.

From:gibian@stars1.hanscom.af.mil (Marc S. Gibian)

There is probably a simpler way, but you could always have mwm/dtwm menu execute

the dtaction command to execute the action for logout (I'd have to lookup the

specific name for that action if you need it).

-Marc

From: "Brooke King (6532)" <jbking@sass1633.csua35.sandia.gov>

I haven't used Motif in a long time, but I suppose you could

start your app at the end of your .xinitrc, follow it with an

exit, and not start mwm. If you want a captive environment, then

maybe you don't need mwm.

Upon further reflection, I realize this is quite a problem if you

want/need mwm for your application. Maybe you could put a wrapper

script around your app, and have the wrapper send a SIGTERM (with

kill (manual section 1)) to any mwm process with the same user ID

after the app exits and returns to the script. You would start

the wrapper script backgrounded in your .xinitrc before you start

mwm.

[5105 byte] By [CodeProf.com] at [2007-12-25 10:02:00]