Reputation: 65
How to run the redis by script, instead of manual start using "redis-server" ...
Upvotes: 3
Views: 2708
Reputation: 14304
As described in Execute a Unix Command with Node.js:
var sys = require('util')
var exec = require('child_process').exec;
function puts(error, stdout, stderr) {
sys.puts(stdout)
}
exec("redis-server", puts);
Upvotes: 3
Reputation: 2611
I do not recommend that you do this over tcp. This is a big security hole that you are opening. There are plenty of tools for starting remote services over tcp. Just to name a couple on unix Plexus and even ssh.
What is the biz requirement for this?
@Dvir Volk recommended using the start script and setting up redis as a service.
Upvotes: 1