containerized syslog
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): 1265915683.19130.166.camel-4BUXZ/[email protected]
Quoted 30 lines · Jean-Marc Pigeon
Hello,
Quoted 4 lines
Thanks Jean-Marc. But this really isn't doing most of what I'd recommended in my last emails (both public and private. In particular:
[....]
Quoted 3 lines
syslog_nsshould be moved into nsproxy and unshared with a separateclone(CLONE_SYSLOG);This this not a problem.
My understanding a new clone flag was not an option as we are short in CLONE flag.
No design nor arch problem if we setCLONE_SYSLOGto be0x100000000?????If moved in nsproxy what is the hook to get the "current context". (used
current_user_ns()as it was inuser_namespace).[...]
Quoted 1 line
That was why I suggested:
[...]
Quoted 3 lines
Quoted 3 lines
! 4. take a printk call like the iptables ones you want and turn ! int into nsprintk syscall.
!
Quoted 6 lines
If my understanding is right you propose to use a special nsprintk to be used by iptable such we can send "packet log" in "container context" Right?
Logic is weak.
No logic is irrefutable :) Because:
Quoted 4 lines
1)
The way I changed printk, so far, make of it a "de facto" nsprintk. So when called from netfilter, nsprintk is still stay in HOST: context. My understanding,
No, it could be called from the context of a task in any random container.
-serge
A message that is not in the archive (sent off-list or not yet received): 20100211192952.GA20191-r/[email protected]
Quoted 40 lines · Serge E. Hallyn
Quoted 30 lines · Jean-Marc Pigeon
Hello,
Quoted 4 lines
Thanks Jean-Marc. But this really isn't doing most of what I'd recommended in my last emails (both public and private. In particular:
[....]
Quoted 3 lines
syslog_nsshould be moved into nsproxy and unshared with a separateclone(CLONE_SYSLOG);This this not a problem.
My understanding a new clone flag was not an option as we are short in CLONE flag.
No design nor arch problem if we setCLONE_SYSLOGto be0x100000000?????If moved in nsproxy what is the hook to get the "current context". (used
current_user_ns()as it was inuser_namespace).[...]
Quoted 1 line
That was why I suggested:
[...]
Quoted 3 lines
Quoted 3 lines
! 4. take a printk call like the iptables ones you want and turn ! int into nsprintk syscall.
!Quoted 6 lines
If my understanding is right you propose to use a special nsprintk to be used by iptable such we can send "packet log" in "container context" Right?
Logic is weak.
No logic is irrefutable :) Because:
Quoted 7 lines
Quoted 4 lines
1)
The way I changed printk, so far, make of it a "de facto" nsprintk. So when called from netfilter, nsprintk is still stay in HOST: context. My understanding,No, it could be called from the context of a task in any random container.
Your comments seem good. However, I do have an issue with the idea of finding a single syslog corresponding to the netns for a hypothetical printk in iptables.
What happens with:
/* in init_syslog_ns */clone(CLONE_SYSLOG) /* syslog_ns 1 */ clone(CLONE_SYSLOG) /* syslog_ns 2 */
<do something with iptables in the netns which triggers a printk>
Even though that same printk is relevant to three "syslogs", it'll only go to one, correct? If so, my feeling is that nsprintk shouldn't take a syslog_ns directly. It should take some other form of namespace and then write to the syslog of all the nsproxies which share that namespace (a netns in this case).
Cheers,
-Matt Helsley
A message that is not in the archive (sent off-list or not yet received): 20100213155813.GU3714-52DBMbEzqgQ/wnmkkaCWp/[email protected]
On Sat, Feb 13, 2010 at 07:58:13AM -0800, Matt Helsley wrote:
<snip>
Quoted 11 lines
Your comments seem good. However, I do have an issue with the idea of finding a single syslog corresponding to the netns for a hypothetical printk in iptables.
What happens with:
/* in
init_syslog_ns*/clone(CLONE_SYSLOG)/*syslog_ns1 */clone(CLONE_SYSLOG)/*syslog_ns2 */
<do something with iptables in the netns which triggers a printk>
Quoted 4 lines
Even though that same printk is relevant to three "syslogs", it'll only go to one, correct? If so, my feeling is that nsprintk shouldn't take a
syslog_nsdirectly. It should take some other form of namespace and then write to the syslog of all the
Sorry, I don't think I worded this clearly. "some other form" means a non-syslog_ns which is "relevant" to the printk e.g. a netns for iptables code.
Cheers,
-Matt Helsley
Quoted 60 lines · Matt Helsley
Quoted 40 lines · Serge E. Hallyn
Quoted 30 lines · Jean-Marc Pigeon
Hello,
Quoted 4 lines
Thanks Jean-Marc. But this really isn't doing most of what I'd recommended in my last emails (both public and private. In particular:
[....]
Quoted 3 lines
syslog_nsshould be moved into nsproxy and unshared with a separateclone(CLONE_SYSLOG);This this not a problem.
My understanding a new clone flag was not an option as we are short in CLONE flag.
No design nor arch problem if we setCLONE_SYSLOGto be0x100000000?????If moved in nsproxy what is the hook to get the "current context". (used
current_user_ns()as it was inuser_namespace).[...]
Quoted 1 line
That was why I suggested:
[...]
Quoted 3 lines
Quoted 3 lines
! 4. take a printk call like the iptables ones you want and turn ! int into nsprintk syscall.
!Quoted 6 lines
If my understanding is right you propose to use a special nsprintk to be used by iptable such we can send "packet log" in "container context" Right?
Logic is weak.
No logic is irrefutable :) Because:
Quoted 7 lines
Quoted 4 lines
1)
The way I changed printk, so far, make of it a "de facto" nsprintk. So when called from netfilter, nsprintk is still stay in HOST: context. My understanding,No, it could be called from the context of a task in any random container.
Your comments seem good. However, I do have an issue with the idea of finding a single syslog corresponding to the netns for a hypothetical printk in iptables.
What happens with:
/* in
init_syslog_ns*/clone(CLONE_SYSLOG)/*syslog_ns1 */clone(CLONE_SYSLOG)/*syslog_ns2 */
<do something with iptables in the netns which triggers a printk>
Quoted 5 lines
Even though that same printk is relevant to three "syslogs", it'll only go to one, correct? If so, my feeling is that nsprintk shouldn't take a
syslog_nsdirectly. It should take some other form of namespace and then write to the syslog of all the nsproxies which share that namespace (a netns in this case).
Could do that - but I think it'd be fair to just keep track of a single netns->syslog_ns, namely the one which corresponded to the netns when netns was created.
Don't allow unshare of syslog_ns, only clone. That ensures that the init task in a container will always be tied to the same net, pid, and syslog namespaces, giving us a point of sanity.
-serge