Bug 190200 - mdconfig unit name handling in rc
Summary: mdconfig unit name handling in rc
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 2014-05-25 11:20 UTC by kcwu
Modified: 2017-12-31 22:24 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description kcwu 2014-05-25 11:20:00 UTC
/etc/rc.d/mdconfig supports mdconfig unit name detection.

(line 194)
if [ -z "${_mdconfig_list}" ]; then
        for _mdconfig_config in `list_vars mdconfig_md[0-9]\* |

However, it treats all md[0-9]* as mdconfig unit even for extra parameters.
For example, "mdconfig_md0_perms" will be recognized as unit "md0_perms".

This will produce error messages during boot. But seems harmless.

How-To-Repeat: mdconfig_md0="-t swap -s 512m"

Following is boot error message:

Creating md0 device (swap).
Mounting /dev/md0.
Creating md0_perms device (1777).
usage: mdconfig -a -t type [-n] [-o [no]option] ... [-f file]
                [-s size] [-S sectorsize] [-u unit]
                [-x sectors/track] [-y heads/cylinder]
       mdconfig -d -u unit [-o [no]force]
       mdconfig -r -u unit -s size [-o [no]force]
       mdconfig -l [-v] [-n] [-f file] [-u unit]
       mdconfig file
           type = {malloc, vnode, swap}
           option = {cluster, compress, reserve}
           size = %d (512 byte blocks), %db (B),
                  %dk (kB), %dm (MB), %dg (GB) or
                  %dt (TB)
Creating md0_perms device failed, moving on.
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:00:47 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped