Silly bin/sh question

More
19 Jun 2011 11:15 - 19 Jun 2011 11:15 #10619 by Mike_Eitel
Replied by Mike_Eitel on topic Re:Silly bin/sh question
Hi

I tried in a file called M105

#!/bin/sh

# M101 in your G code program will run the Linux commands in this
# shell script "batch" file, passing the P and Q variables as command
# line arguments.
# give the command line arguments descriptive names
#P=$1
#Q=$2
axis-remote -c
exit 0

NO REACTION

I tired in terminal and get the error message:
x server insecure (must use xauth-style authorisation); command ignored

What do I do wrong?
EMC 2.4.6 UBU 8.4
THX Mike
Last edit: 19 Jun 2011 11:15 by Mike_Eitel. Reason: typo

Please Log in or Create an account to join the conversation.

More
19 Jun 2011 13:50 #10622 by ArcEye
Replied by ArcEye on topic Re:Silly bin/sh question
Hi

I created a test file which just called axis-remote -c , same as yours, and it works both as a child process of Axis and from a separate terminal window.

So I suspect that either your path is not set up, or your file permissions are wrong, or your user permissions are wrong.

All M1xx must be located in the directory set out in your .ini file
eg.
[DISPLAY]
.....
PROGRAM_PREFIX = /home/me/emc2/ngc

If they are not they will not work, but you should get an error to stderr saying the file could not be found.

Next all M1xx files must be executable by all users, ie permissions set at least to 755 and maybe 777 to be ultra sure.
If you try to create file permissions as a user with limited access, that often is the source of the problem.
Log in a root to be sure before using chmod or at least use 'sudo chmod'

I personally never use /bin/sh, but rather /bin/bash, but that is because it is more powerful and flexible and I am more familiar with it.
It should not make any difference to the command succeeding.

Attached is a zip file containing the file which works on my system, with permissions set wide open at 777.
If that works, backtrack from there as above.

regards

File Attachment:

File Name: M105.zip
File Size:0 KB
Attachments:

Please Log in or Create an account to join the conversation.

More
19 Jun 2011 16:05 #10624 by Mike_Eitel
Replied by Mike_Eitel on topic Re:Silly bin/sh question
THX Arceye

I'll try that tommorow.
Principally I have the M1xx running, My problem is that I can not see them in the axis window...... Thats why I want to try remore axis.

When I do test f.x with halpins it works fine

I always can test that in a terminal before I "code it into a file"

So I wonder why I can not run axis-remote ... I get as described a error message that I do interpret as an acess-rights problem.

Can you run these fubctions via terminal .. Can you request the -c and get no error message?

Mike

Please Log in or Create an account to join the conversation.

More
20 Jun 2011 13:08 #10653 by Mike_Eitel
Replied by Mike_Eitel on topic Re:Silly bin/sh question
HI I tested again

I can set a halpin...... So think I handle correc basic treatment of M1xx via pyvcp..

Still axis-remote is not showing any reaction.
Thats why I remain on my question why do I get in terminal windows this error message:

x server insecure (must use xauth-style authorisation); command ignored

Any ideas ?

THX
Mike

Please Log in or Create an account to join the conversation.

More
20 Jun 2011 14:14 - 20 Jun 2011 15:07 #10662 by ArcEye
Replied by ArcEye on topic Re:Silly bin/sh question
Hi

See the below, basically your xserver is insecure, you probably have set it for automatic login or allowed remote login or similar.

wiki.tcl.tk/1829

Make sure you have to log in as a user with a password and get an xauth style auth via a window manager.
Just using gdm set up properly should do it.

I use ldm, which is more secure and way, way faster than gdm, but that's just my preference.

It is worth persevering with the M1xx files.
The file can be a simple bash script or even a compiled C program, receiving the P and Q arguments via the main(argc, argv) function, so you can do some pretty powerful stuff.

regards
Last edit: 20 Jun 2011 15:07 by ArcEye.

Please Log in or Create an account to join the conversation.

More
20 Jun 2011 21:53 #10686 by Mike_Eitel
Replied by Mike_Eitel on topic Re:Silly bin/sh question
Salu ArcEye

I do not fully understand:
Make sure you have to log in as a user with a password and get an xauth style auth via a window manager.
Just using gdm set up properly should do it.


I call the terminal from the same logged in session, so why should I give additional user etc.

Is your --- xauth style auth via a window manager --- something oter then the build-in terminal window I aways use?
I kow I'm not an linux guru, so please excuse If my questions are too basic....


Mike

Please Log in or Create an account to join the conversation.

More
21 Jun 2011 08:41 #10692 by ArcEye
Replied by ArcEye on topic Re:Silly bin/sh question
Sorry

You need to follow the link I sent you and work through it, google any bits you don't understand.

I am not saying you need to log in as another user, rather that there is something wrong with the log in you are using

As a quick check to confirm this is the problem, run 'xhost' from the commandline

If you don't get 'access control enabled, only authorized clients can connect' this is the problem you have.

wiki.tcl.tk/1831 covers that problem in detail

regards

Please Log in or Create an account to join the conversation.

More
22 Jun 2011 11:07 #10758 by ArcEye
Replied by ArcEye on topic Re:Silly bin/sh question
See also this thread
www.linuxcnc.org/component/option,com_ku.../lang,english/#10757

You might want to try what I suggested to plasdom and run as root to sort out whether it is down to your user permissions.

You still need to secure your xserver, but that is a separate issue.

regards

Please Log in or Create an account to join the conversation.

Time to create page: 0.077 seconds
Powered by Kunena Forum