LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-15-2014, 04:34 AM   #31
genss
Member
 
Registered: Nov 2013
Posts: 739

Rep: Reputation: Disabled

Quote:
Originally Posted by jpollard View Post
What makes an init hard is getting things in the proper order.

With a shell script it is easy - the order is specified by the order of commands in the script.
nice bait with systemd crap

i'm talking about a proper init, not one that thinks mounting a partition is a service
(in other words, not one that started as My First Init then went crazy)

order of starting things needs to be determined anyway
you need to mount /lib to load modules
you need to load the graphics modules (driver, drm etc.) to start Plymouth
you need to... actually there is not great many things that need you to explicitly take care of (maybe there was a few 10 years ago)
all those are common sense
it is people that make things complicated, and this is not complicated

can you tell me what "service" depends on ssh or apache ?
(yes i know they depend on the network; while we'r at it i looked at dhcp protocol couple days ago, its very simple)

https://sourceware.org/ml/libc-alpha.../msg00747.html
this is how a proper daemon starts, not with some dumb socket based uselessness

PS shell is a programming language, one that can be made parallel
(shell can even be compiled, idk why gcc and clang people didnt make a parser already)
C is not far and can easily be made parallel (actually easier with fork+exec as you can wait4() multiple children at a time)

Last edited by genss; 05-15-2014 at 04:43 AM.
 
Old 05-15-2014, 09:26 AM   #32
bartgymnast
Member
 
Registered: Feb 2003
Location: Almere, Netherlands
Distribution: slack 7.1 till latest and -current, LFS
Posts: 360

Rep: Reputation: 146Reputation: 146
Quote:
Originally Posted by jpollard View Post
What makes an init hard is getting things in the proper order.

With a shell script it is easy - the order is specified by the order of commands in the script.

With systemd, it is next to impossible. Systemd uses a random scheduling order, with a multi-level dependency network that has to be analyzed by systemd. If you miss some obscure dependency, the system may hang, or that particular service may not work (before, after, requires, ...).

The reason systemd has so much trouble is that it has to assume the service is ready when it starts it. This is NOT true. Before the service is ready it has to process its configuration file(s). In all other init systems (sysVinit, BSD, and slackware) the completion of this phase is when the service forks/becomes a daemon process, and the parent process exits. Systemd doesn't have that. To provide the equivalent each service must be modified to send systemd a message. In the case of networks, it becomes a two level thing - Systemd has to have NetworkManager send a message... but NetworkManager can't always know if the network is up either - specifically, in the case of DHCP. This can take up to around 30 seconds (depending on the dhcp server). Yet, NetworkManager has to assume it is ready when dhclient is started... Thus the message back to systemd indicating the network is ready is wrong.

This incorrect assumption allows other processes that may need the network to run... and fail.

The rest of the problem is assuming that one service can analyze all the dependencies. Here you get multiple dependencies - between services like apache, database servers, the network... To get those right requires each service to be modified to send back notifications to systemd...

And that makes the service incompatible with any other init because systemd just doesn't work well with other init systems, and is nonportable.

And worse, the developers don't care.
They do certainly care.
the network not functioning properly was a big problem.

systemd will/has developped hardware deamons.

systemd-networkd.

there is also a patch (.service file) for NetworkManager that basically tells if the network is running.
 
Old 05-15-2014, 11:57 AM   #33
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,843

Rep: Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472
Quote:
Originally Posted by genss View Post
nice bait with systemd crap

i'm talking about a proper init, not one that thinks mounting a partition is a service
(in other words, not one that started as My First Init then went crazy)
So you aren't talking about systemd...
Quote:

order of starting things needs to be determined anyway
you need to mount /lib to load modules
you need root mounted first...
Quote:
you need to load the graphics modules (driver, drm etc.) to start Plymouth
you need to... actually there is not great many things that need you to explicitly take care of (maybe there was a few 10 years ago)
all those are common sense
it is people that make things complicated, and this is not complicated
True that.

The initrd I had investigated (fairly deeply) used the command line "root=" to mount root on /mnt. Then it scanned the fstab on /mnt/etc for required filesystems like /var, /usr, /var/log... and mounted them. Once these mounts completed it would do the piviot_root and start the systems init from /sbin.

If one of these required mounts fails it would start a shell so that the admin could fix things (usually a typo in the fstab, or to do fsck runs).
Quote:
can you tell me what "service" depends on ssh or apache ?
(yes i know they depend on the network; while we'r at it i looked at dhcp protocol couple days ago, its very simple)
Well, one I ran across was monitoring software - it required apache to be running before it checked or it would report a system failure, even though that would be a "false alarm". And the monitoring checked as soon as it started. In the SysVinit it was a S99... which worked.

A more likely scenario is a database... and potentially clients of that database that provide services that are referenced by apache. I know this is usually just a CGI, but sometimes things get complicated, and it is considered better to separate that CGI from apache (it may require some data access barred to apache).

Yup - dhcp is simple, and works quite well. But it must wait for external service which is tricky for systemd to properly handle.
Quote:

https://sourceware.org/ml/libc-alpha.../msg00747.html
this is how a proper daemon starts, not with some dumb socket based uselessness
I know that... Unfortunately, that is exactly the process systemd is not useful for. Remember, systemd is also a process monitoring service, and can restart services if they fail. It is ALSO required to be monitored if a dependency is declared by a "requires" entry for a dependent service.

So what happens is that the service is "started"...the dependant service start - but because "required" service has exited, the dependent service can also be terminated... falsely. Alternatively (if systemd assumes the service is properly running), the service in question may exit for some other reason... and now the dependent service fails because the other service isn't running (a cascading failure).
Quote:

PS shell is a programming language, one that can be made parallel
(shell can even be compiled, idk why gcc and clang people didnt make a parser already)
C is not far and can easily be made parallel (actually easier with fork+exec as you can wait4() multiple children at a time)
That WOULD be my preferred method. Even most shells implement a wait using a wait4 now.

Personally, systemd is just a disaster waiting to happen, but the developers keep adding stuff to it: dbus, udev, journald,... if any of those abort, the system has a tendency to also crash. previously it was just a problem with the subsystem (and if syslog failed, the messages were still sent to the console).
 
Old 05-15-2014, 01:56 PM   #34
moisespedro
Senior Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223

Rep: Reputation: 195Reputation: 195
Quote:
Originally Posted by briselec View Post
A nice example of how to write an init system
Demystifying the init system
Oh, this is very nice. Gonna give it a try.
 
Old 05-15-2014, 02:11 PM   #35
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-Current
Posts: 6,449
Blog Entries: 15

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
Slackware already has Runit in the SlackBuilds and it can be used as an alternative Init, but my work with it was limited, but I can say it does work if proper scripts for it are made.

Perhaps eventually if and when a new init is needed Patrick can pull in Runit and look into it's inclusion.

Eudev from Gentoo and LFS can be easily imported if Patrick ever needs to update udev to a newer version that's sane to use.

Why use what we don't need?
 
2 members found this post helpful.
Old 05-15-2014, 06:01 PM   #36
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,843

Rep: Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472
Quote:
Originally Posted by moisespedro View Post
Oh, this is very nice. Gonna give it a try.
Note - most of it assumes the system is using systemd as it uses a number of systemd facilities.
 
Old 05-15-2014, 06:08 PM   #37
moisespedro
Senior Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223

Rep: Reputation: 195Reputation: 195
Quote:
Originally Posted by jpollard View Post
Note - most of it assumes the system is using systemd as it uses a number of systemd facilities.
Not going to try it anymore then lol
 
Old 05-15-2014, 07:10 PM   #38
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,843

Rep: Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472
Quote:
Originally Posted by moisespedro View Post
Not going to try it anymore then lol
The beginning is fine - it doesn't start to use the systemd based utilities until the last third.

But it does hide a lot of the startup stuff in those utilities.
 
Old 05-15-2014, 11:34 PM   #39
dunric
Member
 
Registered: Jul 2004
Distribution: Void Linux, former Slackware
Posts: 498

Rep: Reputation: 100Reputation: 100
Quote:
Originally Posted by moisespedro View Post
Not going to try it anymore then lol
Don't worry, he only calls systemd utility to clean temporary files which can be trivially rewriten with File class.
He also starts udevd which is already bound to systemd in Arch Linux, however again it can be trivially rewriten to call either Slackware's init script /etc/rc.d/rc.udev or by invoking /sbin/udevadm directly.

That's all. So in fact it does not need systemd at all.

Last edited by dunric; 05-15-2014 at 11:48 PM. Reason: typo
 
Old 05-16-2014, 08:20 AM   #40
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,843

Rep: Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472
If it was just the simple things those facilities did, I wouldn't have mentioned it. But part of it is some of the monitoring for failures.

The real issue for me was that systemd has a lot of interdependencies that were not mentioned/identified when using those utilities.

And even using slackware utilities would be hiding part of the actual complexity of an init system for any fairly complex desktop.

Init systems for embedded on the other hand are relatively simple. And all init systems start at the same point...
 
Old 05-16-2014, 10:48 AM   #41
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1.2 on Lenovo Thinkpad W520
Posts: 9,067

Rep: Reputation: Disabled
Quote:
Originally Posted by Didier Spaier View Post
Out of curiosity (and because I wasn't in a mood of making anything useful at that time) just yesterday I made a package for Slackware-14.0 of eudev-1.6 [...] Still just out of curiosity I 'll have a closer look to the differences with udev-182 in the coming days, as at least that could help Gentoo developers in case they didn't receive reports from someone trying it with Slackware's init system yet.
See here.
 
1 members found this post helpful.
Old 05-16-2014, 11:04 AM   #42
Arkerless
Member
 
Registered: Mar 2006
Distribution: Give me Slack or give me death.
Posts: 81

Rep: Reputation: 60
Correct me if I am wrong, but I got interested in the subject and did some reading up on systemd, and if I am not mistaken the fundamental driving force in their architecture is improved VPS performance. They want a linux optimized to run as a virtual machine, and to start and stop very quickly on demand in that environment, right?

The design makes a lot more sense in that context. You can be pretty certain that the DHCP response is coming within a certain number of seconds and just assume success and that will normally work. And saving a couple seconds on boot time would actually be worth some effort, if you are talking about booting thousands of virtual servers every hour it actually starts to add up.

If I understand correctly this is why they are building this entire layer of stuff around systemd instead of using something compatible like OpenRC - squeezing that last second out of your boot time is an incredible waste of time for a traditional user, but again makes sense if you are talking about booting VMs thousands of times an hour.
 
Old 05-16-2014, 11:12 AM   #43
dunric
Member
 
Registered: Jul 2004
Distribution: Void Linux, former Slackware
Posts: 498

Rep: Reputation: 100Reputation: 100
Can you be a more specific ?
In the code there is nowhere else used any part od systemd than I've described. The script is just a simplified example not 100% emulation of systemd init. It only monitors termination of processes at shutdown and responds to SIGCHLD signal.
 
Old 05-16-2014, 11:24 AM   #44
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.2
Posts: 3,508

Rep: Reputation: 1860Reputation: 1860Reputation: 1860Reputation: 1860Reputation: 1860Reputation: 1860Reputation: 1860Reputation: 1860Reputation: 1860Reputation: 1860Reputation: 1860
Quote:
Originally Posted by jpollard View Post
Note - most of it assumes the system is using systemd as it uses a number of systemd facilities.
And all of it assumes that you've installed Ruby.

 
1 members found this post helpful.
Old 05-16-2014, 01:07 PM   #45
dunric
Member
 
Registered: Jul 2004
Distribution: Void Linux, former Slackware
Posts: 498

Rep: Reputation: 100Reputation: 100
Quote:
Originally Posted by Richard Cranium View Post
And all of it assumes that you've installed Ruby.

However this is not an issue in all GNU/Linux distributions known to me or Open/Net/FreeBSDs. Holds true for Slackware, of course
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Systemd Is The Future Of Debian LXer Syndicated Linux News 1 02-11-2014 04:09 PM
It seems that in future Linux kernel itself will force the use of systemd blancamolinos Slackware 25 11-07-2013 03:38 PM
[SOLVED] systemd and Slackware's future kikinovak Slackware 95 07-14-2012 12:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration