History log of /src/usr.sbin/service |
Revision | Date | Author | Comments |
1.1 | 22-Mar-2015 |
ast | branches: 1.1.2; Import a substantially modified service(8) command from FreeBSD to manage rc.d scripts. This command is well known on most other Unixes and should help soften the learning curve for Unix admins coming to NetBSD.
|
1.1.2.2 | 21-Apr-2015 |
snj | Pull up following revision(s) (requested by ast in ticket #636): distrib/sets/lists/base/mi: revision 1.1098 distrib/sets/lists/man/mi: revision 1.1498 doc/CHANGES: patch usr.sbin/Makefile: revision 1.270 usr.sbin/service/Makefile: revision 1.1 usr.sbin/service/service: revision 1.1-1.7 usr.sbin/service/service.8: revisions 1.1-1.4 Import a substantially modified service(8) command from FreeBSD to manage rc.d scripts. This command is well known on most other Unixes and should help soften the learning curve for Unix admins coming to NetBSD. -- Make the usage appear more standard. -- Sort options. Use An -nosplit in AUTHORS section. -- Remove -f option as rc_fast is not set in invocation mode. Do the load_rc_config *after* option parsing. Catch conflicting -e + -l option specs. -- Integrate some feedback gleened from tech-userlevel@netbsd.org Avoid ls -P so that script can also run pre-netbsd-7. Make sure /etc/rc.conf.d configurations are supported. -- cosmetic change in man 8 service use shell quoting in a safe way as suggested by Alan Barrett -- More shell quoting. /etc/rc.d/* file names with embedded spaces are not expected to work, but let's quote them anyway.
|
1.1.2.1 | 22-Mar-2015 |
snj | file Makefile was added on branch netbsd-7 on 2015-04-21 05:22:58 +0000
|
1.10 | 26-Jul-2024 |
jakllsch | Fix missing whitespace in not found message.
From Daniel Cunha in PR 58471
|
1.9 | 14-Mar-2023 |
kre | branches: 1.9.2; Don't inappropriately use xargs to run rcorder -- xargs is designed to run the given command as many times as necessary, but rcorder must be run just once, with all the rc.d scripts as args. If that turns out to be too many (E2BIG on exec) then we have more serious problems, working around it by use of xargs just makes a mess (for rcorder).
Make the -e option cause the script to exit 0 if some enabled script was found, and 1 if not, so one can do: if service -e foobar >/dev/null then whatever we want to do when foobar is enabled else anything we want instead if it is not fi Someday perhaps add a -q to suppress the output instead of requiring the redirect, but that day is not this one. Make all error exit status codes be >1 (and use the standard 126 instead of 255, for "exec failed").
Note that with more than one service given with -e, or when none are (so all enabled scripts are listed) the exit status is 0 if any enabled script was found (ie: anything was printed to stdout), not if all named scripts exist and are enabled. Testing the status works best with just one script name given as an arg.
Correctly quote script names (and use eval where required) so scripts (or paths to scripts) containing spaces, tabs, or shell operator chars might be handled correctly (newlines in names will still cause failures.)
Treat rc.d scripts that do not have an rcvar (hence are always enabled) as enabled scripts, rather than disabled - but ignore the LOGIN DAEMON... pseudo-scripts.
While here, replace archaic uses of "test" ('[') (that is, -a etc) with standard defined usages only, replace a baroque use of sed with sh code (which is simpler and much faster, not that speed matters) - but do use sed instead of two grep invocations. Replace all uses of "echo" with "printf" (just "because"!) Make the usage more useful (explain what the various option combinations achieve, explicitly), and also while here, make the formatting look closer to something I can deal with (personally I prefer tab indents almost everywhere, but 4 space is OK...) Aligned runs of 8 spaces were all replaced by a tab. For the options, use sh boolean cmds (true|false), and simply run them, rather than making them be empty or set and using test -n, it is easier to follow (and a tiny fraction of a ns faster). Change a comment so what it says is relevant to the code that is present, rather than to the change (referring to code that used to be present) with which it was added.
Catch the manual page up with the minor parts of this intended to be visible to users (like the exit status change).
|
1.8 | 05-Jun-2017 |
sborrill | Only match first instance of name and rcvar in file.
|
1.7 | 05-Apr-2015 |
apb | branches: 1.7.2; 1.7.10; More shell quoting. /etc/rc.d/* file names with embedded spaces are not expected to work, but let's quote them anyway.
|
1.6 | 02-Apr-2015 |
ast | cosmetic change in man 8 service use shell quoting in a safe way as suggested by Alan Barrett
|
1.5 | 27-Mar-2015 |
ast | Integrate some feedback gleened from tech-userlevel@netbsd.org: Avoid ls -P so that script can also run pre-netbsd-7. Make sure /etc/rc.conf.d configurations are supported.
|
1.4 | 23-Mar-2015 |
ast | Remove -f option as rc_fast is not set in invocation mode. Do the load_rc_config *after* option parsing. Catch conflicting -e + -l option specs.
|
1.3 | 22-Mar-2015 |
wiz | Sort options in usage.
|
1.2 | 22-Mar-2015 |
ast | Make the usage appear more standard.
|
1.1 | 22-Mar-2015 |
ast | Import a substantially modified service(8) command from FreeBSD to manage rc.d scripts. This command is well known on most other Unixes and should help soften the learning curve for Unix admins coming to NetBSD.
|
1.7.10.1 | 06-Jun-2017 |
martin | Pull up following revision(s) (requested by sborrill in ticket #9): usr.sbin/service/service: revision 1.8 Only match first instance of name and rcvar in file.
|
1.7.2.3 | 08-Jul-2017 |
snj | Pull up following revision(s) (requested by sborrill in ticket #1427): usr.sbin/service/service: revision 1.8 Only match first instance of name and rcvar in file.
|
1.7.2.2 | 21-Apr-2015 |
snj | Pull up following revision(s) (requested by ast in ticket #636): distrib/sets/lists/base/mi: revision 1.1098 distrib/sets/lists/man/mi: revision 1.1498 doc/CHANGES: patch usr.sbin/Makefile: revision 1.270 usr.sbin/service/Makefile: revision 1.1 usr.sbin/service/service: revision 1.1-1.7 usr.sbin/service/service.8: revisions 1.1-1.4 Import a substantially modified service(8) command from FreeBSD to manage rc.d scripts. This command is well known on most other Unixes and should help soften the learning curve for Unix admins coming to NetBSD. -- Make the usage appear more standard. -- Sort options. Use An -nosplit in AUTHORS section. -- Remove -f option as rc_fast is not set in invocation mode. Do the load_rc_config *after* option parsing. Catch conflicting -e + -l option specs. -- Integrate some feedback gleened from tech-userlevel@netbsd.org Avoid ls -P so that script can also run pre-netbsd-7. Make sure /etc/rc.conf.d configurations are supported. -- cosmetic change in man 8 service use shell quoting in a safe way as suggested by Alan Barrett -- More shell quoting. /etc/rc.d/* file names with embedded spaces are not expected to work, but let's quote them anyway.
|
1.7.2.1 | 05-Apr-2015 |
snj | file service was added on branch netbsd-7 on 2015-04-21 05:22:58 +0000
|
1.9.2.1 | 02-Aug-2025 |
perseant | Sync with HEAD
|
1.6 | 14-Mar-2023 |
uwe | service(8): fix markup
|
1.5 | 14-Mar-2023 |
kre | Don't inappropriately use xargs to run rcorder -- xargs is designed to run the given command as many times as necessary, but rcorder must be run just once, with all the rc.d scripts as args. If that turns out to be too many (E2BIG on exec) then we have more serious problems, working around it by use of xargs just makes a mess (for rcorder).
Make the -e option cause the script to exit 0 if some enabled script was found, and 1 if not, so one can do: if service -e foobar >/dev/null then whatever we want to do when foobar is enabled else anything we want instead if it is not fi Someday perhaps add a -q to suppress the output instead of requiring the redirect, but that day is not this one. Make all error exit status codes be >1 (and use the standard 126 instead of 255, for "exec failed").
Note that with more than one service given with -e, or when none are (so all enabled scripts are listed) the exit status is 0 if any enabled script was found (ie: anything was printed to stdout), not if all named scripts exist and are enabled. Testing the status works best with just one script name given as an arg.
Correctly quote script names (and use eval where required) so scripts (or paths to scripts) containing spaces, tabs, or shell operator chars might be handled correctly (newlines in names will still cause failures.)
Treat rc.d scripts that do not have an rcvar (hence are always enabled) as enabled scripts, rather than disabled - but ignore the LOGIN DAEMON... pseudo-scripts.
While here, replace archaic uses of "test" ('[') (that is, -a etc) with standard defined usages only, replace a baroque use of sed with sh code (which is simpler and much faster, not that speed matters) - but do use sed instead of two grep invocations. Replace all uses of "echo" with "printf" (just "because"!) Make the usage more useful (explain what the various option combinations achieve, explicitly), and also while here, make the formatting look closer to something I can deal with (personally I prefer tab indents almost everywhere, but 4 space is OK...) Aligned runs of 8 spaces were all replaced by a tab. For the options, use sh boolean cmds (true|false), and simply run them, rather than making them be empty or set and using test -n, it is easier to follow (and a tiny fraction of a ns faster). Change a comment so what it says is relevant to the code that is present, rather than to the change (referring to code that used to be present) with which it was added.
Catch the manual page up with the minor parts of this intended to be visible to users (like the exit status change).
|
1.4 | 02-Apr-2015 |
ast | branches: 1.4.2; cosmetic change in man 8 service use shell quoting in a safe way as suggested by Alan Barrett
|
1.3 | 23-Mar-2015 |
ast | Remove -f option as rc_fast is not set in invocation mode. Do the load_rc_config *after* option parsing. Catch conflicting -e + -l option specs.
|
1.2 | 22-Mar-2015 |
wiz | Sort options. Use An -nosplit in AUTHORS section.
|
1.1 | 22-Mar-2015 |
ast | Import a substantially modified service(8) command from FreeBSD to manage rc.d scripts. This command is well known on most other Unixes and should help soften the learning curve for Unix admins coming to NetBSD.
|
1.4.2.2 | 21-Apr-2015 |
snj | Pull up following revision(s) (requested by ast in ticket #636): distrib/sets/lists/base/mi: revision 1.1098 distrib/sets/lists/man/mi: revision 1.1498 doc/CHANGES: patch usr.sbin/Makefile: revision 1.270 usr.sbin/service/Makefile: revision 1.1 usr.sbin/service/service: revision 1.1-1.7 usr.sbin/service/service.8: revisions 1.1-1.4 Import a substantially modified service(8) command from FreeBSD to manage rc.d scripts. This command is well known on most other Unixes and should help soften the learning curve for Unix admins coming to NetBSD. -- Make the usage appear more standard. -- Sort options. Use An -nosplit in AUTHORS section. -- Remove -f option as rc_fast is not set in invocation mode. Do the load_rc_config *after* option parsing. Catch conflicting -e + -l option specs. -- Integrate some feedback gleened from tech-userlevel@netbsd.org Avoid ls -P so that script can also run pre-netbsd-7. Make sure /etc/rc.conf.d configurations are supported. -- cosmetic change in man 8 service use shell quoting in a safe way as suggested by Alan Barrett -- More shell quoting. /etc/rc.d/* file names with embedded spaces are not expected to work, but let's quote them anyway.
|
1.4.2.1 | 02-Apr-2015 |
snj | file service.8 was added on branch netbsd-7 on 2015-04-21 05:22:58 +0000
|