The install
script¶
Use this tool to quickly and easily create system startup jobs which run one or more ROS launch files as a daemonized background process on your computer. More advanced users will prefer to access the Python API from their own setup scripts, but this exists as a simple helper, an example, and a compatibility shim for previous versions of robot_upstart which were bash-based.
usage: install [-h] [--job JOB] [--interface ethN] [--user NAME]
[--setup path/to/setup.bash] [--rosdistro DISTRO]
[--master http://MASTER:11311] [--logdir path/to/logs]
[--augment] [--provider [upstart|systemd]] [--symlink] [--wait]
pkg/path [pkg/path ...]
- Positional arguments:
pkgpath Package and path to install job launch files from. Make sure the path starts with the package name (e.g. don’t pass absolute path nor a path starting from workspace top folder etc.) - Options:
--job Specify job name. If unspecified, will be constructed from package name (first element before underscore is taken, e.g. ‘myrobot’ if the package name is ‘myrobot_bringup’). --interface Specify network interface name to associate job with. --user Specify user to launch job as. --setup Specify workspace setup file for the job launch context. --rosdistro Specify ROS distro this is for. --master Specify an alternative ROS_MASTER_URI for the job launch context. --logdir Specify an a value for ROS_LOG_DIR in the job launch context. --augment=False Bypass creating the job, and only copy user files. Assumes the job was previously created. --provider Specify provider if the autodetect fails to identify the correct provider --symlink=False Create symbolic link to job launch files instead of copying them. --wait=False Pass a wait flag to roslaunch.
Permissions¶
It’s important to understand how permissions work robot_upstart:
- The upstart job invokes its jobname-start bash script as root.
- The script sets up environment variables, and then uses setuidgid to execute roslaunch as an unprivileged user. This is by default the user who ran the install script, but it can also be specified explicitly via a flag.
- The roslaunch which executes does not have its user’s group memberships. This means that it will not have access to serial ports with the dialout group, or locations in /var/log owned by root, etc. Any filesystem resources needed by your ROS nodes should be chowned to the same unprivileged user which will run ROS, or should set to world readable/writeable, for example using udev.
Implementation¶
If you’re in the process of transitioning from using the install
script
to the Python API, it may be helpful to inspect exactly how the script uses
the API. You can find its implementation in the
robot_upstart.install_script.main()
function.