HomeFreeBSD

service(8): Allow for passing no arguments to the service script

Description

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

(cherry picked from commit 7ffedfe14ca85aa3474980092a732d4e49309c62)

Details

Provenance
sd@mostnet.ru <sd@mostnet.ru>Authored on May 9 2025, 2:48 PM
0mpCommitted on May 23 2025, 8:43 AM
Reviewer
bnovkov
Differential Revision
D47328: service(8): Allow for passing no arguments to the service script
Parents
rG5fa8cce7e949: newsyslog.conf.d/opensm.conf: remove leading blank line
Branches
Unknown
Tags
Unknown