Artix Linux Forum

Init systems => dinit => Topic started by: iacore on 08 March 2024, 13:29:03

Title: [bug report] cpupower-dinit missing true at the end
Post by: iacore on 08 March 2024, 13:29:03
> cat /usr/lib/dinit/cpupower
#!/bin/sh
[ -r /etc/default/cpupower ] && . /etc/default/cpupower

# CPU speed
[ "$governor" ] && cpupower frequency-set -g "$governor"
[ "$max_freq" ] && cpupower frequency-set -u "$max_freq"
[ "$min_freq" ] && cpupower frequency-set -d "$min_freq"
[ "$freq" ]     && cpupower frequency-set -f "$freq"

# CPU options
[ "$perf_bias" ]     && cpupower set -b "$perf_bias"
[ "$mc_scheduler" ]  && cpupower set -m "$mc_scheduler"
[ "$smp_scheduler" ] && cpupower set -s "$smp_scheduler"

true
Title: Re: [bug report] cpupower-dinit missing true at the end
Post by: iacore on 08 March 2024, 13:31:28
the patch

Code: [Select]
13a14,15
>
> true

why isn't there a way to send PR on gitea (or even register)?
Title: Re: [bug report] cpupower-dinit missing true at the end
Post by: konimex on 09 March 2024, 06:32:13
Since cpupower is scripted, I don't think true is necessary. Or you encountered an error while trying to run the script?
Title: Re: [bug report] cpupower-dinit missing true at the end
Post by: yellowbus on 14 June 2024, 17:23:57
Starting the service makes dinit believe that it failed even if everything went fine. The following is printed:

Code: [Select]
# dinitctl start cpupower
Service 'cpupower' failed to start.
Reason: service process terminated before ready: exited - status 1

And dinitctl list shows this line, indicating that something went wrong:

Code: [Select]
[     {X}] cpupower

This is misleading. Simply adding true on the last line solves the problem.
Title: Re: [bug report] cpupower-dinit missing true at the end
Post by: konimex on 15 June 2024, 04:30:15
Starting the service makes dinit believe that it failed even if everything went fine. The following is printed:

Code: [Select]
# dinitctl start cpupower
Service 'cpupower' failed to start.
Reason: service process terminated before ready: exited - status 1

And dinitctl list shows this line, indicating that something went wrong:

Code: [Select]
[     {X}] cpupower

This is misleading. Simply adding true on the last line solves the problem.

Please don't necropost in every single cpupower-dinit-related post. After seeing what happened here (https://forum.artixlinux.org/index.php/topic,6977.0.html) I decided to add exit 0.
Title: Re: [bug report] cpupower-dinit missing true at the end
Post by: yellowbus on 17 June 2024, 02:19:43
Sorry, you're right. Is there a way to delete my other replies, if it's okay? I didn't find the option.

Also thank you for the fix!
Title: Re: [bug report] cpupower-dinit missing true at the end
Post by: corysanin on 17 June 2024, 18:27:38
Is there a way to delete my other replies, if it's okay? I didn't find the option.

Leave them. In the future check post dates though.