Service values are translated (so you can't use them in scripts)

Bug #1941926 reported by Ted Gould
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snappy
Won't Fix
Medium
Unassigned

Bug Description

https://github.com/snapcore/snapd/blob/master/cmd/snap/cmd_services.go#L140

The values that are put into the table of the service command are translated. This makes it so that having a script that checks for "active" is unreliable.

I understand if this is considered a "human" command, but there are no other machine commands that are available to get this data.

Revision history for this message
Paweł Stołowski (stolowski) wrote :

Hi Ted :), thanks for reporting. I think I agree with you on that, and that would match systemctl behavior (also, we are not super consistent in that regard and many commands don't use translated strings); OTOH we generally encourage one to use snapd's REST API (added benefit is API stability, whereas the output of commands might change).

I'll see what I can do about it.

Changed in snappy:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Paweł Stołowski (stolowski) wrote :

PR is here: https://github.com/snapcore/snapd/pull/10750 but it seems opinions about that vary.

Changed in snappy:
status: Triaged → In Progress
Revision history for this message
Samuele Pedroni (pedronis) wrote :

the suggestion from he PR is to use the LC_* variables to force the C locale instead in the script

Changed in snappy:
status: In Progress → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.