Page MenuHomeFreeBSD

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

Authored by 0mp on Tue, Oct 29, 1:01 PM.

Details

Summary

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
MFC after: 2 weeks

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 60243
Build 57127: arc lint + arc unit

Event Timeline

0mp requested review of this revision.Tue, Oct 29, 1:01 PM
This revision is now accepted and ready to land.Tue, Oct 29, 3:19 PM

Seems sane enough. It's not something we use today, and I've verified that run_rc_command should do the right thing w/o side effects (although I'd think that the -z rc_arg test should be higher in that function to avoid pid file name eval, etc).