summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2013-09-10udevtrigger: use a helper function for subdir scanningGabor Juhos
The scan_{block,class,subsystem} functions are using identical code for scanning. Move that into a separate function to avoid code duplication. Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2013-09-10udevtrigger: check presence of dev attributeGabor Juhos
The presence of the 'uevent' attribute file does not always mean that a corresponding device node can be created under '/dev'. For valid device nodes, a 'dev' attribute file must be present which cntains the major and minor numbers of the device. Modify the code to check the presence of the dev attribute as well. This allows to avoid superfluous trigger_uevent calls. On a test system, the patch reduced the number of the triegger_uevent calls from 144 to 70. Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2013-09-10udevtrigger: add device_has_attribute helperGabor Juhos
Move the code from device_list_insert() into a separate function. This makes it possible to reuse the code for other attribute files. Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2013-09-10udevtrigger: remove trailing whitespacesGabor Juhos
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2013-09-03add a ubus handler that allows sending signals to processesJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-09-03fix use after free bug in the trigger handling codeJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-09-03add suport for measuring process resource usageJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-09-03fixup service_dump logicJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-09-03trivial code cleanupJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-09-03add respawn handlingJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-09-03logread: fix the facility name reportingJohn Crispin
http://patchwork.openwrt.org/patch/3978/ Signed-off-by: Mike Brady<mikebrady@eircom.net>
2013-08-16service: terminate uloop after fork(), redirect stdin, out and err to /dev/nullJo-Philipp Wich
2013-08-15hotplug: terminate uloop after fork(), redirect stdin, out and err to /dev/nullJo-Philipp Wich
2013-07-23askfirst: remove superfluous 'close' calls on stdio file descriptors.Yousong Zhou
'dup2' will do it for us if necessary. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2013-07-23Parse only init_debug option with non-empty argument.Yousong Zhou
Matching empty string makes rm_so and rm_eo of struct regmatch_t have the same value, in this case both of them are 11. This causes a call to atoi("\0") whose return value 0 is just the initial value of 'debug'. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2013-07-23Error and return when failing stat('/dev/console').Yousong Zhou
Since mkdev("*", 0600) has been called in early_dev just before early_console, no need to try checking it again. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2013-07-23Fix event type reporting when calling 'procd_shutdown'.Yousong Zhou
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2013-07-22early: remove superfluous close of stdio file descriptorsGabor Juhos
'man dup2' says: dup2() makes newfd be the copy of oldfd, closing newfd first if necessary, but note the following: * If oldfd is not a valid file descriptor, then the call fails, and newfd is not closed. * If oldfd is a valid file descriptor, and newfd has the same value as oldfd, then dup2() does nothing, and returns newfd. Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2013-07-22early: keep stdio files openGabor Juhos
At the end of the 'early_console' function, the file descriptor is closed unconditionally. This 'close' call closes the stdio files if the fd returned by the 'open(dev/console)' call equals with any of the STD{IN,OUT,ERR}_FILENO values. When this happens, all subsequent accesses to the stdio files will fail and early console access won't work. To avoid this, don't close the file descriptor if that equals with any of the STD*_FILENO values. Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2013-07-14the cloexec logic of the watchdog was brokenJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-07-14logread should handle return code when sending data over the netJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-07-11fix wdt cloexec bugJohn 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-07-10print services with no instances when verbose is setJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-07-10fix service level triggersJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-07-10make the verbose argument a boolJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-07-10invalid pointer was passed to free()John Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-07-10remove bogus subscriberJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-07-10remove support fro trigegrs not linked to a serviceJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-07-09the delete handle should return an error if no service is named instead of ↵John Crispin
killing all services Signed-off-by: John Crispin <blogic@openwrt.org>
2013-07-09Fix logread file loggingJohn Crispin
This patch fixes logread and now appends to files instead of writting to the beginning the specified logfile. It also sets the access rights to 0600. Signed-off-by: Peter Wagner <tripolar@gmx.at>
2013-07-09fix up the loging over networkJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-07-08dont list services that have no instancesJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-07-08close stdin/out/err before forking an instanceJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-07-08remove superflous defineJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-07-08extend logreadJohn Crispin
* log to file * add pidfile support * reconnect when logging over network
2013-07-08bugfix of error handling while open()Thomas Huehn
The normal return value from open() is a non-negative integer. In the case of an error, a value of -1 is returned instead. Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
2013-07-04add trigger supportJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-07-03properly fix umask handlingJohn Crispin
https://dev.openwrt.org/ticket/13752 https://dev.openwrt.org/ticket/13794 Signed-off-by: John Crispin <blogic@openwrt.org>
2013-07-03add 2 second sleep before rebootingJohn Crispin
stderr is lost without this whena crash happens Signed-off-by: John Crispin <blogic@openwrt.org>
2013-06-29add support for the system.event nodeJohn 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-27make ubus handling use uloop timersJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-06-24set global umask to 0John 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-19make add facility and level to logread outputJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-06-14drop good bye messageJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-06-13register the system namespace on ubus regardless of the pidJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-06-10we dont want to continue booting if sysupgrade is in progressJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2013-06-04merge ubus system namespace from rpcd codebaseJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>