Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iterate over possible /sbin/init alternative paths #129

Open
moul opened this issue Jan 15, 2016 · 2 comments
Open

Iterate over possible /sbin/init alternative paths #129

moul opened this issue Jan 15, 2016 · 2 comments

Comments

@moul
Copy link
Contributor

moul commented Jan 15, 2016

  • /sbin/init
  • /lib/systemd/...
@moul moul changed the title Iterate over know possible /sbin/init files Iterate over possible /sbin/init alternative paths Feb 4, 2016
@muhmuhten
Copy link

/lib/systemd/systemd probably isn't a serious concern as the list of init paths the kernel tries doesn't include it and hasn't changed in over a decade, which means that any sane distribution is going to have to provide a binary named init.

It looks like the init existence check is possibly misleading though, since there's no particular reason it can't be an absolute symlink. The obvious way to get the test right requires the test to occur in a chroot, or after switch_root, but that's tricky with dependencies on the contents of the new root.

@moul
Copy link
Contributor Author

moul commented Mar 25, 2016

Hi @muhmuhten,

Thank you for your feedback about the kernel history, it's a good idea to keep the same list they provide (/sbin/init, /etc/init, /bin/init, /bin/sh).

And yes, about the symlink check, you hit the point, I wanted to do the test from within a chroot, but it is too dependent on the target image, so for now, I just transformed the fatal in a warning, so it's not blocking anymore.

The solution we have in mind is to write a small C program that will follow the symlink while ignoring the /newroot prefix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants