ref: a77fd25d909aade802f49d206d4822798c563efe
parent: 4ed03dff937d78f81be88b40cb4cb46372ba9344
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Nov 23 12:37:07 EST 2024
gefs: remove nokill code After discussion, it was suggested that it might make more sense to handle the noswap stuff outside of gefs, like with any other fileserver. plan9 file-servers are not privileged. one might even run them in a test script to mount an image.
--- a/rc/bin/cpurc
+++ b/rc/bin/cpurc
@@ -118,4 +118,4 @@
# mode of /proc/*/ctl is inherited across rfork, and sets modes on
# other /proc files, such as note, so let listen be killed.
-dontkill '^(9660srv|cfs|cs|cwfs.*|disk|dns|dossrv|ether|factotum|hjfs|ipconfig|kb|kfs|mntgen|paqfs|reboot|usbd|venti|wpa)$'
+dontkill '^(9660srv|cfs|cs|cwfs.*|disk|dns|dossrv|ether|factotum|gefs|hjfs|ipconfig|kb|kfs|mntgen|paqfs|reboot|usbd|venti|wpa)$'
--- a/rc/bin/termrc
+++ b/rc/bin/termrc
@@ -96,4 +96,4 @@
reform/audio
}
-dontkill '^(9660srv|cfs|cs|cwfs.*|disk|dns|dossrv|ether|factotum|hjfs|ipconfig|kb|kfs|mntgen|paqfs|reboot|usbd|venti|wpa)$'
+dontkill '^(9660srv|cfs|cs|cwfs.*|disk|dns|dossrv|ether|factotum|gefs|hjfs|ipconfig|kb|kfs|mntgen|paqfs|reboot|usbd|venti|wpa)$'
--- a/sys/src/cmd/gefs/main.c
+++ b/sys/src/cmd/gefs/main.c
@@ -47,23 +47,6 @@
t->v1 = v1;
}
-static void
-nokill(void)
-{
- char buf[128];
- int fd;
-
- snprint(buf, sizeof(buf), "/proc/%d/ctl", getpid());
- if((fd = open(buf, OWRITE)) == -1){
- fprint(2, "nokill: open %s: %r", buf);
- return;
- }
- if(fprint(fd, "noswap\n") == -1){
- fprint(2, "nokill: write %s: %r", buf);
- return;
- }
-}
-
static uvlong
memsize(void)
{
@@ -216,7 +199,6 @@
if (pid < 0)
sysfatal("can't fork: %r");
if (pid == 0) {
- nokill();
id = aincl(&fs->nworker, 1);
if((*errctx = mallocz(sizeof(Errctx), 1)) == nil)
sysfatal("malloc: %r");
@@ -408,7 +390,6 @@
}
rfork(RFNOTEG);
- nokill();
loadfs(dev);
fs->wrchan = mkchan(32);
fs->admchan = mkchan(32);
--
⑨