[lxc-devel] [PATCH 0/2] change pivotdir and its documentation

2010-06-10 Thread Ferenc Wagner
Hi,

The documentation part of this depends on my previous rootfs documentation
patch.

Cheers,
Feri.


Ferenc Wagner (2):
  change pivotdir default to mnt
  fix comment

 doc/lxc.conf.sgml.in |2 +-
 src/lxc/conf.c   |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)


--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel


Re: [lxc-devel] [PATCH 4/5] generalize the name of the signal handler

2010-06-10 Thread Daniel Lezcano
On 06/09/2010 07:56 PM, Ferenc Wagner wrote:
 Signed-off-by: Ferenc Wagnerwf...@niif.hu


+1

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel


Re: [lxc-devel] [PATCH 1/5] start child in its own process group, and put it into the foreground

2010-06-10 Thread Daniel Lezcano
On 06/09/2010 07:56 PM, Ferenc Wagner wrote:
 Signed-off-by: Ferenc Wagnerwf...@niif.hu
 ---
   src/lxc/start.c |   17 +
   1 files changed, 17 insertions(+), 0 deletions(-)

 diff --git a/src/lxc/start.c b/src/lxc/start.c
 index b69ac88..7bbcf5a 100644
 --- a/src/lxc/start.c
 +++ b/src/lxc/start.c
 @@ -463,6 +463,7 @@ int lxc_spawn(struct lxc_handler *handler)
   int clone_flags;
   int failed_before_rename = 0;
   const char *name = handler-name;
 + int ctty;

   if (lxc_sync_init(handler))
   return -1;
 @@ -509,6 +510,22 @@ int lxc_spawn(struct lxc_handler *handler)
   }
   }

 + if (setpgid(handler-pid, 0)) {
 + SYSERROR(failed to create new process group);
 + goto out_delete_net;
 + }
 + DEBUG(created new process group %d, handler-pid);
 + ctty = open(/dev/tty, O_RDONLY);
 + if (ctty != -1) {
 + int ret = tcsetpgrp(ctty, handler-pid);
 + close(ctty);
 + if (ret) {
 + SYSERROR(failed to set terminal foreground process 
 group);
 + goto out_delete_net;
 + }
 + DEBUG(set terminal foreground process group);
 + }


Is there a particular reason to do that from the parent and not from the 
child ?

   /* Tell the child to continue its initialization and wait for
* it to exec or return an error
*/



--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel


Re: [lxc-devel] [PATCH 2/5] lxc-start isn't in the foreground anymore, so TTY signals don't reach it

2010-06-10 Thread Daniel Lezcano
On 06/09/2010 07:56 PM, Ferenc Wagner wrote:
 Signed-off-by: Ferenc Wagnerwf...@niif.hu
 ---
   src/lxc/start.c |9 -
   src/lxc/utils.h |   29 ++---
   2 files changed, 2 insertions(+), 36 deletions(-)


Yeah, cleanup ! +1

 diff --git a/src/lxc/start.c b/src/lxc/start.c
 index 7bbcf5a..ccd8bcd 100644
 --- a/src/lxc/start.c
 +++ b/src/lxc/start.c
 @@ -129,9 +129,6 @@ int signalfd(int fd, const sigset_t *mask, int flags)

   lxc_log_define(lxc_start, lxc);

 -LXC_TTY_HANDLER(SIGINT);
 -LXC_TTY_HANDLER(SIGQUIT);
 -
   static int match_fd(int fd)
   {
   return (fd == 0 || fd == 1 || fd == 2);
 @@ -574,10 +571,6 @@ int __lxc_start(const char *name, struct lxc_conf *conf,
   goto out_fini;
   }

 - /* Avoid signals from terminal */
 - LXC_TTY_ADD_HANDLER(SIGINT);
 - LXC_TTY_ADD_HANDLER(SIGQUIT);
 -
   err = lxc_poll(name, handler);
   if (err) {
   ERROR(mainloop exited with an error);
 @@ -589,8 +582,6 @@ int __lxc_start(const char *name, struct lxc_conf *conf,

   err =  lxc_error_set_and_log(handler-pid, status);
   out_fini:
 - LXC_TTY_DEL_HANDLER(SIGQUIT);
 - LXC_TTY_DEL_HANDLER(SIGINT);
   lxc_unlink_nsgroup(name);
   lxc_fini(name, handler);
   return err;
 diff --git a/src/lxc/utils.h b/src/lxc/utils.h
 index 114b668..d47c983 100644
 --- a/src/lxc/utils.h
 +++ b/src/lxc/utils.h
 @@ -23,34 +23,9 @@
   #ifndef _utils_h
   #define _utils_h

 -#define LXC_TTY_HANDLER(s) \
 - static struct sigaction lxc_tty_sa_##s; \
 - static void tty_##s##_handler(int sig, siginfo_t *info, void *ctx) \
 - {   \
 - if (lxc_tty_sa_##s.sa_handler == SIG_DFL || \
 - lxc_tty_sa_##s.sa_handler == SIG_IGN)   \
 - return; \
 - (*lxc_tty_sa_##s.sa_sigaction)(sig, info, ctx); \
 - }
 -
 -#define LXC_TTY_ADD_HANDLER(s) \
 - do { \
 - struct sigaction sa; \
 - sa.sa_sigaction = tty_##s##_handler; \
 - sa.sa_flags = SA_SIGINFO; \
 - sigfillset(sa.sa_mask); \
 - /* No error expected with sigaction. */ \
 - sigaction(s,sa,lxc_tty_sa_##s); \
 - } while (0)
 -
 -#define LXC_TTY_DEL_HANDLER(s) \
 - do { \
 - sigaction(s,lxc_tty_sa_##s, NULL); \
 - } while (0)
 -
 -#endif
 -
   extern int lxc_copy_file(const char *src, const char *dst);
   extern int lxc_setup_fs(void);
   extern int get_u16(ushort *val, const char *arg, int base);
   extern int mkdir_p(const char *dir, mode_t mode);
 +
 +#endif



--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel


Re: [lxc-devel] [PATCH 3/5] forward signals to the container init

2010-06-10 Thread Daniel Lezcano
On 06/09/2010 07:56 PM, Ferenc Wagner wrote:
 Signed-off-by: Ferenc Wagnerwf...@niif.hu


+1

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel


Re: [lxc-devel] [PATCH 1/5] start child in its own process group, and put it into the foreground

2010-06-10 Thread Ferenc Wagner
Daniel Lezcano daniel.lezc...@free.fr writes:

 On 06/09/2010 07:56 PM, Ferenc Wagner wrote:

 @@ -509,6 +510,22 @@ int lxc_spawn(struct lxc_handler *handler)
  }
  }

 +if (setpgid(handler-pid, 0)) {
 +SYSERROR(failed to create new process group);
 +goto out_delete_net;
 +}
 +DEBUG(created new process group %d, handler-pid);
 +ctty = open(/dev/tty, O_RDONLY);
 +if (ctty != -1) {
 +int ret = tcsetpgrp(ctty, handler-pid);
 +close(ctty);
 +if (ret) {
 +SYSERROR(failed to set terminal foreground process 
 group);
 +goto out_delete_net;
 +}
 +DEBUG(set terminal foreground process group);
 +}


 Is there a particular reason to do that from the parent and not from the 
 child ?

I can't think of one.  It shouldn't matter, as long as the child can
open /dev/tty.
-- 
Regards,
Feri.

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel


Re: [lxc-devel] [PATCH 5/5] document rootfs options

2010-06-10 Thread Daniel Lezcano
On 06/09/2010 07:56 PM, Ferenc Wagner wrote:
 Signed-off-by: Ferenc Wagnerwf...@niif.hu


Great, Thanks ! +1


--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel