Bug 122968 - [rc.d] /etc/rc.d/addswap: md swapfile multiplication after init 1
Summary: [rc.d] /etc/rc.d/addswap: md swapfile multiplication after init 1
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 2008-04-21 19:30 UTC by Paul B. Mahol
Modified: 2018-01-03 05:16 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Paul B. Mahol 2008-04-21 19:30:04 UTC
Having swapfile defined in rc.conf
will create duplication of memory disk device after executing init 1 as root
swapinfo will report md0 and md1 as swapdevices and top will report duplicated (2x) swap (impossiblie)

I did not look if other problems may arise when this error happen (swap was not used at all)


Before adding swapfile check if it already exist with mdconfig -l -u X
where X is mdX number of previous swapfile.
How-To-Repeat: create swapfile with dd (as explained in handbook) and add its full name in /etc/rc.conf

notice swapinfo and top output after executing # init 1
Comment 1 Jaakko Heinonen freebsd_committer 2010-07-05 19:11:13 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-rc

Comment 2 Chris Rees 2012-10-25 21:04:20 UTC
This is a problem indeed, and can easily be fixed with this hint from
the submitter.

While in this file, we can use REQUIRE in netif rather than BEFORE in addswap.

Would anyone care to approve?


Comment 3 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:59 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