FreeBSD Bugzilla – Attachment 240345 Details for
Bug 269782
service(8) Give service a quiet option
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch file for shell script and man page
service.patch (text/plain), 2.72 KB, created by
Dan Mahoney
on 2023-02-23 14:49:58 UTC
(
hide
)
Description:
patch file for shell script and man page
Filename:
MIME Type:
Creator:
Dan Mahoney
Created:
2023-02-23 14:49:58 UTC
Size:
2.72 KB
patch
obsolete
>diff -u service/service.8 service.new/service.8 >--- service/service.8 2021-04-09 00:24:13.000000000 +0000 >+++ service.new/service.8 2023-02-23 14:35:34.491953000 +0000 >@@ -47,6 +47,7 @@ > .Fl r > .Nm > .Op Fl j Ar jail >+.Op Fl q > .Op Fl v > .Ar script > .Ar command >@@ -102,6 +103,8 @@ > above, but list all of the files, not just what is enabled. > .It Fl v > Be slightly more verbose. >+.It Fl v >+Be quiet, redirecting output to /dev/null. > .El > .Sh ENVIRONMENT > When used to run rc.d scripts the >Only in service.new: service.patch >diff -u service/service.sh service.new/service.sh >--- service/service.sh 2021-04-09 00:24:13.000000000 +0000 >+++ service.new/service.sh 2023-02-23 14:42:02.506936000 +0000 >@@ -45,16 +45,18 @@ > echo "-R Stop and start enabled $local_startup services" > echo "-l List all scripts in /etc/rc.d and $local_startup" > echo '-r Show the results of boot time rcorder' >+ echo '-q quiet' > echo '-v Verbose' > echo '' > } > >-while getopts 'j:ehlrRv' COMMAND_LINE_ARGUMENT ; do >+while getopts 'j:ehlqrRv' COMMAND_LINE_ARGUMENT ; do > case "${COMMAND_LINE_ARGUMENT}" in > j) JAIL="${OPTARG}" ;; > e) ENABLED=eopt ;; > h) usage ; exit 0 ;; > l) LIST=lopt ;; >+ q) QUIET=qopt ;; > r) RCORDER=ropt ;; > R) RESTART=Ropt ;; > v) VERBOSE=vopt ;; >@@ -69,6 +71,7 @@ > args="" > [ -n "${ENABLED}" ] && args="${args} -e" > [ -n "${LIST}" ] && args="${args} -l" >+ [ -n "${QUIET}" ] && args="${args} -q" > [ -n "${RCORDER}" ] && args="${args} -r" > [ -n "${RESTART}" ] && args="${args} -R" > [ -n "${VERBOSE}" ] && args="${args} -v" >@@ -94,14 +97,22 @@ > if [ -n "$rcvar" ]; then > load_rc_config_var ${name} ${rcvar} > fi >- checkyesno $rcvar 2>/dev/null && run_rc_script ${file} stop >+ if [ -n "$QUIET" ]; then >+ checkyesno $rcvar 2>/dev/null && run_rc_script ${file} stop >/dev/null 2>&1 >+ else >+ checkyesno $rcvar 2>/dev/null && run_rc_script ${file} stop >+ fi > fi > done > for file in $files; do > if grep -q ^rcvar $file; then > eval `grep ^name= $file` > eval `grep ^rcvar $file` >- checkyesno $rcvar 2>/dev/null && run_rc_script ${file} start >+ if [ -n "$QUIET" ]; then >+ checkyesno $rcvar 2>/dev/null && run_rc_script ${file} start >/dev/null 2>&1 >+ else >+ checkyesno $rcvar 2>/dev/null && run_rc_script ${file} start >+ fi > fi > done > >@@ -165,7 +176,11 @@ > for dir in /etc/rc.d $local_startup; do > if [ -x "$dir/$script" ]; then > [ -n "$VERBOSE" ] && echo "$script is located in $dir" >- exec env -i -L -/daemon HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin "$dir/$script" "$@" >+ if [ -n "$QUIET" ]; then >+ exec env -i -L -/daemon HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin "$dir/$script" "$@" > /dev/null 2>&1 >+ else >+ exec env -i -L -/daemon HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin "$dir/$script" "$@" >+ fi > fi > done >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 269782
: 240345