summaryrefslogtreecommitdiffstats
path: root/state.c
AgeCommit message (Collapse)Author
2015-11-30Rename to unitd, clean up CMakeLists.txtMatthias Schiffer
2015-11-30Rip out inittab and init script handlingMatthias Schiffer
2015-11-30Strip down procd to the necessary code, update copyrightMatthias Schiffer
2015-03-28properly handle return codesJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2015-02-25Convert log calls to ulog() apiJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2014-10-12Fix ctrl+alt+del supportMichel Stam
The previous patch did not catch SIGINT, which is used by the kernel to indicate to the init process that the system should reboot. Signed-off-by: Michel Stam <m.stam@fugro.nl>
2014-10-12Show the shutdown sequence on the active virtual terminalMichel Stam
procd by default writes to /dev/console. When rebooting, this means that the terminal on which the reboot sequence was started will not see what is going on. This patch fixes that by reopening stdin, stdout and stderr to the console device specified on the commandline, /dev/tty0 or /dev/console upon reboot. Also, due to (probably) pivot-root, /proc/1/fd shows 1-3 pointing to /console. This patch also fixes that. Signed-off-by: Michel Stam <m.stam@fugro.nl>
2014-10-06make procd wait for ubus to come upJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2014-10-02Fix 'reboot' message when the system is powering downMichel Stam
While executing a system halt (via the powerbutton or otherwise), the system displays rebooting, whereas it should display that it is going to turn off. Signed-off-by: Michel Stam <m.stam@fugro.nl>
2014-10-02Reboot busybox style via procdMichel Stam
It has been observed that, very rarely, the system does not reboot when procd enters the shutdown state. Busybox seems to have an obscure fix in its shutdown, where the parent (procd) process is put in an infinite loop, and a special child is executed to execute reboot(). This may very well be the cause. Signed-off-by: Michel Stam <m.stam@fugro.nl>
2014-10-02Kill processes on shutdownMichel Stam
Procd as it currently is does not kill the running processes during shutdown. As this might cause undesired behaviour, this should be implemented. Implementation was taken from busybox 1.19.4 Signed-off-by: Michel Stam <m.stam@fugro.nl>
2014-10-02Fix procd not handling rapid reboot signals very wellMichel Stam
When keeping ctrl-alt-del pressed, or when running; while true; do /sbin/reboot done effectively the procd shutdown cycle gets into an undefined state, Signed-off-by: Michel Stam <m.stam@fugro.nl>
2014-01-20state.c: pass ubus commandline is writable buffer to service_start_early()Jo-Philipp Wich
The service_start_early() function uses strtok() on the command line argument, therfore we cannot pass it constant string literals directly. Fixes OpenWrt bug #14832 Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2013-11-15debloat and reorganize codeJohn Crispin
split app into procd and init binaries remove log support, this is an external service now Signed-off-by: John Crispin <blogic@openwrt.org>
2013-11-12add service_validator supportJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-07-23Fix event type reporting when calling 'procd_shutdown'.Yousong Zhou
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2013-07-14the cloexec logic of the watchdog was brokenJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-07-11fix up watchdog init codeJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-06-27get rid of sleep() callsJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-06-24add respawn supportJohn Crispin
https://dev.openwrt.org/ticket/13751 Signed-off-by: John Crispin <blogic@openwrt.org>
2013-06-14drop good bye messageJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-03-13add state handlerJohn Crispin