Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

Differences between /init and /sbin/init

Writer Andrew Henderson

In Linux boot order, the kernel will execute /sbin/init, however, I can see another file /init existing in the file system on my linux (CentOS 8 WSL2, Ubuntu 20 WSL2).

They are different binaries:

$ diff /init /sbin/init
Binary files /init and /sbin/init differ

What are the differences between /sbin/init and /init?

2 Answers

/usr/sbin/init or /sbin/init is the executable starting the SysV initialization system. For compatibility reason, when systemd is installed, it's an alias to an executable of the systemd world.

The executable /init is unusual, in a Linux system. I suggest to investigate the reasons why it's present. It could be the part of a malware.

2

You mentioned WSL 2. Microsoft still runs special Linux kernel inside VM and because the goal is not to strictly emulate they introduced own custom init process: like what's the point to start cron/cups/X/etc in every distro you installed?

Microsoft altered init process to avoid useless resource consumption (according to expected use cases of WSL 2).

When you import a Linux distor image Microsoft adds own file /init.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy