Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
05-15-2014, 03:34 AM
|
#31
|
Member
Registered: Nov 2013
Posts: 744
Rep:
|
Quote:
Originally Posted by jpollard
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 03:43 AM.
|
|
|
05-15-2014, 08:26 AM
|
#32
|
Member
Registered: Feb 2003
Location: Almere, Netherlands
Distribution: slack 7.1 till latest and -current, LFS
Posts: 368
Rep:
|
Quote:
Originally Posted by jpollard
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.
|
|
|
05-15-2014, 10:57 AM
|
#33
|
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912
|
Quote:
Originally Posted by genss
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.
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).
|
|
|
05-15-2014, 12:56 PM
|
#34
|
Senior Member
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223
Rep:
|
Quote:
Originally Posted by briselec
|
Oh, this is very nice. Gonna give it a try.
|
|
|
05-15-2014, 01:11 PM
|
#35
|
LQ Guru
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,564
|
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.
|
05-15-2014, 05:01 PM
|
#36
|
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912
|
Quote:
Originally Posted by moisespedro
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.
|
|
|
05-15-2014, 05:08 PM
|
#37
|
Senior Member
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223
Rep:
|
Quote:
Originally Posted by jpollard
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
|
|
|
05-15-2014, 06:10 PM
|
#38
|
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912
|
Quote:
Originally Posted by moisespedro
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.
|
|
|
05-15-2014, 10:34 PM
|
#39
|
Member
Registered: Jul 2004
Distribution: Void Linux, former Slackware
Posts: 498
Rep:
|
Quote:
Originally Posted by moisespedro
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 10:48 PM.
Reason: typo
|
|
|
05-16-2014, 07:20 AM
|
#40
|
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912
|
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...
|
|
|
05-16-2014, 09:48 AM
|
#41
|
LQ Addict
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,171
Rep:
|
Quote:
Originally Posted by Didier Spaier
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.
|
05-16-2014, 10:04 AM
|
#42
|
Member
Registered: Mar 2006
Distribution: Give me Slack or give me death.
Posts: 81
Rep:
|
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.
|
|
|
05-16-2014, 10:12 AM
|
#43
|
Member
Registered: Jul 2004
Distribution: Void Linux, former Slackware
Posts: 498
Rep:
|
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.
|
|
|
05-16-2014, 10:24 AM
|
#44
|
Senior Member
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,860
|
Quote:
Originally Posted by jpollard
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.
|
05-16-2014, 12:07 PM
|
#45
|
Member
Registered: Jul 2004
Distribution: Void Linux, former Slackware
Posts: 498
Rep:
|
Quote:
Originally Posted by Richard Cranium
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
|
|
|
All times are GMT -5. The time now is 09:01 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|