Bug 190665

Summary: service(8): [patch] fixes for asterisk output in /usr/sbin/service scripts when rc.d is empty
Product: Base System Reporter: Oleg Ginzburg <olevole>
Component: confAssignee: Xin LI <delphij>
Status: Closed FIXED    
Severity: Affects Many People CC: delphij
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch for /usr/src/usr.sbin/service/service.sh script none

Description Oleg Ginzburg 2014-06-05 19:34:41 UTC
Created attachment 143413 [details]
patch for /usr/src/usr.sbin/service/service.sh script

Fixes for two micro issue:

1) Check for rc.d directory existence.
2) Fix for output * when rc.d is empty

Demo of current behavior:
----
% mv /usr/local/etc/rc.d /usr/local/etc/rc.d-temp
% service -l
cd: /usr/local/etc/rc.d: No such file or directory

% mkdir /usr/local/etc/rc.d
% service -l
zfs
zvol
*      << extra symbols

% rmdir /usr/local/etc/rc.d
% mv /usr/local/etc/rc.d-temp /usr/local/etc/rc.d
----
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2014-06-15 04:35:56 UTC
Improve Summary.
Comment 2 commit-hook freebsd_committer freebsd_triage 2014-06-15 05:07:10 UTC
A commit references this bug:

Author: delphij
Date: Sun Jun 15 05:07:01 UTC 2014
New revision: 267493
URL: http://svnweb.freebsd.org/changeset/base/267493

Log:
  Fix two issues:

   - Check for rc.d directory's existence before traversing
     it;
   - Don't output * when rc.d directory is empty.

  PR:		conf/190665
  Submitted by:	Oleg Ginzburg <olevole olevole ru> (with changes)
  MFC after:	2 weeks

Changes:
  head/usr.sbin/service/service.sh
Comment 3 Xin LI freebsd_committer freebsd_triage 2014-06-15 05:07:45 UTC
A slightly different fix have been committed as r267493.
Comment 4 commit-hook freebsd_committer freebsd_triage 2014-07-01 15:51:18 UTC
A commit references this bug:

Author: delphij
Date: Tue Jul  1 15:50:34 UTC 2014
New revision: 268098
URL: http://svnweb.freebsd.org/changeset/base/268098

Log:
  MFC r267493:

  Fix two issues:

   - Check for rc.d directory's existence before traversing
     it;
   - Don't output * when rc.d directory is empty.

  PR:		bin/190665
  Submitted by:	Oleg Ginzburg <olevole olevole ru> (with changes)

Changes:
_U  stable/10/
  stable/10/usr.sbin/service/service.sh
Comment 5 commit-hook freebsd_committer freebsd_triage 2014-07-01 15:52:19 UTC
A commit references this bug:

Author: delphij
Date: Tue Jul  1 15:51:20 UTC 2014
New revision: 268099
URL: http://svnweb.freebsd.org/changeset/base/268099

Log:
  MFC r267493:

  Fix two issues:

   - Check for rc.d directory's existence before traversing
     it;
   - Don't output * when rc.d directory is empty.

  PR:		bin/190665
  Submitted by:	Oleg Ginzburg <olevole olevole ru> (with changes)

Changes:
_U  stable/9/usr.sbin/service/
  stable/9/usr.sbin/service/service.sh
Comment 6 Xin LI freebsd_committer freebsd_triage 2014-07-01 15:58:51 UTC
Patch applied to stable/10 and stable/9.  Thanks for your submission!