Age | Commit message (Collapse) | Author |
|
Using pipe automatically switches service to block buffering which kind
of breaks our logging. We won't get anything from stdout FD until the
buffer gets filled fully or the service exits. This makes log messages
appear with an unwanted delay.
This change adds a tiny libsetlbf.so switching stdout to line buffering
and uses this lib for every logging-enabled service started by procd.
We don't need any extra change for stderr as it's unbuffered by default.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Modified to use no buffering to align with stderr. Several cleanups.
Signed-off-by: Steven Barth <steven@midlink.org>
|
|
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
Otherwise we hit max number of fd limit (1024) and instances fail to
start with the following errors in syslog
Sun Jun 14 01:27:38 2015 daemon.warn procd: pipe() failed: 24 (Too many open files)
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
|
|
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
|
|
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
|
|
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
|
|
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
|
|
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
When attempting to run a service with an unprivileged user and group
id procd, the following error might occur:
procd: failed to set uid:1000, gid:1000
This is due to the fact that procd first performs the setuid(), then
the setgid() call.
Usually there no sufficient permissions after a setuid() anymore to
change the effective group id of the process.
Refactor the code to:
* Swap the invocations (first gid, then uid)
* Don't set user or group id if it is 0
* Handle errors independently and make them more verbose
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
|
|
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
conflicts with system defines
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
|
|
This commit adds support to procd for relaying stdout and stderr streams to
the system log. That is mainly useful for services not using syslog, e.g.
uhttpd.
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
|
|
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
The memdup is unnecessary, because the data is contained inside
in->config.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
started
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
the data type varies for different implementations
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
The instance_config_move() function in the procd instance managing code is
missing a blobmsg_list_move() call to update the tracked file items with the
newly calculated checksums in case of a file change.
Without that change, services are always reloaded after the first change to
a tracked file regardless of whether there are any subsequent changes or not.
Add a missing instance of blobmsg_list_free() as well.
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
|
|
useful to enable core dumps or set resource limits
Signed-off-by: Ulrich Weber <uw@xyne.com>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
startetd
Signed-off-by: John Crispin <blogic@openwrt.org>
|