aboutsummaryrefslogtreecommitdiffstats
path: root/package/system/procd/files/procd.sh
Commit message (Collapse)AuthorAgeFilesLines
* 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]
* 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: 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.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: 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>
* 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: 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: update procd.sh to support new ujail optionsJohn Crispin2015-12-111-3/+3
| | | | | | Signed-off-by: Etienne CHAMPETIER <champetier.etienne@gmail.com> SVN-Revision: 47862
* procd: correct the order of respawn params in the comments.Felix Fietkau2015-06-141-1/+1
| | | | | | Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com> SVN-Revision: 45955
* procd: work around a event raceJohn Crispin2015-06-031-2/+0
| | | | | | | | | | there is a conceptual design flaw in our interface events. workaround this by disabling duplicate message supression in procd. we need to fix this properly for the next release Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 45883
* procd: add a 10 second delay to the interface triggersJohn Crispin2015-06-021-0/+1
| | | | | | | | | this is an ugly hack that will be removed when the netifd maintainers have time to look at the problem. Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 45876
* Removed reference to imaginary procd_add_interface_reload in procd.shJohn Crispin2015-04-181-1/+0
| | | | | | | | | The last line of procd.sh has a reference to procd_add_interface_reload. procd_add_interface_reload doesn't seem to exist. I've removed the reference of it to minimize confusion. Signed-off-by: Eric Schultz <eschultz@prplfoundation.org> SVN-Revision: 45487
* procd: add jail supportJohn Crispin2015-03-261-1/+59
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 45010
* procd: add support for relaying daemon stdio to syslogJo-Philipp Wich2015-02-261-0/+3
| | | | | | | | | | | | | Procd enabled init scripts can now specify: procd_set_param stdout 1 procd_set_param stderr 1 ... to relay their respective standard IO streams to the system log. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 44547
* scripts: fix wrong usage of '==' operatorJohn Crispin2014-10-141-1/+1
| | | | | | | | | | | | | | [base-files] shell-scripting: fix wrong usage of '==' operator normally the '==' is used for invoking a regex parser and is a bashism. all of the fixes just want to compare a string. the used busybox-ash will silently "ignore" this mistake, but make it portable/clean at least. this patch does not change the behavior/logic of the scripts. Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com> SVN-Revision: 42911
* procd: update to latest gitJohn Crispin2014-09-111-0/+4
| | | | | | | | add support for starting services as !root Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 42471
* procd: allow adding empty strings to arraysFelix Fietkau2014-09-101-1/+1
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 42456
* procd: run the mdns register outside the sub shell containerJohn Crispin2014-08-291-3/+2
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 42327
* procd: update to latest git HEADJohn Crispin2014-08-291-0/+44
| | | | | | | | this adds a interafce.update trigger and mdns service registration helpers Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 42324
* procd: add a shell helper function to emit a config.change eventFelix Fietkau2014-07-021-0/+13
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 41482
* procd: add shell functions to add instance dataFelix Fietkau2014-07-021-0/+11
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 41481
* procd: fix uci_validationJohn Crispin2014-06-301-1/+2
| | | | | | | | | | Regardles of the return code from validate_data _error variable will be 0 due to 'local' command in the previous line. With this patch we are able to catch the return code from validate_data tool. Signed-off-by: Luka Perkov <luka@openwrt.org> SVN-Revision: 41414
* procd: rename procd_add_network_triggerJohn Crispin2014-06-161-3/+4
| | | | | | | | i got complaints about the bad naming of the api. lets rename it while there are no users yet. Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 41220
* procd: allow passing multiple config files to procd_add_reload_triggerFelix Fietkau2014-06-111-1/+4
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 41146
* procd: service instances can now report an error of why they failed to start.John Crispin2014-06-061-0/+13
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 41031
* procd: add wrapper calls for interface triggersJohn Crispin2014-06-051-2/+35
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 41008
* procd: rename local variable in uci_validate_sectionJohn Crispin2014-06-051-9/+9
| | | | | | | | | | | | | | Allow to use "package", "type", "name", "error" and "result" as config option names: package some_service config section 'foo' option name 'bar' option type 'unknown' Signed-off-by: Maxim Storchak <m.storchak@gmail.com> SVN-Revision: 41006
* procd: add a PROCD_DEBUG variable that will dump the ubus calls from init ↵Felix Fietkau2014-03-211-0/+1
| | | | | | | | scripts to stderr Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 39983
* procd: the helper script did not export all functions properlyJohn Crispin2014-02-181-0/+2
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 39612
* netifd: enable coredumps againJohn Crispin2013-12-091-2/+3
| | | | | | | | got broken due procd startup. Requires procd resource limit patch. Signed-off-by: Ulrich Weber <uw@xyne.com> SVN-Revision: 39020
* procd: fix processing of datatype specification with spacesJo-Philipp Wich2013-11-281-2/+2
| | | | SVN-Revision: 38935
* procd: update procd.sh to make use of the new validate_data toolJohn Crispin2013-11-251-52/+8
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 38908
* procd: options with default values are not parsed properly in the ubus ↵John Crispin2013-11-131-1/+2
| | | | | | | | register code Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 38788
* procd: update to latest git headJohn Crispin2013-11-131-9/+75
| | | | | | | | this includes the first wip version of the uci validation backend Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 38786
* procd: fix command handling in procd_add_instance()Felix Fietkau2013-10-091-1/+1
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 38350
* procd: update to latest git headJohn Crispin2013-09-171-2/+18
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 38022