Created attachment 224157 [details] patch Current service(8) shows help message when running script without arguments (e.g. service motd). At the same time rc.d scripts allow no arguments and show script usage and their commands: # /etc/rc.d/motd Usage: /etc/rc.d/motd [fast|force|one|quiet](start|stop|restart|rcvar|enable|disable|delete|enabled|describe|extracommands) It's quite useful when you want to see possible arguments for some service.
That's a neat idea. I don't see any problems with this change.
Yes please. This is a welcome change.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=7ffedfe14ca85aa3474980092a732d4e49309c62 commit 7ffedfe14ca85aa3474980092a732d4e49309c62 Author: sd@mostnet.ru <sd@mostnet.ru> AuthorDate: 2025-05-09 14:48:27 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-05-09 14:56:58 +0000 service(8): Allow for passing no arguments to the service script Currently, service(8) requires the user to provide a command to the rc service script. For example, service cron does not even run the cron rc service script but instead shows the usage message of service(8). This patch makes it so running the rc service script with no arguments via service(8) is closer to running the rc service script directly (e.g., /etc/rc.d/cron). Long story short, for most of the rc service scripts this change means that running "service FOO" now shows the usage message of FOO instead of the usage message of service(8). PR: 255115 Reviewed by: bnovkov, christos, imp, lme, markj Approved by: bnovkov (mentor), christos (mentor), markj (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D47328 usr.sbin/service/service.8 | 4 ++-- usr.sbin/service/service.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
Thanks!