Use the sinit conventions for init

This should make it easier to switch out `init` for other versions,
although the `getty` config still needs to be removed.

- use `/bin/rc.init` for start
- use `rc.shutdown` for stop
- make `rc.init` run other code.
- merge `containers` and `containerd` startup code

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
Justin Cormack
2017-05-30 13:27:31 +01:00
parent 063d82c687
commit 08e211df44
6 changed files with 39 additions and 19 deletions

13
pkg/init/bin/rc.shutdown Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/sh
[ "$1" = "reboot" ] && exec /sbin/reboot
# poweroff
/usr/sbin/killall5 -15
/bin/sleep 5
/usr/sbin/killall5 -9
/sbin/swapoff -a
/bin/echo "Unmounting filesystems"
/bin/umount -a -r
/sbin/poweroff -f