I want to increase the --stack-size option for nodejs system-wide.
I know I can do this on a per invocation basis like this:
node --stack-size=10000 <app>
But I want to set the stack size system wide to this value for all users and for cron tasks.
I'm on Ubuntu 13.
You can:
Rename /usr/bin/node (or whatever you actual path to node is) to /usr/bin/node_bin
Create shell script in place of old node executable (at /usr/bin/node) with following content:
#!/bin/bash /usr/bin/node_bin --stack-size=10000 $@
This way you don't have to change absolute references to node in all the cron scripts.
To iterate on https://stackoverflow.com/users/8109341/daniel 's answer:
On Ubuntu, I had to wrap $@ in double quotes: "$@", otherwise passing arguments would break:
E.g.:
Running npx ganache-cli -m "strike artwork yard vault enhance despair online sock feed cactus subject rebela" -i 15
Would have process.argv evaluated to:
[ '/usr/bin/node_bin',
'/home/daniel/repos/aragon/aragen/node_modules/.bin/ganache-cli',
'-m',
'strike',
'artwork',
'yard',
'vault',
'enhance',
'despair',
'online',
'sock',
'feed',
'cactus',
'subject',
'rebel',
'-i',
'15']
instead of:
[ '/usr/bin/node_bin',
'/home/daniel/repos/aragon/aragen/node_modules/.bin/ganache-cli',
'-m',
'strike artwork yard vault enhance despair online sock feed cactus subject rebel',
'-i',
'15']
sudo mv /usr/bin/node /usr/bin/node_bincat << EOF | sudo tee /usr/bin/node
#!/bin/bash
/usr/bin/node_bin --stack-size=4096 "\$@"
EOF
sudo chmod +x nodeIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With