summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2015-09-15hotplug: add BUTTON to environment vars for timeout actionGünther Kelleter
as done in pressed and released actions Signed-off-by: Günther Kelleter <guenther.kelleter@devolo.de>
2015-08-11fix generating syscall-names.hHauke Mehrtens
Sometimes the syscall number is not defined with a number but with an offset to an other syscall and then make_syscall_h.sh created some broken header file. For example the bit/syscall.h from musl for i386 has this: #define __NR_timer_create 259 #define __NR_timer_settime (__NR_timer_create+1) With this patch the resulting array looks like this: [259] = "timer_create", [(__NR_timer_create+1)] = "timer_settime", This fixes this bug from OpenWrt: https://dev.openwrt.org/ticket/20195 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2015-07-27allow buttons to call delayed timeout actionsJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2015-07-24jail: fix jail root folder permissionsEtienne CHAMPETIER
We need a+x rights on the path to the root of the jails so we can use users other than root (like nobody) This partly fixes jailed dnsmasq Signed-off-by: Etienne CHAMPETIER <champetier.etienne@gmail.com>
2015-07-07service: if logging start app with LD_PRELOAD & lib for line bufferingRafał Miłecki
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>
2015-07-06Attempt to deal gracefully with allocation failures.Juliusz Chroboczek
These should probably not happen in practice, but having an explicit error message may make debugging out-of-memory situations easier.
2015-06-20Revert "hotplug: support for interval commands"Felix Fietkau
This reverts commit 9562ce477476a27851ec90cfbf971b8cb41c81a6. Revert requested by John, will be re-implemented in a different way.
2015-06-18fix /dev/shm permissions, this time for realDaniel Gimpelevich
Previous patch did not account for umask, now adding that. Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
2015-06-17fix /dev/shm permissionsDaniel Gimpelevich
On my Ubuntu system, the permissions are 1777. They are incorrect in procd, leading to this: https://forum.openwrt.org/viewtopic.php?id=57073 This in intended for both CC and DD. Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
2015-06-14hotplug: support for interval commandsRafał Miłecki
This allows executing code with a given interval. As every command, it can be assign to any uevent. Intervals may be useful for counting elapsed time since some action. It allows e.g. indicating that button has been pressed for some time. This is useful to let user know he can already release the button. Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
2015-06-14service: reorder function to avoid forward declarationFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2015-06-14service: close instance pipe fd on restart.Yousong Zhou
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>
2015-06-14service: allow get_data of specifc instance.Yousong Zhou
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2015-06-14service: remove unused struct watch_subscribe definition.Yousong Zhou
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2015-06-14service: dump respawn params in the same order as when passed in.Yousong Zhou
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2015-06-14service: optimize relaying stdio output of daemons a bit.Yousong Zhou
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2015-06-04trigger: make trigger_match() bool and make return value less confusingFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2015-06-02allow multiple identical events to be queuedJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2015-05-23remove ->John Crispin
[ 1.240000] init: failed to symlink /tmp -> /var Signed-off-by: John Crispin <blogic@openwrt.org>
2015-05-14jail: respect byte order when setting AUDIT_ARCHDaniel Golle
AUDIT_ARCH on ARM and MIPS differs depending on the byte order. Thus set AUDIT_ARCH to the respective endian-specific variants. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2015-05-14jail: add support for ARM architectureDaniel Golle
SECCOMP_FILTER isn't supported on ARM OABI. Thus enable seccomp support in jail only for EABI. thumb might work as well as it apparently implies EABI, but yet doesn't set __ARM_EABI__. The REG_SYSCALL macro seems to be an unused left-over. However, it's defined for other architectures as well. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2015-05-14trace: add support for ARM architectureDaniel Golle
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2015-05-05instance: handle setgid() before setuid()Jo-Philipp Wich
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>
2015-04-19instance: avoid dumping invalid service instances - prevents a potential crashFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2015-04-10fix include orderJohn Crispin
this broke x86_64 builds on uclibc Signed-off-by: John Crispin <blogic@openwrt.org>
2015-03-28properly handle return codesJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2015-03-27make it optional to remount the tmpfs as roJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2015-03-26make jail build optionalJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2015-03-23procd can now start jailed processesJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2015-03-23add initial version of ujail and utraceJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2015-03-18check for empty parameters in askfirstZefir Kurtisi
Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
2015-03-12switch to _DEFAULT_SOURCE for modern glibc compatJohn Crispin
Signed-off-by: Jeff Waugh <jdub@bethesignal.org>
2015-03-06json 0.12 fixesJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2015-02-27service: rename variables / struct members called stdout, stderr to avoid ↵Felix Fietkau
conflicts with system defines Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2015-02-26service: don't use stdio log channelJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-02-26procd: support relayoing daemon stdout/stderr to syslogJo-Philipp Wich
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>
2015-02-25Convert log calls to ulog() apiJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-28procd: increase memory allocated for tmpfs on zramNathan Hintz
Devices with <= 32MB of ram get half of memory allocated to zram (up to 16MB). Devices with > 32MB of ram get just 8MB of memory allocated to zram. Increase memory allocated to devices with > 32MB ram to 16MB. Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>
2015-01-25Make build of upgraded optionalJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-15system: increase memory field sizes to 64bitJo-Philipp Wich
On an Alix APU board with 4GB of available ram, the total memory is reported as "-179417088" bytes. Increase the ubus field sizes to 64bit integers in order to avoid overflows. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-15system: attempt to parse /proc/device-tree/modelJo-Philipp Wich
Fallback to /proc/device-tree/model if /tmp/sysinfo/model is not available. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-15system: improve system name detectionJo-Philipp Wich
Skip entries like "Processor: 0" which are common on x86, otherwise an "ubus call system board" will just return "system: 0". Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-09inittab: don't close fds unconditionally since this breaks UMLSteven Barth
Signed-off-by: Steven Barth <steven@midlink.org>
2014-12-14only write to the watchdog if the fd is validJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2014-12-02previous commit accidentiall dropped the cgroup mountJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2014-12-02add support for zram compressed tmpfsJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2014-11-19service: fix ubus list commandFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-11-14initd: mount cgroupLuka Perkov
If kernel is compiled with cgroup support it should be mounted. This change does not effect kernels without cgroup support. Signed-off-by: Luka Perkov <luka@openwrt.org>
2014-11-08inittab: clean up tty opening code, fix console shell job control issuesFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-11-05call setsid during startup.John Crispin
this fixes a bug where pgrp was not set up properly leading to a trail of carnage; Signed-off-by: John Crispin <blogic@openwrt.org>