← Back to team overview

rohc team mailing list archive

Re: [Question #136098]: still awaiting reply for previously asked question

 

Question #136098 on rohc changed:
https://answers.launchpad.net/rohc/+question/136098

Didier Barvaux posted a new comment:
Hello,

First sorry for the very long answer delay...

Second, I was finally able to reproduce the problem you encountered!
Your problem is due to the "sudo" command. If you run the rohctunnel
command I specified within sudo, it does not work as expected. The
redirections are made for the sudo process, not the rohctunnel one.

With the command below, the "1>", "2>", "3>" and "4>" redirections apply
to the rohctunnel process. So, the file descriptors 1, 2, 3 or 4 won't
be affected to the rohc0 interface or the UDP socket. They are already
reserved for one of the 4 files "lib_output", "tunnel_output",
"comp_stats" or "decomp_stats".

 # rohctunnel rohc0 remote 192.168.0.200 local 192.168.0.1 \
     port 5000 dir unidirectional \
     1>lib_output 2>tunnel_output \
     3>comp_stats 4>decomp_stats

With the sudo command below, the "1>", "2>", "3>" and "4>" redirections
apply to the sudo process. So, the file descriptors 1, 2, 3 or 4 may be
affected to the rohc0 interface or the UDP socket. They are not reserved
for one of the 4 files "lib_output", "tunnel_output", "comp_stats" or
"decomp_stats".

 $ sudo rohctunnel rohc0 remote 192.168.0.200 local 192.168.0.1 \
     port 5000 dir unidirectional \
     1>lib_output 2>tunnel_output \
     3>comp_stats 4>decomp_stats

The easiest solution is to avoid sudo at all. Run a shell as root before
starting the rohctunnel command:

 $ sudo /bin/bash
 # rohctunnel rohc0 remote 192.168.0.200 local 192.168.0.1 \
     port 5000 dir unidirectional \
     1>lib_output 2>tunnel_output \
     3>comp_stats 4>decomp_stats


I juste updated FAQ #639 to add a warning note about using sudo:
    IMPORTANT NOTE: please do not run the above command within sudo
    because sudo does not fit well with redirections of file descriptors.


Regards,
Didier

-- 
You received this question notification because you are a member of ROHC
Team, which is an answer contact for rohc.