ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

robot_upstart perminantly change ownership

asked 2016-11-03 19:46:19 -0500

updated 2016-11-04 02:17:26 -0500

mgruhler gravatar image

Hi,

I am using robot_upstart to launch my code. My code needs to access several ports that are owned by root (dev/USB0, dev/USB1, dev/ACM0, etc...). I changed the owner of these files to the same user that I used to run the robot_upstart intall script by running sudo chown ubuntu /[file name]

Now I've restarted the computer which has changed the ownership back to root. I started researching how to change the ownership permanently but some people were saying that this is bad practice. Is this so? If so how should I fix this? If not how to I change the owner permanently?

Thanks in advance!

edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted
1

answered 2016-11-05 07:12:26 -0500

gvdhoorn gravatar image

updated 2016-11-05 07:13:33 -0500

Note the section in the docs that tell you that robot_upstart does not run under your own user:

The roslaunch which executes does not have its user’s group memberships.

Adding your user to dialout does not work.

See robot_upstart: could not open port /dev/ttyUSB0 for a related question (almost a duplicate, really).

edit flag offensive delete link more

Comments

That does not make sense.The script uses setuidgid and sets to the user specified, which is in the diarlout group. When I do the same thing in my case and look at the processes run in htop the process user is correct. So how can the process run as the specified ser but not have the permissions user

borgcons gravatar image borgcons  ( 2017-12-06 13:50:31 -0500 )edit
0

answered 2016-11-04 02:15:53 -0500

mgruhler gravatar image

This is not a problem of robot_upstart.

Either make sure that you have the access rights as your user. Typically, the group dialout has read-write access to those ports (if I'm correct). So add your user to this group: sudo usermod -a -G dialout $USER or sudo adduser $USER dialout. Then log out or reboot and you should be in this group and have access.

An alternative would be to define a udev rule to permanantly change the access rights. But I would not do this if it is not required.

edit flag offensive delete link more

Comments

For some reason that didn't worked. My user is 'ubuntu'. I checked that ubuntu is part of dialout after reboot by doing $ getent group dialout which gives dialout:x:20:ubuntu. So I checked that dialout has rw access with ls -l /dev/tty... which gives crw-rw---- 1 root dialout... for each.

shoemakerlevy9 gravatar image shoemakerlevy9  ( 2016-11-04 10:13:11 -0500 )edit
0

answered 2016-11-04 11:40:07 -0500

kmhallen gravatar image

Example using udev to change permissions of USB devices:
https://bitbucket.org/DataspeedInc/da...

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2016-11-03 19:46:19 -0500

Seen: 403 times

Last updated: Nov 05 '16