:: Re: [DNG] Mini init script written …
トップ ページ
このメッセージを削除
このメッセージに返信
著者: Edward Bartolo
日付:  
To: irrwahn35
CC: dng
題目: Re: [DNG] Mini init script written in Perl boots.
Hi,

<<
what the heck did you think the
last line of Felker's original code did?
>>


Felker's last line:
return execve("/etc/rc", (char *[]){ "rc", 0 }, (char *[]){ 0 });

In Devuan rc is found in /etc/init.d meaning  I had to edit the code.
Second, to load XFCE4.10 I had to also call "rc 2". Calling "rc 0" did
not work. Consulting "man init" says:
<<
       Runlevels S, 0, 1, and 6 are reserved.  Runlevel S is used to initialize
       the  system  on  boot.  When starting runlevel S (on boot) or runlevel 1
       (switching from a multi-user runlevel) the system is entering  ``single-
       user  mode'', after which the current runlevel is S.  Runlevel 0 is used
       to halt the system; runlevel 6 is used to reboot the system.

>>


I couldn't use "rc 0" to start the system but first to call "rc S" and
then "rc 2". That is why I created a script and edited the line. In
my earlier versions of the line I replaced it with call to "agetty
tty1" to open a terminal instead of bringing up the entire system. I
did this to give Felker's init a try, NOT because I doubted Felker's
coding abilities.

<<
It's this arrogant attitude of "alright, got it, easy enough,
now I'm gonna improve on it" without bothering to actually
get to the bottom of even the basic concepts behind it, that
brought us systemd and other crap. If you keep this up you are
condemned to reinvent SysV-init (or OpenRC, or whatever), poorly.
>>


So, you see in me yet another Lennart Poettering. I wish I received a
pay like his, but reality was harsher with me.


Edward


On 17/06/2016, Irrwahn <irrwahn@???> wrote:
> On Fri, 17 Jun 2016 16:09:00 +0200, Edward Bartolo wrote:
>> Hi,
>>
>> <<
>> If 16 lines of C pose a mystery, one should look for another hobby.
>> Or get a clue already.
>>>>
>> I was NOT referring to 16 lines of code, but to the source code for
>> established inits like sysvinit, runit and systemd.
>
> Apples and oranges. Comparing complete init (and in some of
> the examples, process supervision) systems with a minimal
> init that defers the real work to subordinate (collections
> of) programs is the kind of misconception I was talking about
> earlier.
>
> A minimal PID1 (written in whatever language) is not an init
> system. In your example you hid the insteresting stuff behind
> some obscure script misleadingly called "osloader.sh". What
> was your point again?
>
> To get a *nix system properly initialized you either need
> a minimal PID1 complemented by something like runit or s6,
> or you use a more monolithic approach like SysV-Init, Upstart,
> etc. pp. I believe that's basically what Katolaz tried to
> convey in another post.
>
>> If *at the first
>> glance*, these projects do not instill some feeling of awe,
>
> If you want to be instilled with some awe I suggest you look
> at the kernel code for the fork() system call. Bottom line:
> Everything looks simple, when you hide the complexity behind
> some innocent looking function calls. And if you have trouble
> understanding the code of the mentioned projects you are
> doomed to fail in writing init systems.
>
>> I chose to follow what I was recommended and actually wrote a
>> RUDIMENTARY Perl script. Why are some so irritated about that?!
>
> I'm irritated by the fact you post such scrips and make it
> appear as if those actually work, by any definition of "work".
> They do not. This is not even contradicted by the fact that it
> appeared(!) to have brought up your system.
>
>> Someone better than me, and I have no problem with people who are more
>> talented than me, could grab the little source and enhance it. After
>> all, this is the purpose of open source licensed under GPL-like
>> licenses.
>
> There is nothing to be enhanced here. It's a dead end. It
> was a fling, not even qualified as an experiment.
>
>> If I am to refer to what I prefer, I say, I prefer a C coded init that
>> does not need a potentially buggy interpreter to run. However, I chose
>> to listen to those who wanted a script and am still thinking about
>> producing an extended version of Felker's init that can respond to
>> shutdown signals. This should avoid having to "agetty tt1 &", log into
>> the new terminal, and issue "/etc/init.d/rc 0" manually.
>
> That's what the parts of init systems that perform the heavy
> lifting are meant to do. It's not a question of some simple
> extension to some script. BTW, what the heck did you think the
> last line of Felker's original code did?
>
> It's this arrogant attitude of "alright, got it, easy enough,
> now I'm gonna improve on it" without bothering to actually
> get to the bottom of even the basic concepts behind it, that
> brought us systemd and other crap. If you keep this up you are
> condemned to reinvent SysV-init (or OpenRC, or whatever), poorly.
>
> Regards
> Urban
>
>