-
Notifications
You must be signed in to change notification settings - Fork 63
"Daemon" mode #221
"Daemon" mode #221
Conversation
| NULL) == -1) { | ||
| perror("mount devpts failed"); | ||
| return -1; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could move the above code and some init-related code into a function.
and the new function should be called only when argv[0] == "init".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still consider moving the above code and some init-related code into a function better than introducing system_mount()? @dlespiau what do you think? it might be better in looking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sure, I'll have a look.
Currently it's only the system mounts that are causing problems because they are actually trying to remount the already mounted file systems, so might just pull those in a separate function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the commit for Regrouped the early setup code (system mounts, becoming session leader and setting up a controlling terminal in a single function that is skipped when not running as "init". is missing
| @@ -1,3 +1,12 @@ | |||
| AM_CFLAGS = -Wall -Werror | |||
| bin_PROGRAMS=init | |||
| init_SOURCES=init.c jsmn.c net.c util.c parse.c parson.c container.c exec.c event.c portmapping.c | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can compile it to src/hyperstart only.
and copy src/hyperstart to rootfs/init in the make-initrd.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops, pushed the wrong branch, the new update should have the correct commmits.
|
trivis error: checking for SYSTEMD... no |
8a8f9a6 to
12bf280
Compare
|
PR updated:
|
12bf280 to
8f3c07b
Compare
|
PR updated:
|
| #include "container.h" | ||
| #include "../config.h" | ||
|
|
||
| char *read_cmdline(void) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we should remove it, we may pass the debug level from it in future.
#170
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What the function does is "return NULL", I'm not really removing anything useful that would need to be rewritten :)
8f3c07b to
12bf280
Compare
|
PR updated:
|
12bf280 to
ba71111
Compare
|
Is there anything else blocking this PR? Thanks! |
|
ping! :) |
|
👍 |
|
Hi, Can I do anything to help this PR getting merged? Or maybe you do not want to support hyperstart as a regular daemon? Thanks, |
src/init.c
Outdated
| { | ||
| char *cmdline, *ctl_serial, *tty_serial; | ||
| if (!is_init) | ||
| return 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cloud you move the test up (outside this hyper_setup_init_process())?
and it seams better to remove this global is_init since there is no other usage.
| return -1; | ||
| } | ||
|
|
||
| cmdline = read_cmdline(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leave this in the hyper_setup_init_process()
|
@dlespiau Sorry for the delay, we are willing to enable the daemon mode, and we are working on get this to be merged soon. BTW, could you share some tests/comparison of the daemon mode? |
|
Can one of the admins verify this patch? |
1 similar comment
|
Can one of the admins verify this patch? |
|
hello @dlespiau, could you update the pr please? |
|
hyperstart uses devtmpfs for containers' /dev, but devtmpfs is the singleton in the whole system, |
I have one of the autoconf generated files not being ignored, config.h.in~, it's usual to igore /config.* in one go. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
We'd like to be able to run hyperstart as a regular daemon as well as the init system and have small behavioural differences between the two. Start by renaming the binary to "hyperstart", it will be copied as "init" when preparing the initrd. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
This commit adds a systemd service file to start hyperstart when configured in daemon mode. v2: Fix the case where we don't have have the systemd pkgconfig file (Damien) Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
We base this detection on the name of the binary: "init" means we've been started as an init system. When not running as an init system, we can skip the basic initialisation as systemd or any other init system would have done that for us. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
ba71111 to
0611644
Compare
|
Updated PR:
|
|
@laijs we haven't seen any problems with the containers' /dev so far. |
It'd be nice if we could use hyperstart as a regular daemon instead of just an init system. This allows us to: