aboutsummaryrefslogtreecommitdiffstats
path: root/package/system/procd/files
Commit message (Collapse)AuthorAgeFilesLines
* procd: allow optional watchdog instance parameterDaniel Bailey2020-07-141-2/+2
| | | | | | | | | | | | | | Optional instance watchdog timeout and watchdog mode can be set by adding: procd_set_param $mode $timeout $mode is an integer [0-1] representing instance watchdog mode of operation: 0 = disabled 1 = passive mode, client must periodically poke watchdog via ubus $timeout is an integer representing how often, in seconds, the watchdog must be poked. Signed-off-by: Daniel Bailey <danielb@meshplusplus.com>
* procd: update to git HEADDaniel Golle2020-07-101-0/+18
| | | | | | | ea7a790 jail: add support for running OCI bundle bb4a446 uxc: add container management CLI tool Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* procd: jail: fix segfault and add console featureDaniel Golle2020-05-151-0/+1
| | | | | | | | 2e73848 jail: SIGSEGV must not be forwarded to the child process 7e150f6 jail: unnamed jails can not have netns (fix segfault) 1ab539b jail: add option to provide /dev/console to containers Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* procd: replace backticks by $(...)Adrian Schmutzler2020-05-132-3/+3
| | | | | | This replaces deprecated backticks by more versatile $(...) syntax. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* procd: bump to latest HEADDaniel Golle2020-04-091-1/+4
| | | | | | | | | | | | 2188d81 jail: add support for launching extroot containers 6f3dbd2 jail: add support for userns and cgroupsns 28a06e5 jail: add support for (ram-)overlayfs Add handling for extroot, overlaydir and tmpoverlaysize as well as jail flags for userns and cgroupsns to OpenWrt's shell script to allow their use in init scripts. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* procd: actually wire-up netns supportDaniel Golle2020-03-121-0/+1
| | | | | | | | When support for network namespaces was added to procd, adding the corresponding jail flag in procd.sh was ommitted. Add it now. Fixes: 97a03a4760 ("procd: update to latest git HEAD") Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* procd: support 'requirejail' attributeKevin Darbyshire-Bryant2020-02-041-0/+1
| | | | | | | | | | | | | | | | Bump procd package to reduce log spam related to missing jail binaries in a non-jail capable system. bcb8655 instance: add 'requirejail' attribute An additional jail attribute 'requirejail' can now be used to indicate mandatory use of a jailed environment and hence prevent process startup in the event that the jail subsystem is unavailable. Procd will now only log errors if jail is unavailable and 1) is a mandatory requirement or 2) a procd debug level of at least 2 is in use. Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
* procd: start additional consoles during hotpluggingMichael Heimpold2019-11-091-0/+4
| | | | | | | | Now that 'start-console' procd command has reached the main repo, we can add a rule to start consoles on serial devices which are created when USB gadget driver reports creation with hotplugging. Signed-off-by: Michael Heimpold <mhei@heimpold.de>
* procd: allow usage of * as procd_running() instance parameterAlin Nastac2019-10-181-3/+3
| | | | | | | | | | | service_running() implementation in /etc/rc.common use it. It is preferable to use wildcard than assuming the instance name is the default one. jsonfilter returns all matches when wildcards are used, hence the -l 1 argument used to limit output to only one value. Signed-off-by: Alin Nastac <alin.nastac@gmail.com>
* procd: fix invalid JSON filter expression in procd_running()Jo-Philipp Wich2019-09-191-1/+1
| | | | | | | | | Since service and instance names may contain characters which are not allowed in JSON path labels, such as dashes or spaces, change the filter expression to array square bracket notation to properly match these cases as well. Fixes: 2c3dd70741 ("procd: add procd_running() helper for checking running state") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* base-files,procd: add generic service statusLuiz Angelo Daros de Luca2019-09-151-0/+25
| | | | | | | | | | | | | | Adds a default status action for init.d scripts. procd "service status" will return: 0) for loaded services (even if disabled by conf or dead) 3) for inactive services 4) when filtering a non-existing instance Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> [rebased, cleaned up] Signed-off-by: Petr Štetiar <ynezz@true.cz>
* procd: add procd_running() helper for checking running stateRafał Miłecki2019-05-021-0/+15
| | | | | | | | This should be helpful for implementing service_running() in procd init scripts. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Acked-by: John Crispin <john@phrozen.org>
* procd: allow passing optional group instance parameterMichael Heimpold2019-05-021-2/+3
| | | | | | | | | Sometimes is desirable to run a process with a specific group id instead of the default one which is derived from passwd entry. This can be achived now by using procd_set_param group $mygroup. Signed-off-by: Michael Heimpold <mhei@heimpold.de> Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_SOURCE_VERSION update]
* procd: allow passing optional syslog facility as instance parameterMichael Heimpold2019-05-021-1/+4
| | | | | | | | | Optional syslog facility can be set by adding procd_set_param facility $myfacility. While at, also add stdout/stderr documentation. Signed-off-by: Michael Heimpold <mhei@heimpold.de> Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_SOURCE_VERSION update]
* base-files/hotplug: fix dedicated group for tty devicesMichael Heimpold2019-04-041-0/+4
| | | | | | | | | | | | | | | | | Commit 124ab1dc0a and 5523ee3459 introduced the assignment of the group "tty" to /dev/tty* devices in order to support unprivileged user access to serial devices. However, due to an improperly rebased commit this feature broke. This patch restores the lost hunk in hotplug.json file to re-introduce this feature and also renames the existing "tty" group to "dialout" as this is the more typical name for such a group on desktop systems. Fixes: 5209cfa534 ("procd: fix hotplug.json syntax") Signed-off-by: Michael Heimpold <mhei@heimpold.de> Acked-by: Jo-Philipp Wich <jo@mein.io>
* procd: Add wrapper for uci_validate_section()Jeffery To2019-01-221-0/+17
| | | | | | | | | | | | | | | | | This adds a wrapper (uci_load_validate) for uci_validate_section() that allows callers (through a callback function) to access the values set by uci_validate_section(), without having to manually declare a (potentially long) list of local variables. The callback function receives two arguments when called, the config section name and the return value of uci_validate_section(). If no callback function is given, then the wrapper exits with the value returned by uci_validate_section(). This also updates several init scripts to use the new wrapper function. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* procd: fix procd_lock() when prepare_roofsYousong Zhou2018-01-281-2/+2
| | | | | | | | | | | | This fixes the following errors when doing "make package/install" /home/yousong/git-repo/lede-project/lede/build_dir/target-mips_24kc_musl/root-malta/lib/functions/procd.sh: line 47: /home/yousong/git-repo/l ede-project/lede/build_dir/target-mips_24kc_musl/root-malta/var/lock/procd_urandom_seed.lock: No such file or directory flock: 1000: Bad file descriptor Fixes FS#1260 Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
* procd: procd_send_signal use signal namesKevin Darbyshire-Bryant2018-01-021-0/+4
| | | | | | | | | | | Usage documentation for 'procd_send_signal' states "The signal is SIGHUP by default, and must be specified by NAME." Make actual behaviour match the stated documented behaviour. https://wiki.openwrt.org/inbox/procd-init-scripts Suggested-by: Jo-Philip Wich <jow@mein.io> Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
* procd: introduce procd_lock for init script protectionRoman Yeryomin2018-01-021-0/+15
| | | | | | | | | Use flock to protect init script from concurrent execution (of the same script). Important for services which generate native config files. Signed-off-by: Roman Yeryomin <roman@advem.lv> Signed-off-by: Andrejs Hanins <ahanins@gmail.com>
* procd: service_data: Support data within the service itselfPierre Lebleu2017-11-101-0/+15
| | | | | | Use the same approach than the service_triggers for the service_data. Signed-off-by: Pierre Lebleu <pme.lebleu@gmail.com>
* procd: mdns: Support txt values with spacesKarl Palsson2017-09-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Properly quote the arguments so that you can register a service with TXT entries that contains spaces. Example: procd_add_mdns myservice tcp 9999 "key=descriptive text field 1" \ "another=something equally verbose" Output before: $ avahi-browse -r -v _myservice._tcp _myservice._tcp local hostname = [blah.local] address = [192.168.255.74] port = [9999] txt = ["verbose" "equally" "another=something" "1" "field" "text" "key=descriptive"] Output now: $ avahi-browse -r -v _myservice._tcp _myservice._tcp local hostname = [blah.local] address = [192.168.255.74] port = [9999] txt = ["another=something equally verbose" "key=descriptive text field 1"] Signed-off-by: Karl Palsson <karlp@etactica.com>
* procd: fix hotplug.json syntaxFlorian Eckert2017-08-181-15/+11
| | | | Signed-off-by: Florian Eckert <fe@dev.tdt.de>
* procd: fix hotplug-preinit.json syntaxFlorian Eckert2017-08-181-4/+4
| | | | Signed-off-by: Florian Eckert <fe@dev.tdt.de>
* procd: support term_timeout parameterJo-Philipp Wich2017-06-261-1/+1
| | | | | | | | | Expose "term_timeout" parameter in procd.sh to allow init scripts to request a longer termination timeout. This is required to fix FS#859 in a later commit. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* procd: assign /dev/tty* nodes to "tty" groupJo-Philipp Wich2017-06-261-0/+4
| | | | | | | | Adjust default permissions and ownership of /dev/tty* nodes from 0600/root:root to 0660/root:tty in order to support granting unprivileged user access when needed. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* procd: remove procd-nand packageMatthias Schiffer2017-05-292-397/+0
| | | | | | | | | | | We always want to support staged upgrades now, so it's better to include upgraded into the main package. /lib/upgrade/nand.sh is moved to base-files. The procd-nand-firstboot package is removed for now, it may return later as a separate package. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* procd: prepare NAND sysupgrade for making upgraded dynamically linkedMatthias Schiffer2017-05-291-2/+3
| | | | | | | | Use install_bin to copy upgraded with all dependencies. The old name /tmp/upgraded is temporarily retained as a symlink to avoid breaking things. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* procd: clean up trailing whitespace in nand.shMatthias Schiffer2017-05-291-2/+2
| | | | Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* procd: nand: make it possible to configure kernel and ubi partitionChristian Lamparter2017-03-221-2/+2
| | | | | | | | | | With this patch, the nand.sh script no longer overwrites CI_KERNELPART and CI_UBIPART if they have been set before. This allows platforms specify alternative values for these variables. Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* procd.sh: use parameterized respawn valuesClaudiu Brasovean2017-03-071-1/+3
| | | | | | | | | | continue work started here: http://patchwork.ozlabs.org/patch/520859 Extend /etc/config/system with parameters to set the default respawn treshold and respawn timeout for procd launched services that have respawn enabled. This results in cleaner init scripts, while making sure services have respawn parameters set. Signed-off-by: Claudiu Brasovean <cbrasho@gmail.com>
* procd: fix default timeout for reload trigger actionsDenis Osvald2017-02-151-5/+2
| | | | | | | | | | | | | Default trigger action timeout was added to procd.sh in commit f88e3a4c0 (procd: add default timeout for reload trigger actions) However, the timeout value was not placed under the correct JSON-script array nesting level and thus did not apply. To fix this and make the timeout actually apply to the reload triggers, we place it in the correct scope, that is the per-trigger array. Fixes: f88e3a4c0abb60bb76a7678dd30dfdc8a808a2f1 Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
* procd: update procd.sh to disallow signal-numbers, enforce signal-namesBastian Bittorf2017-01-261-1/+4
| | | | | | | | | | | | A given signal-name is now converted to the corresonding number. In general it's good style to use names (readability) and it's more portable: signal numbers can be architecture-dependent, so we are more safe giving names. A real world example is signal 10, which is BUS on ramips and USR1 on PPC. All users of 'procd_send_signal' must change their code to reflect this. Signed-off-by: Bastian Bittorf <bb@npl.de>
* procd: add support for overriding the tar sysupgrade board nameFelix Fietkau2017-01-111-1/+10
| | | | | | Useful for providing images that work for multiple devices Signed-off-by: Felix Fietkau <nbd@nbd.name>
* procd: update procd.sh to support sending kill signal to a serviceHans Dedecker2016-12-201-1/+17
| | | | | | | | Add procd_send_signal which allows to send an optional specified kill signal to one specified or all instances of a given service. By default SIGHUP is sent if no signal is specified Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* procd: add support for service signalsJo-Philipp Wich2016-12-141-1/+1
| | | | | | | | | | | | | | | | Update procd to latest HEAD in order to introduce support for services signals: - Adds a new service.signal ubus call to send a kill() signal to one or all running instances of a given service - Adds a new "reload_signal" property which allows service init scripts to request procd to send a specific kill() signal on reload, instead of stopping and restarting running processes Also fixes some potential memory leaks reported by cppcheck and an environment variable corruption in the trace command. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* procd: Allow initscripts to start one daemon instance at a timePierre Lebleu2016-10-181-1/+1
| | | | Signed-off-by: Pierre Lebleu <pierre.lebleu@technicolor.com>
* sysupgrade: unmount filesystems before rebootMathias Kresin2016-08-041-0/+2
| | | | | | | | | | | | | | | sysupgrade immediately reboots after flashing an image and doesn't allow to unmount filesystems. At least in case the image used for sysupgrade is stored on a FAT formatted usb flash drive, the following warning is printed during the next mount of the flash drive: FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck. Although a data corruption during read operations is unlikely, there is no need to scare the users. Signed-off-by: Mathias Kresin <dev@kresin.me>
* procd: add default timeout for reload trigger actionsFelix Fietkau2016-07-291-0/+10
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* procd: rework trigger handlingFelix Fietkau2016-07-291-8/+16
| | | | | | | | | Open/close triggers array around service_triggers call to make using multiple triggers easier to deal with. The API was quite confusing, because some functions contained implicit trigger open/close calls and some didn't. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* procd: Set /dev/kmsg to 600neheb2016-07-021-4/+0
| | | | | | | | | | | Small cleanup. I initially though /dev/kmsg was used for dmsg(and journald on desktops) but this seems not to be the case. dmsg is still accessible as non-root(gives output) which begs the question what does this do? Some googling reveals that permissions are set to 600 for some embedded systems while 644 for others. I can't find any justification for the latter. Might as well err on the side of caution. Signed-off by: Rosen Penev <rosenp@gmail.com>
* procd: change /dev/{gpio,hvc*} perms to 0600John Crispin2016-06-301-7/+2
| | | | Signed-off-by: John Crispin <john@phrozen.org>
* procd: adjust /dev entries to desktop distro defaultsneheb2016-06-301-14/+4
| | | | | | | | | | | This changes the default permissions for /dev entries to be more similar to a desktop distro. Taken from the defaults of Arch Linux and Ubuntu. Also changed some that were nonsensical. For example, all 660 permissions on desktop distros were of the form root:x where x is something other than root. As such, 660 is useless for LEDE where the specific group is missing. audio seems to be the only group that isn't. Signed-off by: Rosen Penev <rosenp@gmail.com>
* procd: properly set /dev/snd permission and groupJohn Crispin2016-06-201-0/+4
| | | | Signed-off-by: John Crispin <john@phrozen.org>
* procd: fix file permissions of /dev/tty* nodesJohn Crispin2016-06-061-1/+5
| | | | Signed-off-by: John Crispin <john@phrozen.org>
* procd: fix respawn related warningJohn Crispin2016-03-101-0/+1
| | | | | | | | WARNING: Variable 'respawn' does not exist or is not an array/object Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 48996
* procd: support pidfile writing.John Crispin2016-03-101-1/+2
| | | | | | | | | | | | procd from revision b12bb150ed38a4409bef5127c77b060ee616b860 supports writing a pidfile. This adds support for setting that parameter with standard init script hooks: procd_set_param pidfile /var/run/someprocess.pid Signed-off-by: Karl Palsson <karlp@etactica.com> SVN-Revision: 48984
* procd: Allow to configure default respawn retry countJohn Crispin2016-03-041-0/+10
| | | | | | | | | | | | | | | | | | Extend /etc/config/system with a parameter to set the default respawn retry for procd launched services that have respawn enabled. config service option respawn_retry -1 All services that don't specify specific respawn parameters will get their defaults added by procd.sh. If respawn_retry is specified in /etc/config/system the default retry limit will be set to this value by procd. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> SVN-Revision: 48915
* procd: hotplug.json: allow passing hotplug events from all subsystemsJohn Crispin2016-02-261-12/+6
| | | | | | | | | | | There are time that programs need to be notified of events from subsystems that are not enumerated in the .json definition, e.g. QEMU guest agent by default requires /dev/virtio-ports/org.qemu.guest_agent.0 which is a symlink to /dev/vportMpN from virtio-ports subsystem. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com> SVN-Revision: 48799
* hotplug-preinit: remove superfluous `and`John Crispin2016-02-261-3/+1
| | | | | | Signed-off-by: Alexander Couzens <lynxis@fe80.eu> SVN-Revision: 48795
* procd: emit events for sound subsystemJohn Crispin2016-01-191-1/+1
| | | | | | | | | | | | | | | | | | | | Useful e.g. for plugable USB-soundcards. With this change an event/hotplug-call looks like: ACTION: add DEVNAME: snd/timer DEVPATH: /devices/virtual/sound/timer SUBSYSTEM: sound ACTION: add DEVNAME: DEVPATH: /devices/platform/ehci-platform/usb1/1-1/1-1:1.0/sound/card0 SUBSYSTEM: sound ACTION: add DEVNAME: snd/controlC0 DEVPATH: /devices/platform/ehci-platform/usb1/1-1/1-1:1.0/sound/card0/controlC0 SUBSYSTEM: sound ACTION: add DEVNAME: snd/pcmC0D0p DEVPATH: /devices/platform/ehci-platform/usb1/1-1/1-1:1.0/sound/card0/pcmC0D0p SUBSYSTEM: sound ACTION: add DEVNAME: snd/pcmC0D0c DEVPATH: /devices/platform/ehci-platform/usb1/1-1/1-1:1.0/sound/card0/pcmC0D0c SUBSYSTEM: sound ACTION: add DEVNAME: dsp DEVPATH: /devices/platform/ehci-platform/usb1/1-1/1-1:1.0/sound/card0/dsp SUBSYSTEM: sound ACTION: add DEVNAME: audio DEVPATH: /devices/platform/ehci-platform/usb1/1-1/1-1:1.0/sound/card0/audio SUBSYSTEM: sound ACTION: add DEVNAME: mixer DEVPATH: /devices/platform/ehci-platform/usb1/1-1/1-1:1.0/sound/card0/mixer SUBSYSTEM: sound This fixes #21466. Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com> SVN-Revision: 48366