Hi Thanks,It is exactly what I want. ----- 原邮件 ----- 从: Cedric Le Goater <legoa...@free.fr> 日期: 星期二, 十二月 13日, 2011 下午4:10 主题: Re: [lxc-devel] 回复 :Re: How to change to lxc internal PID to system wide PID
> On 12/13/2011 02:49 AM, yi...@neusoft.com wrote: > > Hi Gregory Kurz > > > > From the google search,SCM_CREDENTIALS contains the PID of > the > > sender process,in the sender's > > PID namespace. > > So if the lxc App acts as the sender, the PID is 2 which is > also > > invalid for the host. > > (lxc has its own PID namesapce) > > Correct me if wrong,thanks. > > the pid in 'struct ucred' will be translated in the pid namespace of > the receiving side. > > on the host, run the receiving side : > > http://man7.org/tlpi/code/online/dist/sockets/scm_cred_recv.c .html > > $ ./scm_cred_recv > Receiving via stream socket > recvmsg() returned 4 > Received data = 12345 > Received credentials pid=20333, uid=1017, gid=100 > Credentials from SO_PEERCRED: pid=20333, euid=1017, egid=100 > > > and in an lxc (application) container, run the sending side : > > http://man7.org/tlpi/code/online/dist/sockets/scm_cred_send.c .html > > $ lxc-execute -n foo -- ./scm_cred_send > Send credentials pid=2, uid=1017, gid=100 > sendmsg() returned 4 > > Regards, > > C. > --------------------------------------------------------------------------------------------------- Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. --------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------ Cloud Computing - Latest Buzzword or a Glimpse of the Future? This paper surveys cloud computing today: What are the benefits? Why are businesses embracing it? What are its payoffs and pitfalls? http://www.accelacomm.com/jaw/sdnl/114/51425149/ _______________________________________________ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel