clearpathrobotics / robot_upstart

ROS package of helper functions related to bringing up roslaunch on system startup.
BSD 3-Clause "New" or "Revised" License
196 stars 96 forks source link

Upstart generates no logs #63

Open chrisspen opened 6 years ago

chrisspen commented 6 years ago

Is there any special setup needed to get logging to work with robot_upstart?

In the previous version of robot_upstart, it worked perfectly, and logs were generated to the standard ~/.ros/log directory. I recently upgraded to the most recent package in Ubuntu 16.04, installing my service with:

source /usr/local/myrobot/src/ros/setup.bash; rosrun robot_upstart install --setup /usr/local/myrobot/src/ros/setup.bash --job myrobot --user ubuntu myrobot/launch/all.launch

My all.launch looks like:

<launch>
    <include file="$(find myrobot)/launch/serial_head.launch" />
    <include file="$(find myrobot)/launch/serial_torso.launch" />
    <include file="$(find myrobot)/launch/sound.launch" />
    <include file="$(find myrobot)/launch/status.launch" />
    <include file="$(find myrobot)/launch/diagnostics_aggregator.launch" />
    <include file="$(find myrobot)/launch/robot_state_publisher.launch" />
</launch>

Running rostopic list or rosnode list shows several things running, yet my ~/.ros/log remains empty. This is especially frustrating since a few nodes aren't running, and I can't find any logs to shed light on the problem.

Is logging not supported via upstart, or does it require some special configuration?

If I run roslaunch myrobot all.launch from a regular terminal, everything starts correctly, and logs are created, so I'm assuming there's some issue with upstart using incorrectly permissions, even though it should be starting with my user, which is ubuntu.

The default /var/log/upstart log directory specified in your help docs is not created either.

wujiang commented 6 years ago

Looks like it logs to /tmp by default.

mikepurvis commented 6 years ago

Ubuntu 16.04 is now systemd-based, so there's no more /var/log/upstart directory. The stdout capture which used to go there is now available via sudo journalctl -u myrobot.

If you want to set ROS_LOG_DIR to something other than /tmp, pass --logdir to the install script or use Job(log_path=...):

http://docs.ros.org/jade/api/robot_upstart/html/install.html http://docs.ros.org/jade/api/robot_upstart/html/jobs.html