systemd vs launchd

in debian they called red hat systemd part of linux wars

i'm glad to see Apple has taken enough interest to improve and not just "take code and use it"

however for BOTH OF THEM: there was no reason to disable System V and bsd'ish rc (often both used and supported on some systems). systemd and launchd could be processes (spawned/forked) by init

people today have ZERO respect for not clobbering namespaces (using a new name, and a long descriptive one) and not breaking what already works - causing versional depends havoc and migration nightmares

i think both are fine but the idea that "everyone must rewrite when apple or RH changes their mind" (ie, any admin with a key to hack others) is what is wrong with today's IT. they do whatever they please and get paid while others suffer. simply put - clobbering should not be allowed any more . it's not just that it's hardware incompatibility too (ie, dropping VGA or IDE support while failing to provide drivers, they are becoming to hack in silicon while coders suffer their omnipotence).

on the other hand there's no reason why apple or RH startup should not use their custom launcher - it's just that it should not assume to "take over", is all. it should drop in, and do it's thing

the problem is lack of respect for others, lack of planning, and very much: abuse of authority
 
As OSX is almost always used as a client system... why are people configuring launchd? I've never run into the need for using it on my MBP.
 
As OSX is almost always used as a client system... why are people configuring launchd? I've never run into the need for using it on my MBP.

One famous usage case is a Web-Development system. For example, I have running on my client system a test web server, and the httpd and database services are launched when starting the machine. The benefit of this is that you can quickly run many test scenarios with your new code without needing it to upload to somewhere, so development can happen completely offline.

In the case of Mac OS X, one would take the launchd.plist example script from the respective man file, adjust the executable name, path and its command line parameters, and drop the new launch_my_daemon.plist into /Library/LaunchDaemons.

However, installation of respective daemons is another mostly yet as simple story.
 
Yeah I'm not sure I'd want a webserver starting every time my machine booted. I'd rather do that inside vagrant or something that better replicated the actual situation on the server. I get what you mean now, though. I usually just associate the tight control of init with server situations.
 
Yeah I'm not sure I'd want a webserver starting every time my machine booted. I'd rather do that inside vagrant or something that better replicated the actual situation on the server. I get what you mean now, though. I usually just associate the tight control of init with server situations.
Perhaps, I am nitpicking. Your first comment was about "why are people configuring launchd?", and I assumed that with people you mean the User of the system, and I answered that one with a usage case that some people like and perhaps others dislike.

Now, your more general point of view "I usually just associate the tight control of init with server situations." does not match the client systems that I know, usually those run tons of daemons that don't make sense on a server. Here comes an example of Mac OS X 10.11:
Code:
# ls -1 /System/Library/LaunchDaemons
bootps.plist
com.apple.AirPlayXPCHelper.plist
com.apple.AppleFileServer.plist
com.apple.AssetCacheLocatorService.plist
com.apple.CommCenterRootHelper.plist
com.apple.CoreRAID.plist
com.apple.CrashReporterSupportHelper.plist
com.apple.DesktopServicesHelper.plist
com.apple.DumpGPURestart.plist
com.apple.DumpPanic.plist
com.apple.FileCoordination.plist
com.apple.FileSyncAgent.sshd.plist
com.apple.FontWorker.plist
com.apple.GSSCred.plist
com.apple.GameController.gamecontrollerd.plist
com.apple.IFCStart.plist
com.apple.IOAccelMemoryInfoCollector.plist
com.apple.IOBluetoothUSBDFU.plist
com.apple.InstallerDiagnostics.installerdiagd.plist
com.apple.InstallerDiagnostics.installerdiagwatcher.plist
com.apple.Kerberos.digest-service.plist
com.apple.Kerberos.kadmind.plist
com.apple.Kerberos.kcm.plist
com.apple.Kerberos.kdc.plist
com.apple.Kerberos.kpasswdd.plist
com.apple.KernelEventAgent.plist
com.apple.MRTd.plist
com.apple.ManagedClient.cloudconfigurationd.plist
com.apple.ManagedClient.enroll.plist
com.apple.ManagedClient.plist
com.apple.ManagedClient.startup.plist
com.apple.MobileFileIntegrity.plist
com.apple.NetBootClientStatus.plist
com.apple.NetworkDiagnostics.plist
com.apple.NetworkLinkConditioner.plist
com.apple.NetworkSharing.plist
com.apple.ODSAgent.plist
com.apple.PCIELaneConfigTool.plist
com.apple.PasswordService.plist
com.apple.RFBEventHelper.plist
com.apple.RemoteDesktop.PrivilegeProxy.plist
com.apple.ReportCrash.Root.plist
com.apple.ReportPanicService.plist
com.apple.SCHelper.plist
com.apple.SubmitDiagInfo.plist
com.apple.TMCacheDelete.plist
com.apple.TrustEvaluationAgent.system.plist
com.apple.UserEventAgent-System.plist
com.apple.UserNotificationCenter.plist
com.apple.WindowServer.plist
com.apple.WirelessRadioManagerd-osx.plist
com.apple.afpfs_afpLoad.plist
com.apple.afpfs_checkafp.plist
com.apple.airplaydiagnostics.server.mac.plist
com.apple.airport.wps.plist
com.apple.airportd.plist
com.apple.akd.plist
com.apple.alf.agent.plist
com.apple.appleseed.fbahelperd.plist
com.apple.applessdstatistics.plist
com.apple.apsd.plist
com.apple.aslmanager.plist
com.apple.atrun.plist
com.apple.audio.coreaudiod.plist
com.apple.audio.systemsoundserverd.plist
com.apple.auditd.plist
com.apple.autofsd.plist
com.apple.automountd.plist
com.apple.avbdeviced.plist
com.apple.awacsd.plist
com.apple.awdd.plist
com.apple.backupd-auto.plist
com.apple.backupd.plist
com.apple.blued.plist
com.apple.bluetoothReporter.plist
com.apple.bluetoothaudiod.plist
com.apple.bnepd.plist
com.apple.bsd.dirhelper.plist
com.apple.cache_delete.plist
com.apple.cfprefsd.xpc.daemon.plist
com.apple.cloudfamilyrestrictionsd-mac.plist
com.apple.cmio.AVCAssistant.plist
com.apple.cmio.AppleCameraAssistant.plist
com.apple.cmio.IIDCVideoAssistant.plist
com.apple.cmio.VDCAssistant.plist
com.apple.cmio.iOSScreenCaptureAssistant.plist
com.apple.colorsyncd.plist
com.apple.comsat.plist
com.apple.configd.plist
com.apple.configureLocalKDC.plist
com.apple.corecaptured.plist
com.apple.coreduetd.osx.plist
com.apple.coreservices.appleevents.plist
com.apple.coreservices.appleid.passwordcheck.plist
com.apple.coreservices.launchservicesd.plist
com.apple.coreservices.sharedfilelistd.plist
com.apple.coreservicesd.plist
com.apple.corestorage.corestoraged.plist
com.apple.corestorage.corestoragehelperd.plist
com.apple.coresymbolicationd.plist
com.apple.csrutil.report.plist
com.apple.ctkd.plist
com.apple.cvmsServ.plist
com.apple.diagnostic.uuidpathd.plist
com.apple.diagnosticd.plist
com.apple.diskarbitrationd.plist
com.apple.diskmanagementd.plist
com.apple.diskmanagementstartup.plist
com.apple.displaypolicyd.plist
com.apple.distnoted.xpc.daemon.plist
com.apple.dnsextd.plist
com.apple.dpaudiothru.plist
com.apple.dpd.plist
com.apple.dspluginhelperd.plist
com.apple.dvdplayback.setregion.plist
com.apple.dynamic_pager.plist
com.apple.eapolcfg_auth.plist
com.apple.efax.plist
com.apple.efilogin-helper.plist
com.apple.emlog.plist
com.apple.emond.aslmanager.plist
com.apple.emond.plist
com.apple.eppc.plist
com.apple.familycontrols.plist
com.apple.findmymac.plist
com.apple.findmymacmessenger.plist
com.apple.firmwaresyncd.plist
com.apple.fontd.plist
com.apple.fontmover.plist
com.apple.fseventsd.plist
com.apple.ftp-proxy.plist
com.apple.getty.plist
com.apple.gkreport.plist
com.apple.gssd.plist
com.apple.hdiejectd.plist
com.apple.hidd.plist
com.apple.hidfud.plist
com.apple.icloud.findmydeviced.plist
com.apple.iconservices.iconservicesagent.plist
com.apple.iconservices.iconservicesd.plist
com.apple.ifdreader.plist
com.apple.installandsetup.systemmigrationd.plist
com.apple.installd.plist
com.apple.kcproxy.plist
com.apple.kdumpd.plist
com.apple.kextd.plist
com.apple.kuncd.plist
com.apple.locate.plist
com.apple.locationd.plist
com.apple.lockd.plist
com.apple.logd.plist
com.apple.logind.plist
com.apple.loginwindow.LFVTracer.plist
com.apple.loginwindow.plist
com.apple.logkextloadsd.plist
com.apple.lsd.plist
com.apple.mDNSResponder.plist
com.apple.mDNSResponderHelper.plist
com.apple.mbsystemadministration.plist
com.apple.mbusertrampoline.plist
com.apple.mdmclient.daemon.plist
com.apple.mdmclient.daemon.runatboot.plist
com.apple.metadata.mds.index.plist
com.apple.metadata.mds.plist
com.apple.metadata.mds.scan.plist
com.apple.metadata.mds.spindump.plist
com.apple.msrpc.echosvc.plist
com.apple.msrpc.lsarpc.plist
com.apple.msrpc.mdssvc.plist
com.apple.msrpc.netlogon.plist
com.apple.msrpc.srvsvc.plist
com.apple.msrpc.wkssvc.plist
com.apple.mtmd.plist
com.apple.mtmfs.plist
com.apple.nehelper.plist
com.apple.nesessionmanager.plist
com.apple.netauth.sys.auth.plist
com.apple.netauth.sys.gui.plist
com.apple.netbiosd.plist
com.apple.networkd.plist
com.apple.networkd_privileged.plist
com.apple.newsyslog.plist
com.apple.nfsconf.plist
com.apple.nfsd.plist
com.apple.nis.ypbind.plist
com.apple.noticeboard.state.plist
com.apple.notifyd.plist
com.apple.nsurlsessiond.plist
com.apple.nsurlstoraged.plist
com.apple.ocspd.plist
com.apple.odproxyd.plist
com.apple.opendirectoryd.plist
com.apple.periodic-daily.plist
com.apple.periodic-monthly.plist
com.apple.periodic-weekly.plist
com.apple.pfctl.plist
com.apple.pfd.plist
com.apple.platform.ptmd.plist
com.apple.powerd.plist
com.apple.powerd.swd.plist
com.apple.preferences.timezone.admintool.plist
com.apple.preferences.timezone.auto.plist
com.apple.printtool.daemon.plist
com.apple.racoon.plist
com.apple.remotepairtool.plist
com.apple.revisiond.plist
com.apple.rootless.init.plist
com.apple.rpcbind.plist
com.apple.rpmuxd.plist
com.apple.sandboxd.plist
com.apple.screensharing.plist
com.apple.scsid.plist
com.apple.secinitd.plist
com.apple.security.FDERecoveryAgent.plist
com.apple.security.agent.login.plist
com.apple.security.authhost.plist
com.apple.security.syspolicy.plist
com.apple.securityd.plist
com.apple.securityd_service.plist
com.apple.sessionlogoutd.plist
com.apple.smb.preferences.plist
com.apple.smbd.plist
com.apple.softwareupdate_download_service.plist
com.apple.softwareupdate_firstrun_tasks.plist
com.apple.softwareupdated.plist
com.apple.speech.speechsynthesisd.plist
com.apple.spindump.plist
com.apple.startupdiskhelper.plist
com.apple.statd.notify.plist
com.apple.storagekitd.plist
com.apple.storeaccountd.daemon.plist
com.apple.storeagent.daemon.plist
com.apple.storeassetd.daemon.plist
com.apple.storedownloadd.daemon.plist
com.apple.storeinstalld.plist
com.apple.storereceiptinstaller.plist
com.apple.suhelperd.plist
com.apple.symptomsd.plist
com.apple.sysdiagnose.plist
com.apple.syslogd.plist
com.apple.sysmond.plist
com.apple.system_installd.plist
com.apple.systemkeychain.plist
com.apple.systempreferences.installer.plist
com.apple.systemstats.analysis.plist
com.apple.systemstats.daily.plist
com.apple.systemstatsd.plist
com.apple.taskgated-helper.plist
com.apple.taskgated.plist
com.apple.tccd.system.plist
com.apple.thermald.plist
com.apple.trustd.plist
com.apple.ucupdate.plist
com.apple.uninstalld.plist
com.apple.unmountassistant.sysagent.plist
com.apple.updateEFIDesktopPicture.plist
com.apple.usbd.plist
com.apple.usbmuxd.plist
com.apple.uucp.plist
com.apple.var-db-dslocal-backup.plist
com.apple.vsdbutil.plist
com.apple.warmd.plist
com.apple.watchdogd.plist
com.apple.wdhelper.plist
com.apple.wifid.plist
com.apple.wirelessproxd.plist
com.apple.wwand.plist
com.apple.xpc.smd.plist
com.apple.xpc.uscwoap.plist
com.apple.xsan.plist
com.apple.xsandaily.plist
com.apple.xscertadmin.plist
com.apple.xscertd-helper.plist
com.apple.xscertd.plist
com.vix.cron.plist
exec.plist
finger.plist
ftp.plist
login.plist
ntalk.plist
org.apache.httpd.plist
org.cups.cups-lpd.plist
org.cups.cupsd.plist
org.net-snmp.snmpd.plist
org.ntp.ntpd.plist
org.openldap.slapd.plist
org.postfix.master.plist
org.postfix.newaliases.plist
shell.plist
ssh.plist
telnet.plist
tftp.plist
 
Systemd and Launchd suffer from the same fundamental issue:

PID 1 contains both the init and the process supervisor. This is bad. Because, race conditions in the process supervision code can compromise the root process of the entire OS.

Ideally, what we need is PID 1 only used for startup and shut down. It should be made out of entirely hardened code. The process supervisor should be a separate process, and get fed data from existing tools and protocols, such as STREAMS.

One architecture design I had for a supervisor was this:

PID 2 being the process supervisor - it monitors init from a log that init would keep at /var/log/init - this is so that it can keep track of all processes/daemons. PID 2 would be the parent process of all daemons that would normally go in /etc/rc.d and start them up by attaching them to a console device - this console would act similar to if you started the program from a terminal - if the console dies, the process exits gracefully. This would be instead of linux cgroups. In order to facilitate IPC, I would leverage the System V streams protocol and make a streams stack.

The stack would be supervisor <-> console supervisor <-> console <-> daemon and to communicate between processes , it would be console supervisor <-> console(s) which would simply communicate over standard STREAMS protocol. As a backup, if configured to not use the console supervisor, you could create a cgroups API or leverage a log that logs everytime a process forks, but I prefer the setup proposed because it's been used in IRIX before, and IRIX is extremely stable, and it offers the sophistication of the Linux stack from a KISS perspective.
 
the elephant in the room may have been missed.

launchd is tightly integrated to control about everything on apple. and maybe so is systemd on redhat.

However! systemd along with kernel and libc "compiled options" allow systemd to put a PC into remote debugging mode before light (and i mean before VGA too) (total remote control even if booting local image). I'm unsure if anyone has had a problem of this happening without their knowledge, but if there's bugs, there's a way.

launchd controls so many things it's bugs would be just as bad impact, but i'm unsure if launchd controls "remote fresh re-install" feature of apple products or not (ie, feature that boots remotely and installs a fresh OS to "renew product"). allot of system services the "come and go" whilie you use software are using launchd - any app that's worth using does. it has a hand in sandboxing too.

systemd is a huge package with many bins and libs, you'd have to study it a long time to really "know what it does or might do" (that you wouldn't want). it seems more focused on system startup and shutdown, but i imagine RedHat also uses it runtime - but likely not to level of integration of app sandboxing.

launchd ... Apple has some liability as to whether it's being used "to serving you, or a dis-service to you"

i think if BSD linux et al took up some liability it would be good. "if you can't say who edited source/script why in the apps, if users are not allowed to choose which management package should run their OS (ie meaning sysinit versus systemd)", then you of course have a serious problem that someone (or many) will eventually get maintainer access, abuse it, and not be liable - and be laughing to some bank when their goal xxxxxx is achieved, as no one had a choice or knew that they ran code against their own interest.

liability is a good thing. proffesors of Berkeley University of California U.S.A. (knowing full well there are now probably 100 Berkeley elsewhere!), they had some liability in using public funds and expressing to the public they were not intended for harm. i feel even the most remote liability has been forgotten even attacked as "legacy"

liability is good

good news is linux (mostly) builds bare (without trash forced in by "maintainers") and BSD is fully source

still, liability shouldn't be dis-claimed, it's just not health when "maintainers" can do things like "disable madatory access control - that was/is perfect no bugs" and replace it with "modular access - that continually has shown bugs". they should be liable when things go wrong when they didn't give others a real choice
 
Back
Top