Bug 190665 - service(8): [patch] fixes for asterisk output in /usr/sbin/service scripts when rc.d is empty
Summary: service(8): [patch] fixes for asterisk output in /usr/sbin/service scripts wh...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: Xin LI
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-05 19:34 UTC by Oleg Ginzburg
Modified: 2014-07-01 15:58 UTC (History)
1 user (show)

See Also:


Attachments
patch for /usr/src/usr.sbin/service/service.sh script (408 bytes, patch)
2014-06-05 19:34 UTC, Oleg Ginzburg
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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!