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

Michael Jones mike at meshplusplus.com
Wed Jun 3 19:53:13 EDT 2020


On Wed, Jun 3, 2020 at 6:21 PM Stan Grishin <stangri at melmac.net> 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 users troubleshoot.
>
> An alternative to list-enabled/list-disabled that I have considered
> was to output the enabled status of available services below the usage
> output, ie replace:
>                 if [ -n "$1" ]; then
>                         echo "service "'"'"$1"'"'" not found, the
> following services are available:"
>                     ls "/etc/init.d"
>                 fi
>
> with
>
>                 if [ -n "$1" ]; then
>                         echo "service "'"'"$1"'"'" not found, the
> following services are available:"
>                     for F in /etc/init.d/* ; do
>                         $F enabled && echo "$F (autostart enabled)" ||
> echo "$F (autostart **disabled**)"
>                     done;
>                 fi
>
>
> Please elaborate on the list-start and list-stop question, I'm not
> sure I understand the purpose of those.
>

Originally I asked that question because I misunderstood what the goal of
this change was.

I thought that you were proposing to add the ability to enable / disable
multiple services at the same time, so I was asking about the ability to
start / stop multiple services at the same time.

It's clear not that's not what you were trying to propose.

So instead, what about listing the services that are running, and also
listing the services that are configured, but not running?

I don't know that that provides a lot of value, so it may not be worth
doing.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20200603/475e8f9b/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list