1748145 Members
3618 Online
108758 Solutions
New Discussion юеВ

Re: auto logout

 
SOLVED
Go to solution
Patrick Wallek
Honored Contributor

Re: auto logout

What is "./run_the_application"? Is that an executable or is it another script? If it is a script, please post the contents. There may be some code in there that is affecting us.
HPquestion
Regular Advisor

Re: auto logout


We are using reflection X software.

Reflection x is passing

/usr/bin/X11/xterm -fn 6x13 -sb -ls -display %IP#% -name %T% &)

command to open the xterm
HPquestion
Regular Advisor

Re: auto logout

"./run_the_application" is a binary executable.
Patrick Wallek
Honored Contributor
Solution

Re: auto logout

What you should do is put all of this in its own script and call it with the '-e' option to xterm.

Create a small scripts and "run_the_application.sh" and put it somewhere.

The contents would be:

# cat run_the_application.sh
#!/usr/bin/sh
cd /home/somestuff
./run_the_application

Be sure to take the lines out of the .profile, and make sure you make run_the_application.sh executable for the appropriate users.

Now modify your xterm line to be:

/usr/bin/X11/xterm -fn 6x13 -sb -ls -display %IP#% -name %T% -e /path/to/run_the_application.sh &)
HPquestion
Regular Advisor

Re: auto logout

Thanks Patrick...its working now :-)
HPquestion
Regular Advisor

Re: auto logout

It worked..now I have a related question.

usr/bin/X11/xterm -fn 6x13 -sb -ls -display %IP#% -name %T% -e /path/to/run_the_application.sh &)

My unix auditor doesn't like to see startup program as /usr/bin/csh in the /etc/passwd file as these users are not allowed to open a shell and do anyting. They are just allowed to run the application using x windows directly.

But if I put the startup program as /usr/bin/false instead of /usr/bin/csh for these user, the above command doesn't open the desired application.
What to do?

Thanks again!
Bill Hassell
Honored Contributor

Re: auto logout

It sounds like you want just the Xprogram to run and then disappear. Rather than put a real shell for a restricted user, create a shell script that starts your Xprogram followed by exit. Then the user's shell will actually be the script. Most Unix sysadmins do everything they can to prevent the scummy csh from ever running anywhere. Your shell script should look like this:

#!/usr/bin/sh
export DISPLAY+$(who -muR | awk '{print $NF}'):0.0
/full/pth/to/your/Xprogram some-params
exit

Save it and use chmod 755 yourScript. Run it interactively to make sure it works. Note that if any other variables are required for this program to run, be sure to include them in this script.


Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: auto logout

>Bill: export DISPLAY+$(who -muR | awk '{print $NF}'):0.0

Slight typo: export DISPLAY=$(who -muR ...
HPquestion
Regular Advisor

Re: auto logout

Tried something like below as suggested. but its not opening the application at all.

#!/usr/bin/sh
export DISPLAY=$(who -muR | awk '{print $NF}'):0.0
/full/pth/to/your/Xprogram some-params
exit


Thanks for any help on this
Bill Hassell
Honored Contributor

Re: auto logout

Tried something like below as suggested. but its not opening the application at all.

#!/usr/bin/sh
export DISPLAY=$(who -muR | awk '{print $NF}'):0.0
/full/pth/to/your/Xprogram some-params
exit

Try something is known to work:

#!/usr/bin/sh
export DISPLAY=$(who -muR | awk '{print $NF}'):0.0
/usr/bin/X11/xclock
exit

This should bring up the Xwindows clock. Your application should follow the $DISPLAY variable but if it does not, set the display according to their documentation.


Bill Hassell, sysadmin