Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
| docs:guide-developer:procd [2018/04/15 14:14] – [The Procd System Manager] jeff | docs:guide-developer:procd [2018/11/27 09:16] (current) – merged with other article bobafetthotmail | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== The Procd System Manager ====== | + | [[docs: |
| - | + | ||
| - | FIXME No meaningful or current documentation for '' | + | |
| - | ===== Procd ===== | + | |
| - | + | ||
| - | //LEDE// uses //procd// for initializing the system, managing processes and handling parts of the kernel/ | + | |
| - | + | ||
| - | ==== early state and preinit ==== | + | |
| - | + | ||
| - | Before the real procd runs, a small init process is started. This process has the job of early system init. It will do the following things in the listed order | + | |
| - | + | ||
| - | * bring up basic mounts such as /proc / | + | |
| - | * create some required folder, / | + | |
| - | * bring up / | + | |
| - | * setup the PATH environment variable | + | |
| - | * check if " | + | |
| - | * initialise the watchdog | + | |
| - | * start kmodloader and load the modules listed in / | + | |
| - | * start hotplug with the preinit rules (/ | + | |
| - | * start preinit scripts found inside / | + | |
| - | + | ||
| - | Once preinit is complete the init process is done and will do an exec on the real procd. This will replace init as pid1 with an instance of procd running as the new pid 1. The watchdog file descriptor is not closed. Instead it is handed over to the new procd process. The debug_level will also be handed over to the new procd instance if it was set via command line or during preinit. | + | |
| - | + | ||
| - | ==== procd start up ==== | + | |
| - | + | ||
| - | Procd will first do some basic process init such as setting itself to be owner of its own process group and setting up signals. We are now ready to bring up the userland in the following order | + | |
| - | + | ||
| - | * find out if a watchdog file descriptor was passed by the init process and start up the watchdog | + | |
| - | * setup / | + | |
| - | * start the coldplug process using the full rule set (/ | + | |
| - | * start ubus, register it as a service and connect to it. | + | |
| - | + | ||
| - | The basic system bringup is now complete, procd is up and running and can start handling daemons and services | + | |
| - | + | ||
| - | ==== / | + | |
| - | + | ||
| - | Procd supports four commands inside inittab | + | |
| - | + | ||
| - | * respawn - this works just like you expect it. It starts a process and will respawn it once it has completed. | + | |
| - | * respawnlate - this works like the respawn but will start the process only when the procd init is completed. | + | |
| - | * askfirst - this works just like respawn but will print the line " | + | |
| - | * askconsole - this works like askfirst but, instead of running on the tty passed as a parameter, it will look for the tty defined in the kernel command line using " | + | |
| - | * askconsolelate - this works like the askconsole but will start the process only when the procd init is completed. | + | |
| - | * sysinit - this will trigger procd to run the command, given as a parameter, only once. This is usually used to trigger execution of / | + | |
| - | + | ||
| - | Once all items inside / | + | |
| - | + | ||
| - | ==== ubus command interface ==== | + | |
| - | + | ||
| - | ==== hotplug ==== | + | |
| - | + | ||
| - | Hotplug scripts are located inside / | + | |
| - | + | ||
| - | * makedev | + | |
| - | * rm | + | |
| - | * exec | + | |
| - | * button | + | |
| - | * load-firmware | + | |
| - | + | ||
| - | ==== service startup / monitoring ==== | + | |
| - | + | ||
| - | WIP | + | |
| - | + | ||
| - | ==== (configuration-)triggers ==== | + | |
| - | + | ||
| - | WIP | + | |
| - | + | ||
| - | ==== writing init.d scripts ==== | + | |
| - | + | ||
| - | WIP | + | |