Bug 122968

Summary: [rc.d] /etc/rc.d/addswap: md swapfile multiplication after init 1
Product: Base System Reporter: Paul B. Mahol <onemda>
Component: confAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

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