Date: Tue, 8 Jan 2013 20:19:28 -0500 (EST) From: Rick Macklem <rmacklem@uoguelph.ca> To: Jason Keltz <jas@cse.yorku.ca> Cc: FreeBSD Filesystems <freebsd-fs@freebsd.org> Subject: Re: Problems Re-Starting mountd Message-ID: <2094136156.1801692.1357694368838.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <1855706034.1801685.1357694364311.JavaMail.root@erie.cs.uoguelph.ca>
next in thread | previous in thread | raw e-mail | index | archive | help
------=_Part_1801691_315852099.1357694368836 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit You could test the attached patch, which I think makes mountd load new export entries from a file called /etc/exports.new without deleting the exports already in place, when sent a USR1 signal. After applying the patch to mountd.c, rebuilding and replacing it, you would: - put new entries for file systems not yet exported in both /etc/exports and /etc/exports.new # kill -USR1 <mountd's pid> - delete /etc/exports.new Don't send HUP to mountd for this case. Very lightly tested, rick ps: Sometimes it's faster to just code this stuff instead of discussing if/how it can be done;-) pss: This patch isn't ready for head. If it is useful, it might make sense to add a new mountd option that specifies the name of the file (/etc/exports.new or ...), so that this capability isn't enabled by default. ------=_Part_1801691_315852099.1357694368836 Content-Type: text/x-patch; name=newexports.patch Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=newexports.patch LS0tIHVzci5zYmluL21vdW50ZC9tb3VudGQuYy5zYXZuZXcJMjAxMy0wMS0wOCAxOTozMjo0Ni4w MDAwMDAwMDAgLTA1MDAKKysrIHVzci5zYmluL21vdW50ZC9tb3VudGQuYwkyMDEzLTAxLTA4IDE5 OjU0OjUxLjAwMDAwMDAwMCAtMDUwMApAQCAtMTkwLDYgKzE5MCw3IEBAIHZvaWQJZnJlZV9leHAo c3RydWN0IGV4cG9ydGxpc3QgKik7CiB2b2lkCWZyZWVfZ3JwKHN0cnVjdCBncm91cGxpc3QgKik7 CiB2b2lkCWZyZWVfaG9zdChzdHJ1Y3QgaG9zdGxpc3QgKik7CiB2b2lkCWdldF9leHBvcnRsaXN0 KHZvaW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G9nKExPR19XQVJOSU5HLCAiY2FuJ3Qgb3BlbiAlcyIsIG5ld19leG5hbWUpOworCisJ LyogUmVzdW1lIHRoZSBuZnNkLiBJZiB0aGV5IHdlcmVuJ3Qgc3VzcGVuZGVkLCB0aGlzIGlzIGhh cm1sZXNzLiAqLworCSh2b2lkKW5mc3N2YyhORlNTVkNfUkVTVU1FTkZTRCwgTlVMTCk7Cit9CisK Ky8qCiAgKiBBbGxvY2F0ZSBhbiBleHBvcnQgbGlzdCBlbGVtZW50CiAgKi8KIHN0cnVjdCBleHBv cnRsaXN0ICoKQEAgLTMyMTIsNiArMzI0OSwxMiBAQCBodXBoYW5kbGVyKGludCBzaWcgX191bnVz ZWQpCiAJZ290X3NpZ2h1cCA9IDE7CiB9CiAKK3ZvaWQKK3VzcjFoYW5kbGVyKGludCBzaWcgX191 bnVzZWQpCit7CisJZ290X3NpZ3VzcjEgPSAxOworfQorCiB2b2lkIHRlcm1pbmF0ZShpbnQgc2ln IF9fdW51c2VkKQogewogCXBpZGZpbGVfcmVtb3ZlKHBmaCk7Cg== ------=_Part_1801691_315852099.1357694368836--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2094136156.1801692.1357694368838.JavaMail.root>