On Wed, Jun 3, 2020 at 4:53 PM Michael Jones <m...@meshplusplus.com> wrote: > > > > On Wed, Jun 3, 2020 at 6:21 PM Stan Grishin <stan...@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?
Is there an easy universal way to determine if the service is running? > I don't know that that provides a lot of value, so it may not be worth doing. If there's a one/two liner to figure out if a service is running or not, it may be better to implement `service list` which would print the table of available init scripts, wherever they are enabled or not and wherever they are running or not. If that is deemed to be a better approach I can resubmit the patch. _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel