-
-
Save Ferada/19a624abc4605d3fa3b3ef4d6438147a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
group gotools { | |
perm { | |
admin { | |
uid = UID; | |
gid = UID; | |
} | |
task { | |
uid = UID; | |
gid = UID; | |
} | |
} | |
cpu { | |
cpu.shares = 256; | |
} | |
memory { | |
# limit to 6GB | |
memory.limit_in_bytes = 6442450944; | |
} | |
} | |
~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cgexec \ | |
-g memory,cpu:gotools \ | |
$GOPATH/bin/gopls.real "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo apt install cgroup-tools | |
$ mv cgconfig.conf /etc/cgconfig.conf | |
$ sed -i -e 's|UID|$(id -u)|' /etc/cgconfig.conf | |
$ sudo cgconfigparser -l /etc/cgconfig.conf | |
$ mv $GOPATH/bin/gopls $GOPATH/bin/gopls.real | |
$ ln -sf /path/to/gopls.bash $GOPATH/bin/gopls |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment