-2

In https://manpages.debian.org/stretch/sysvinit-core/init.8.en.html

/sbin/telinit is linked to /sbin/init. It takes a one-character argument and signals init to perform the appropriate action.

...

Init listens on a fifo in /run, /run/initctl, for messages. Telinit uses this to communicate with init.

Does the first sentence mean that telinit is a symlink to init? If yes, is it correct that telinit and init are run in the same process (e.g. maybe by some file lock) ? If yes, how can telinit communicate with init using FIFO or signals?

For comparison, in Systemd, systemd and systemctl are different program files. Does telinit perform the same role to init in sysvinit, as systemctl to systemd?

Thanks.

  • Uh...Why would you think of that? You can run two chrome process but they both use chrome.exe. – 炸鱼薯条德里克 Dec 19 '18 at 2:25
  • daemon is usually running as a singleton process (I don't know any that isn't), and an init process is a daemon. – Tim Dec 19 '18 at 2:32
  • Sorry, I don't quite understand "singleton process", did you mean executables that was designed to run only one process on the system? Daemons might be "singleton process"... or not. Back to your question, you have two process using the same /sbin/init, with different logic, of course. I just feel you misunderstand so many basic OS concepts, based on the questions you've asked on this website, yes, I AM WATCHING YOU, because your questions interested me. – 炸鱼薯条德里克 Dec 19 '18 at 2:37
  • Uh.. in the bad old time, some server might fork one process per TCP-connection, well, at least that's theoratically possible, right? Also, I wanna tell you, "daemons" are really not well-defined in Linux world, because linux, the kernel, don't care about this concept, only service manager cares about that, but might in different ways from human's mind. – 炸鱼薯条德里克 Dec 19 '18 at 2:45
  • Does telinit perform the same role to init in sysvinit, as systemctl to systemd? – Tim Dec 19 '18 at 3:00
3

It is a symlink, but programs can look at how they are called and perform different actions. This is extremely common in the Unix world.

And so when you run the telinit comamnd, it runs in its own process space, separate from the init process. It sends a messgae to the init process. This may be sent via a FIFO, or by a signal, depending on compile time options.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.