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

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -