node.js - PM2 run task requiring 'sudo' -
i have task must run using sudo (sets listener on low port). there way specify in pm2 json start file declaration?
i did research after vexii's comment , found 1 way access privileged ports works me. on unbuntu system,
sudo apt-get install libcap2
then arrange setcap run before node started. in case put following in rc.local, run .bashrc or .profile in user account adding 'sudo' comand.
setcap "cap_net_bind_service=+ep" /usr/bin/nodejs
what allow program run node access privileged port on system.
i'd finer grained solution got me going.
Comments
Post a Comment