Page MenuHomeFreeBSD

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

Authored by 0mp on Oct 29 2024, 1:01 PM.
Tags
Referenced Files
Unknown Object (File)
Sun, Dec 15, 5:46 PM
Unknown Object (File)
Mon, Dec 9, 5:26 AM
Unknown Object (File)
Tue, Dec 3, 8:03 AM
Unknown Object (File)
Nov 6 2024, 3:45 AM
Unknown Object (File)
Nov 6 2024, 1:52 AM
Unknown Object (File)
Nov 1 2024, 9:31 PM
Subscribers

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.Oct 29 2024, 1:01 PM
This revision is now accepted and ready to land.Oct 29 2024, 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).