Repository navigation
Conversation
`init` should be a symlink to `systemd` not `systemctl`. See comments in systemd#8300.
|
Actually, I'm not sure if this is a good change. This is not relevant to any use of |
| arg_action = ACTION_POWEROFF; | ||
| return shutdown_parse_argv(argc, argv); | ||
| } else if (strstr(program_invocation_short_name, "init")) { | ||
| } else if (strstr(program_invocation_short_name, "telinit")) { |
There was a problem hiding this comment.
no, this isn't right. note that we use "strstr()" here, not "streq()"...
On SysV "telinit" was the official command to communicate with PID 1, but "init" would redirect itself to "telinit" if called with PID != 1. We follow the same logic here still, though we add one level of indirection, as we implement "telinit" in "systemctl". Hence, for us if you invoke "init" you get "systemd", but it will execve() "systemctl" immediately with argv[] unmodified if PID is != 1. If you invoke "telinit" you directly get "systemctl". In both cases we shall do the same thing, which is why we do strstr(p_i_s_n, "init") here, as a quick way to match both.
Also see redirect_telinit() in src/core/main.c.
Hence, this patch isn't right, as it will break the path through systemd. However this path is really not obvious, hence I figure we should really document this better, by adding a comment right here that briefly explains the weird call chain.
There was a problem hiding this comment.
Ah, I completely misunderstand the logic. Thank you for the explanation.
|
As already commented. This is based on my misunderstanding. Let's close this. |
|
I added a commit that adds a comment for this in #8296 |
initshould be a symlink tosystemdnotsystemctl.See comments in #8300.