Re: [PATCH 4/5] initd: Don't search the environment list if the watchdog, fd is initialized

2020-09-29 Thread Michael Jones
On Tue, Sep 29, 2020 at 1:59 PM John Crispin wrote: > > > On 29.09.20 20:55, Michael Jones wrote: > > On Tue, Sep 29, 2020 at 1:47 PM John Crispin wrote: > >> > >> On 29.09.20 18:22, Michael Jones wrote: > >>> Signed-off-by: Michael Jones > >

Re: [PATCH 4/5] initd: Don't search the environment list if the watchdog, fd is initialized

2020-09-29 Thread Michael Jones
On Tue, Sep 29, 2020 at 1:47 PM John Crispin wrote: > > > On 29.09.20 18:22, Michael Jones wrote: > > Signed-off-by: Michael Jones > > --- > > watchdog.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/watch

[PATCH 1/5] initd: Add ubus argument to trigger watchdog tickle.

2020-09-29 Thread Michael Jones
Signed-off-by: Michael Jones ---  system.c | 5 +  1 file changed, 5 insertions(+) diff --git a/system.c b/system.c index 0fb98f1..ef7943a 100644 --- a/system.c +++ b/system.c @@ -325,6 +325,7 @@ enum { WDT_TIMEOUT, WDT_MAGICCLOSE, WDT_STOP, +    WDT_TICKLE, __WDT_MAX

[PATCH 5/5] initd: Convert the watchdog_fd return value from char* to int

2020-09-29 Thread Michael Jones
This change improves the frequently called path of determining if the watchdog is alive when responding to ubus transactions at the expense of complicating the less frequently called code of transitioning to the upgraded binary, and transitioning from pre-init to procd. Signed-off-by: Michael

[PATCH 2/5] initd: Re-use the watchdog_set_cloexec() function from, watchdog_open()

2020-09-29 Thread Michael Jones
Signed-off-by: Michael Jones ---  watchdog.c | 3 +--  1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/watchdog.c b/watchdog.c index 9d770b4..20b6e20 100644 --- a/watchdog.c +++ b/watchdog.c @@ -65,8 +65,7 @@ static int watchdog_open(bool cloexec) if (wdt_fd < 0)     ret

[PATCH 3/5] initd: Ensure that watchdog frequency changes apply right away

2020-09-29 Thread Michael Jones
If the watchdog frequency is changed from high to low, the watchdog won't be tickled again until the previous period has expired, which may result in a watchdog timeout. This change ensures that the new frequency is applied immediately. Signed-off-by: Michael Jones ---  watchdog.c | 1 +  1 file

[PATCH 4/5] initd: Don't search the environment list if the watchdog, fd is initialized

2020-09-29 Thread Michael Jones
Signed-off-by: Michael Jones ---  watchdog.c | 4 ++--  1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/watchdog.c b/watchdog.c index 20830c3..ac5b656 100644 --- a/watchdog.c +++ b/watchdog.c @@ -49,11 +49,11 @@ static void watchdog_timeout_cb(struct uloop_timeout *t)    static int

[PATCH 0/5] Improvements to the hardware watchdog code of procd

2020-09-29 Thread Michael Jones
This set of patches makes various minor improvements to the hardware watchdog code of procd. The first patch adds a new feature to allow the watchdog to be manually tickled via ubus. The other patches are minor optimizations and improvements. Michael Jones (5):   initd: Add ubus argument

UCI: Making a config read-only?

2020-08-26 Thread Michael Jones
I wish to make a configuration file read-only in UCI. I tried to do this by bind-mounting the default config for it in /rom onto the file in /etc/config. However, while this does prevent changes to that config from persisting across reboots, it doesn't prevent changes from showing up in, e.g.

Controlling host routes via ubus / netifd

2020-08-12 Thread Michael Jones
Hi List. I am trying to control the routes on my OpenWRT system programmatically, and would like to know if this is possible to do via ubus and netifd. I've located the ubus target "ubus call network add_host_route '{"interface":"wan", "target":"1.0.0.0"}'" However, it does not seem to actually

Re: jsonfilter and queries with '-' in them

2020-08-12 Thread Michael Jones
Thanks. That works. Could you write a little bit about the underlying cause of this just so I can understand better? On Wed, Aug 12, 2020 at 3:59 PM Jo-Philipp Wich wrote: > > Hi, > > as already implied by Dirk, you need to use bracket notation for labels that > are not valid variable

jsonfilter and queries with '-' in them

2020-08-12 Thread Michael Jones
Hi List, I am trying to query netifd via ubus for the list of ipv4 ipaddresses associated with an interface. Currently my query looks like ubus call network.interface.wan status | jsonfilter -e "@.ipv4-address" Syntax error: Invalid escape sequence In expression @.ipv4-address Near here

[OpenWrt-Devel] /usr/share/libubox/jshn.sh and piping json text to json_load

2020-06-13 Thread Michael Jones
Hi List, I'm looking to load some json text that's being piped through grep / sed / awk into the json handling capabilities provided by /usr/share/libubox/jshn.sh Looking here: https://git.openwrt.org/?p=project/libubox.git;a=blob;f=jshn.c;h=1b685e5fb0d853c4053389242b92c34967beb94f;hb=HEAD I

Re: [OpenWrt-Devel] [PATCH v2] build: improve ccache support

2020-06-12 Thread Michael Jones
On Fri, Jun 12, 2020 at 1:44 PM Roman Yeryomin wrote: > Set CCACHE_DIR to $(TOPDIR)/.ccache and CCACHE_BASEDIR to $(TOPDIR). > This allows to do clean and dirclean. Cache hit rate for test build > after dirclean is ~65%. > If CCACHE is enabled stats are printed out at the end of building

Re: [OpenWrt-Devel] [PATCH] build: improve ccache support

2020-06-04 Thread Michael Jones
> I agree with Felix. Having one ccache directory for multiple repos > doesn't make much sense to me as most probably they are for different > platforms. And even if they are for same platform there are more chances > for ccache corruption and deleting it will affect all those repos. So it > still

Re: [OpenWrt-Devel] netifd: per-interface MTU settings vs per-route MTU settings?

2020-06-04 Thread Michael Jones
On Mon, Jun 1, 2020 at 9:39 PM Reuben Dowle wrote: > When changing an interface MTU direct through ip command, netifd will get > be out of sync. The netifd internally tracked MTU (discoverable through > ubus call network.device status '{"name":"xxx"}' call will always show 1500 > (or whatever

Re: [OpenWrt-Devel] [PATCH] base-files: add list-enabled/disabled to service function in /etc/profile

2020-06-03 Thread Michael Jones
On Wed, Jun 3, 2020 at 6:21 PM Stan Grishin wrote: > To obtain the list of enabled (for autostart) services, you'd type > service list-enabled. For disabled services service list-disabled. It > is useful when you need to quickly check which services are > enabled/disabled or when helping other

Re: [OpenWrt-Devel] [PATCH] base-files: add list-enabled/disabled to service function in /etc/profile

2020-06-03 Thread Michael Jones
On Wed, Jun 3, 2020 at 6:42 AM Stan Grishin wrote: > Implement service list-enabled and service list-disabled to provide an > easy way > for users to list enabled/disabled services from CLI. > > Signed-off-by: Stan Grishin > --- > package/base-files/files/etc/profile | 21 +

Re: [OpenWrt-Devel] uci API wrong

2020-06-03 Thread Michael Jones
On Wed, Jun 3, 2020 at 3:22 AM 魏艳艳 wrote: > Dear! > I've tried to write configurations using UCI API in my projects, but > they often cause my processes to crash, I don't know why?I hope you can > help me。 > 1、platform:X86 > This is the information that my Program crashed > (gdb) where > #0

Re: [OpenWrt-Devel] [PATCH] build: improve ccache support

2020-06-01 Thread Michael Jones
On Mon, Jun 1, 2020 at 1:22 PM Felix Fietkau wrote: > On 2020-06-01 19:11, Michael Jones wrote: > > > > > > On Mon, Jun 1, 2020 at 10:33 AM Roman Yeryomin > <mailto:ro...@advem.lv>> wrote: > > > > Set CCACHE_DIR to $(TOPDIR)/.ccache and CCACHE_BA

Re: [OpenWrt-Devel] [PATCH] build: improve ccache support

2020-06-01 Thread Michael Jones
On Mon, Jun 1, 2020 at 10:33 AM Roman Yeryomin wrote: > Set CCACHE_DIR to $(TOPDIR)/.ccache and CCACHE_BASEDIR to $(TOPDIR). > This allows to do clean and dirclean. Cache hit rate for test build > after dirclean is ~65%. > If CCACHE is enabled stats are printed out at the end of building

Re: [OpenWrt-Devel] netifd: per-interface MTU settings vs per-route MTU settings?

2020-05-25 Thread Michael Jones
On Mon, May 25, 2020 at 8:00 AM Aleksander Morgado wrote: > Other protocol handlers, like uqmi, are also able to setup the MTU, > and instead of doing it via proto_send_update, they just do it like > this: > > [ -n "$mtu" ] && { > echo "Setting MTU to $mtu" >

Re: [OpenWrt-Devel] netifd: per-interface MTU settings vs per-route MTU settings?

2020-05-23 Thread Michael Jones
On Thu, May 21, 2020, 07:44 Aleksander Morgado wrote: > Hey! > > There's an ongoing discussion in the ModemManager package in github > related to how the MTU may be configured in the network interface > based on what the MM bearer object reports: >

Re: [OpenWrt-Devel] Experimental "release goals" for 19.07.4

2020-05-23 Thread Michael Jones
On Sat, May 23, 2020, 13:01 Baptiste Jonglez wrote: > If the initial concept looks good, we can think about automating some of > it: > tag bug reports on Flyspray/Github/Gitlab as blocking for a specific > release, use "milestones", automatically find commits that satisfy a goal, > etc. > I

Re: [OpenWrt-Devel] Ubus based service watchdog?

2020-05-15 Thread Michael Jones
On Thu, May 14, 2020 at 5:56 PM Wes Turner wrote: > FWIW, k8s has Liveness, Readiness and Startup Probes > > https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ > :: > > > The kubelet uses startup probes to know when a container application has >

Re: [OpenWrt-Devel] Ubus based service watchdog?

2020-05-15 Thread Michael Jones
On Fri, May 15, 2020 at 9:57 AM Henrique de Moraes Holschuh wrote: > On 15/05/2020 03:58, Petr Štetiar wrote: > > In other words I think, that one can solve this use case with current > > solutions, no need to bloat procd. > > And if you're going to bloat procd, it pays to look at what the >

Re: [OpenWrt-Devel] Ubus based service watchdog?

2020-05-15 Thread Michael Jones
On Fri, May 15, 2020 at 4:35 AM Petr Štetiar wrote: > Michael Jones [2020-05-15 02:39:52]: > > > What's wrong with monit is that it's documentation is gigantic > > Good documentation with a lot of examples is hardly a problem, its a bonus > point for me. > > I thin

Re: [OpenWrt-Devel] Ubus based service watchdog?

2020-05-15 Thread Michael Jones
On Fri, May 15, 2020 at 1:58 AM Petr Štetiar wrote: > Michael Jones [2020-05-13 12:48:49]: > > Hi, > > > I have a critical service on my OpenWRT system that needs monitoring and > > re-starting if it's failed. > > whats wrong with monit[1]? It was designed exactly

Re: [OpenWrt-Devel] Ubus based service watchdog?

2020-05-14 Thread Michael Jones
On Thu, May 14, 2020, 23:43 Philip Prindeville < philipp_s...@redfish-solutions.com> wrote: > > > On May 13, 2020, at 11:48 AM, Michael Jones > wrote: > > > > I have a critical service on my OpenWRT system that needs monitoring and > re-starting if it's

Re: [OpenWrt-Devel] Sysupgrade and Failed to kill all processes

2020-05-13 Thread Michael Jones
On Wed, May 13, 2020 at 6:29 PM Philip Prindeville < philipp_s...@redfish-solutions.com> wrote: > > My lights-out machine rooms all have a dialup line, a terminal server, and > a power strip where I can cycle outlets… because I don’t like driving 7 > hours each way for 1 hour of productive work.

Re: [OpenWrt-Devel] Sysupgrade and Failed to kill all processes

2020-05-13 Thread Michael Jones
> > How the entire upgrade process works would be a good subject for > documenting on the Wiki if it’s not already. > Feel free :-) > How long are you thinking this I/O will take to complete? > Longer than the blazing speed of /bin/sh looping over /proc/* (1) It shouldn’t be happening very

Re: [OpenWrt-Devel] Ubus based service watchdog?

2020-05-13 Thread Michael Jones
On Wed, May 13, 2020 at 1:53 PM Eric Romano wrote: > It does seem like process supervision would be a nice capability to > have within procd. > > Previously I've done this by a combination of: > 1. trying to crash / exit the process when an inconsistent state is hit. > 2. monitoring for delayed

Re: [OpenWrt-Devel] Sysupgrade and Failed to kill all processes

2020-05-13 Thread Michael Jones
On Wed, May 13, 2020 at 12:29 PM Michael Jones wrote: > > > On Wed, May 13, 2020 at 3:58 AM Jo-Philipp Wich wrote: > >> Hi, >> >> > Stuff like umounting external disks, fsync / swapoff etc. come to mind as >> well >> which should be doable at this

[OpenWrt-Devel] Ubus based service watchdog?

2020-05-13 Thread Michael Jones
I have a critical service on my OpenWRT system that needs monitoring and re-starting if it's failed. I've been looking for a mechanism in procd that would allow me to request that my service be terminated if it did not periodically notify some watchdog endpoint via ubus. It seems to me like this

Re: [OpenWrt-Devel] Sysupgrade and Failed to kill all processes

2020-05-13 Thread Michael Jones
On Wed, May 13, 2020 at 3:58 AM Jo-Philipp Wich wrote: > Hi, > > > > > That loop-kill-all thing should be a kind of last resort really, > what's > > actually needed is some kind of "init 1" procd equivalent which > shuts down all > > services in a more or less clean manner. > > > > >

Re: [OpenWrt-Devel] Sysupgrade and Failed to kill all processes

2020-05-13 Thread Michael Jones
On Wed, May 13, 2020 at 4:42 AM Kevin 'ldir' Darbyshire-Bryant < l...@darbyshire-bryant.me.uk> wrote: > > > > On 13 May 2020, at 09:57, Jo-Philipp Wich wrote: > > > > Hi, > > > >> > >>That loop-kill-all thing should be a kind of last resort really, > what's > >>actually needed is some

Re: [OpenWrt-Devel] Sysupgrade and Failed to kill all processes

2020-05-13 Thread Michael Jones
> That loop-kill-all thing should be a kind of last resort really, what's > actually needed is some kind of "init 1" procd equivalent which shuts down > all > services in a more or less clean manner. > > Oddly enough, the /lib/upgrade/stage2 script has some aspect of this. It explicitly shuts down

[OpenWrt-Devel] Sysupgrade and Failed to kill all processes

2020-05-12 Thread Michael Jones
I've been investigating a problem with sysupgrade failing with the error message "Failed to kill all processes", and then hanging indefinitely. This happens maybe once every 10-20 sysupgrades, and it's kind of a pain. So far I've determined this workflow that the sysupgrade command follows.

Re: [OpenWrt-Devel] Advice needed - Proper approach to port 5G/LTE modem into OpenWRT

2020-04-30 Thread Michael Jones
On Mon, Apr 27, 2020 at 9:45 PM Jeonghum Joh wrote: > Hello Michael, > > Thank you for sharing the helpful url. I guess mwan3[1] would deal such > daemons - netifd and hotplug.d. Isn't it? If mwan3 deals with those, I > guess I only need to utilize mwan3. Am I right? > > Thank you for answering

Re: [OpenWrt-Devel] [ModemManager] How can I make ModemManager work right?

2020-04-29 Thread Michael Jones
On Wed, Apr 29, 2020 at 1:30 AM Jeonghum Joh wrote: > Hello, > Thanks to many people in this list, I was able to find ModemManager and > I've tried applying it. > > Testing environment > > Target Model: MediaTek MT7622 AC4300rfb1 board > Firmware Version : LEDE Reboot

Re: [OpenWrt-Devel] Advice needed - Proper approach to port 5G/LTE modem into OpenWRT

2020-04-27 Thread Michael Jones
On Mon, Apr 27, 2020 at 7:42 AM Bjørn Mork wrote: > Jeonghum Joh writes: > > > I am porting a 5G/LTE modem into OpenWRT. > > Follow the instructions for LTE modems. A 5G modem is pretty much the > same wrt drivers and basic management. At least for Qualcomm based > modems on a USB bus. Have

Re: [OpenWrt-Devel] Jsonfilter, return partial subobject?

2020-04-24 Thread Michael Jones
On Thu, Apr 23, 2020 at 6:38 PM Michael Jones wrote: > > On Thu, Apr 23, 2020 at 3:50 PM Jo-Philipp Wich wrote: > >> Hi, >> >> > [...] >> > What I want to do is return a JSON string with this representation: >> > [

Re: [OpenWrt-Devel] Jsonfilter, return partial subobject?

2020-04-23 Thread Michael Jones
On Thu, Apr 23, 2020 at 3:50 PM Jo-Philipp Wich wrote: > Hi, > > > [...] > > What I want to do is return a JSON string with this representation: > > [ > > { "interface" : "lan", "uptime" : 1 }, > > ... > > ] > > > > E.g., I want to filter the json not down to a single value, but to a

Re: [OpenWrt-Devel] Jsonfilter, return partial subobject?

2020-04-23 Thread Michael Jones
On Thu, Apr 23, 2020 at 12:55 PM Michael Jones wrote: > I'm quite reluctant to do multiple processing sweeps. E.g. the following > (probably syntax-error-full, and erroneous output) shell script is > extremely unattractive > > json=`ubus call network.interface dump | jsonfilter

[OpenWrt-Devel] Jsonfilter, return partial subobject?

2020-04-23 Thread Michael Jones
I'm trying to work with the jsonfilter program included in the jsonpath project from Jo-Philipp (https://git.openwrt.org/?p=project/jsonpath.gi t) Perhaps this is a failure on my part to understand the documentation provided by this

Re: [OpenWrt-Devel] [PATCH] rpcd: fix respawn settings

2020-03-11 Thread Michael Jones
On Fri, Mar 6, 2020 at 1:19 AM Jo-Philipp Wich wrote: > Hi, > > > rpcd crashes for me daily, to the point where i have a script that > restarts it > > every 5 minutes. > > > > It also gets hung a lot without crashing, and stops serving responses to > ubus > > traffic. > > I've never heard about

Re: [OpenWrt-Devel] [PATCH] rpcd: fix respawn settings

2020-03-05 Thread Michael Jones
On Thu, Mar 5, 2020 at 1:41 PM Petr Štetiar wrote: > > > Mar 5, 2020 19:54:49 Michael Jones : > > > The flip side here is that rpcd likes to crash a lot. > > 0 (zero) bugs found https://bugs.openwrt.org/index.php?string=rpcd Saying there are zero bugs on a bug

Re: [OpenWrt-Devel] [PATCH] rpcd: fix respawn settings

2020-03-05 Thread Michael Jones
On Thu, Mar 5, 2020 at 5:35 AM Petr Štetiar wrote: > Karl Palsson [2020-03-05 11:18:02]: > > > > Commit 432ec292ccc8 ("rpcd: add respawn param") has introduced > > > infinite restarting of the service which could be reached over > > > network. > > > > Didn't we already decide that this wasn't

Re: [OpenWrt-Devel] [PATCH] ccache: update to 3.7.7

2020-01-16 Thread Michael Jones
On Thu, Jan 16, 2020 at 12:42 PM Hans Dedecker wrote: > On Thu, Jan 16, 2020 at 4:36 PM DENG Qingfang > wrote: > > > > Update ccache to 3.7.7 > > > > Release notes: > > https://ccache.dev/releasenotes.html#_ccache_3_7_7 > > > > Signed-off-by: DENG Qingfang > Patch applied, thx > > Hans > > ---

[OpenWrt-Devel] UBus wire protocol documentation

2019-12-07 Thread Michael Jones
I'm planning to implement a Ubus client using Boost.Asio / C++'s Networking TS, in C++, complete with a new implementation of the ubus wire protocol (in C++). Is there any documentation available about the Ubus wire protocol? ___ openwrt-devel mailing

Re: [OpenWrt-Devel] [PATCH v2 libubox 05/10] add assert.h component

2019-11-21 Thread Michael Jones
On Thu, Nov 21, 2019 at 12:17 AM Petr Štetiar wrote: > Michael Jones [2019-11-20 18:12:14]: > > > You may need #include_next, to avoid recursion. > > Is this some theoretical experience? Or you can provide me with some build > breakage? Just wondering, because #include

Re: [OpenWrt-Devel] [PATCH v2 libubox 05/10] add assert.h component

2019-11-20 Thread Michael Jones
You may need #include_next, to avoid recursion. On Wed, Nov 20, 2019, 15:45 Petr Štetiar wrote: > In order to allow seamless assert() usage in release builds without the > need for fiddling with CMake C flags as CMake adds -DNDEBUG switch in > release builds which disable assert(). > >

Re: [OpenWrt-Devel] [PATCH v2 1/1] rpcd: add respawn param

2019-11-11 Thread Michael Jones
On Sat, Nov 9, 2019 at 6:53 AM Hauke Mehrtens wrote: > On 11/7/19 2:31 PM, Florian Eckert wrote: > > The rpcd service is an important service, but if the service stops > > working for any reason, no one will ever respawn that service. With this > > commit, the procd service will monitor if the