From a77fd25d909aade802f49d206d4822798c563efe Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sat, 23 Nov 2024 17:37:07 +0000 Subject: [PATCH] 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. --- rc/bin/cpurc | 2 +- rc/bin/termrc | 2 +- sys/src/cmd/gefs/main.c | 19 ------------------- 3 files changed, 2 insertions(+), 21 deletions(-) diff --git a/rc/bin/cpurc b/rc/bin/cpurc index 5719e24eb..bb266cd41 100755 --- a/rc/bin/cpurc +++ b/rc/bin/cpurc @@ -118,4 +118,4 @@ if(test -e /cfg/$sysname/cpustart) # 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)$' diff --git a/rc/bin/termrc b/rc/bin/termrc index f9dc81b10..2505ab0d8 100755 --- a/rc/bin/termrc +++ b/rc/bin/termrc @@ -96,4 +96,4 @@ if(~ $terminal *reform*){ 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)$' diff --git a/sys/src/cmd/gefs/main.c b/sys/src/cmd/gefs/main.c index ac0f9192c..ecec24885 100644 --- a/sys/src/cmd/gefs/main.c +++ b/sys/src/cmd/gefs/main.c @@ -47,23 +47,6 @@ _trace(char *msg, Bptr bp, vlong v0, vlong v1) 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 @@ launch(void (*f)(int, void *), void *arg, char *text) 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 @@ main(int argc, char **argv) } rfork(RFNOTEG); - nokill(); loadfs(dev); fs->wrchan = mkchan(32); fs->admchan = mkchan(32);