[PATCH v3] procd: add procd json output to init

Florian Eckert fe at dev.tdt.de
Thu Dec 17 04:34:25 EST 2020


Hello Petr

On 2020-12-17 10:12, Petr Štetiar wrote:
> Florian Eckert <fe at dev.tdt.de> [2020-12-17 09:40:08]:
>> With this change, the init script is now extend with the command to 
>> get
>> this information easier.
> 
> I still lack the information about your use case, how do you use this 
> output
> of this command.

Should I write this in the commit messsage?
If yes, then I will do that.
I just thought that this is clearly evident to simplify the input.
So that I do not always have to type the whole string.

> BTW it looks like you're doing something similar to what we're already 
> doing
> in the `status` command.

Yes, but that only returns `running`.
But I want to see more information.

> Maybe you just want to implement `status_verbose` (or such) command 
> with all
> the details you would like to get, but in human readable format?

The command `status_verbose` would be good as a command.
But the whole json is quit complex.
I do not think we could convert this to a non json output.

> I see the service command as CLI mainly for end users, so in my 
> oppinion it
> should provide human readable output.

I didn't realize it that way, that only human readable output are 
allowed.
The different service in the openwrt, which use the procd add also 
extra_commands.
I'm not sure if these are always human readable outputs.

>> +	json_init
>> +	json_add_string name "$service"
>> +	json_add_boolean verbose "1"
>> +	json_add_string name "$service"
> 
> Duplicate json_add_string line.

Damn, that slipped back in.
That's what happens when you don't update the thing right away!
My fault -> sorry

Best regards

Florian



More information about the openwrt-devel mailing list