[root@etone46 backups]# node 1.js
child_process.js:790
throw errnoException(errno, 'spawn');
^
Error: spawn EINVAL
at errnoException (child_process.js:838:11)
at ChildProcess.spawn (child_process.js:790:11)
at exports.spawn (child_process.js:614:9)
at Object.<anonymous> (/opt/backups/1.js:3:14)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:492:10)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
var util = require('util'),
spawn = require('child_process').spawn,
ls = spawn('ls', ['-lh', '/usr']);
ls.stdout.on('data', function (data) {
console.log('stdout: ' + data);
});
ls.stderr.on('data', function (data) {
console.log('stderr: ' + data);
});
ls.on('exit', function (code) {
console.log('child process exited with code ' + code);
});
[root@etone46 backups]# strace -e \!mmap,munmap,mprotect,futex node 1.jsexecve("/usr/local/bin/node", ["node", "1.js"], [/* 30 vars */]) = 0brk(0) = 0x4e55000uname({sys="Linux", node="etone46", ...}) = 0access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)open("/etc/ld.so.cache", O_RDONLY) = 3fstat(3, {st_mode=S_IFREG|0644, st_size=132373, ...}) = 0close(3) = 0open("/lib64/librt.so.1", O_RDONLY) = 3read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\"\300\f7\0\0\0"..., 832) = 832fstat(3, {st_mode=S_IFREG|0755, st_size=53480, ...}) = 0close(3) = 0open("/lib64/libdl.so.2", O_RDONLY) = 3read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \16\300\0077\0\0\0"..., 832) = 832fstat(3, {st_mode=S_IFREG|0755, st_size=23520, ...}) = 0close(3) = 0open("/usr/lib64/libstdc++.so.6", O_RDONLY) = 3read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\363\4\r7\0\0\0"..., 832) = 832fstat(3, {st_mode=S_IFREG|0755, st_size=976312, ...}) = 0close(3) = 0open("/lib64/libm.so.6", O_RDONLY) = 3read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200>\200\0077\0\0\0"..., 832) = 832fstat(3, {st_mode=S_IFREG|0755, st_size=615136, ...}) = 0close(3) = 0open("/lib64/libgcc_s.so.1", O_RDONLY) = 3read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\36\0\f7\0\0\0"..., 832) = 832fstat(3, {st_mode=S_IFREG|0755, st_size=58400, ...}) = 0close(3) = 0open("/lib64/libpthread.so.0", O_RDONLY) = 3read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 W\0\0107\0\0\0"..., 832) = 832fstat(3, {st_mode=S_IFREG|0755, st_size=141336, ...}) = 0close(3) = 0open("/lib64/libc.so.6", O_RDONLY) = 3read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\331A\0077\0\0\0"..., 832) = 832fstat(3, {st_mode=S_IFREG|0755, st_size=1687464, ...}) = 0close(3) = 0arch_prctl(ARCH_SET_FS, 0x2aaaaaad0830) = 0set_tid_address(0x2aaaaaad08c0) = 12792set_robust_list(0x2aaaaaad08d0, 0x18) = 0rt_sigaction(SIGRTMIN, {0x3708005350, [], SA_RESTORER|SA_SIGINFO, 0x370800de60}, NULL, 8) = 0rt_sigaction(SIGRT_1, {0x37080052a0, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x370800de60}, NULL, 8) = 0rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0getrlimit(RLIMIT_STACK, {rlim_cur=10240*1024, rlim_max=RLIM_INFINITY}) = 0brk(0) = 0x4e55000brk(0x4e76000) = 0x4e76000getrlimit(RLIMIT_DATA, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0clock_gettime(0x7 /* CLOCK_??? */, 0x7fff05f13600) = -1 EINVAL (Invalid argument)clock_getres(0xfffffffa /* CLOCK_??? */, NULL) = 0clock_gettime(CLOCK_MONOTONIC, {94647, 470339454}) = 0fcntl(0, F_SETFD, FD_CLOEXEC) = 0fcntl(1, F_SETFD, FD_CLOEXEC) = 0fcntl(2, F_SETFD, FD_CLOEXEC) = 0fcntl(3, F_SETFD, FD_CLOEXEC) = -1 EBADF (Bad file descriptor)fcntl(4, F_SETFD, FD_CLOEXEC) = -1 EBADF (Bad file descriptor)fcntl(5, F_SETFD, FD_CLOEXEC) = -1 EBADF (Bad file descriptor)fcntl(6, F_SETFD, FD_CLOEXEC) = -1 EBADF (Bad file descriptor)fcntl(7, F_SETFD, FD_CLOEXEC) = -1 EBADF (Bad file descriptor)fcntl(8, F_SETFD, FD_CLOEXEC) = -1 EBADF (Bad file descriptor)fcntl(9, F_SETFD, FD_CLOEXEC) = -1 EBADF (Bad file descriptor)fcntl(10, F_SETFD, FD_CLOEXEC) = -1 EBADF (Bad file descriptor)fcntl(11, F_SETFD, FD_CLOEXEC) = -1 EBADF (Bad file descriptor)fcntl(12, F_SETFD, FD_CLOEXEC) = -1 EBADF (Bad file descriptor)fcntl(13, F_SETFD, FD_CLOEXEC) = -1 EBADF (Bad file descriptor)fcntl(14, F_SETFD, FD_CLOEXEC) = -1 EBADF (Bad file descriptor)fcntl(15, F_SETFD, FD_CLOEXEC) = -1 EBADF (Bad file descriptor)fcntl(16, F_SETFD, FD_CLOEXEC) = -1 EBADF (Bad file descriptor)rt_sigaction(SIGPIPE, {SIG_IGN}, NULL, 8) = 0rt_sigaction(SIGINT, {0x5869f0, ~[RTMIN RT_1], SA_RESTORER, 0x370800de60}, NULL, 8) = 0rt_sigaction(SIGTERM, {0x5869f0, ~[RTMIN RT_1], SA_RESTORER, 0x370800de60}, NULL, 8) = 0clock_gettime(CLOCK_MONOTONIC, {94647, 471379454}) = 0clock_gettime(CLOCK_MONOTONIC, {94647, 471436454}) = 0getuid() = 0geteuid() = 0getgid() = 0getegid() = 0gettimeofday({1345025503, 426708}, NULL) = 0clock_gettime(CLOCK_MONOTONIC, {94647, 471712454}) = 0epoll_create(256) = 3fcntl(3, F_SETFD, FD_CLOEXEC) = 0pipe([4, 5]) = 0fcntl(4, F_SETFD, FD_CLOEXEC) = 0fcntl(4, F_SETFL, O_RDONLY|O_NONBLOCK) = 0fcntl(5, F_SETFD, FD_CLOEXEC) = 0fcntl(5, F_SETFL, O_RDONLY|O_NONBLOCK) = 0rt_sigaction(SIGCHLD, {0x5da980, ~[RTMIN RT_1], SA_RESTORER|SA_RESTART, 0x370800de60}, NULL, 8) = 0rt_sigaction(SIGUSR1, {0x586720, ~[RTMIN RT_1], SA_RESTORER, 0x370800de60}, NULL, 8) = 0gettimeofday({1345025503, 427340}, NULL) = 0brk(0x4e9d000) = 0x4e9d000gettid() = 12792brk(0x4ec2000) = 0x4ec2000clone(child_stack=0x40010230, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x400109d0, tls=0x40010940, child_tidptr=0x400109d0) = 12793gettimeofday({1345025503, 431639}, NULL) = 0readlink("/proc/self/exe", "/usr/local/bin/node", 8191) = 19brk(0x4f03000) = 0x4f03000brk(0x4ed2000) = 0x4ed2000brk(0x4f03000) = 0x4f03000brk(0x4f43000) = 0x4f43000brk(0x4ed2000) = 0x4ed2000brk(0x4f03000) = 0x4f03000getcwd("/opt/backups", 4096) = 13getcwd("/opt/backups", 4096) = 13clock_gettime(CLOCK_MONOTONIC, {94647, 499888454}) = 0brk(0x4f43000) = 0x4f43000brk(0x4fc4000) = 0x4fc4000brk(0x4ed2000) = 0x4ed2000syscall_293(0xe024f8, 0x80800, 0x4ea9c70, 0, 0x7fff05f12ce6, 0x12, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8) = 0x125syscall_293(0xe024f8, 0x80800, 0xffffffffffffffff, 0x7fff05f12ce6, 0x12, 0x12, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8, 0x4e563d8) = 0x125stat("/opt/backups/1.js", {st_mode=S_IFREG|0644, st_size=370, ...}) = 0gettimeofday({1345025503, 465698}, NULL) = 0gettimeofday({1345025503, 465826}, NULL) = 0gettimeofday({1345025503, 465900}, NULL) = 0lstat("/opt", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0gettimeofday({1345025503, 466561}, NULL) = 0gettimeofday({1345025503, 466617}, NULL) = 0gettimeofday({1345025503, 466673}, NULL) = 0lstat("/opt/backups", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0gettimeofday({1345025503, 466887}, NULL) = 0gettimeofday({1345025503, 466943}, NULL) = 0gettimeofday({1345025503, 466998}, NULL) = 0lstat("/opt/backups/1.js", {st_mode=S_IFREG|0644, st_size=370, ...}) = 0gettimeofday({1345025503, 467179}, NULL) = 0gettimeofday({1345025503, 467235}, NULL) = 0gettimeofday({1345025503, 467290}, NULL) = 0open("/opt/backups/1.js", O_RDONLY) = 6fcntl(6, F_SETFD, FD_CLOEXEC) = 0fstat(6, {st_mode=S_IFREG|0644, st_size=370, ...}) = 0gettimeofday({1345025503, 468151}, NULL) = 0gettimeofday({1345025503, 468208}, NULL) = 0gettimeofday({1345025503, 468264}, NULL) = 0read(6, "var util = require(\'util\'),\n "..., 370) = 370close(6) = 0brk(0x4f03000) = 0x4f03000brk(0x4f44000) = 0x4f44000brk(0x4f85000) = 0x4f85000socketpair(PF_FILE, 0x80001 /* SOCK_??? */, 0, 0x4e9a290) = -1 EINVAL (Invalid argument)socketpair(PF_FILE, SOCK_STREAM, 0, [6, 7]) = 0fcntl(6, F_SETFD, FD_CLOEXEC) = 0fcntl(7, F_SETFD, FD_CLOEXEC) = 0socketpair(PF_FILE, 0x80001 /* SOCK_??? */, 0, 0x4e9a298) = -1 EINVAL (Invalid argument)socketpair(PF_FILE, SOCK_STREAM, 0, [8, 9]) = 0fcntl(8, F_SETFD, FD_CLOEXEC) = 0fcntl(9, F_SETFD, FD_CLOEXEC) = 0socketpair(PF_FILE, 0x80001 /* SOCK_??? */, 0, 0x4e9a2a0) = -1 EINVAL (Invalid argument)socketpair(PF_FILE, SOCK_STREAM, 0, [10, 11]) = 0fcntl(10, F_SETFD, FD_CLOEXEC) = 0fcntl(11, F_SETFD, FD_CLOEXEC) = 0syscall_293(0x7fff05f12c80, 0x80800, 0xffffffffffffffff, 0x7fff05f12bb0, 0x1, 0x2, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3) = 0x125close(6) = 0close(7) = 0close(8) = 0close(9) = 0close(10) = 0close(11) = 0close(4294967295) = -1 EBADF (Bad file descriptor)close(4294967295) = -1 EBADF (Bad file descriptor)close(4294967295) = -1 EBADF (Bad file descriptor)write(2, "\n", 1) = 1write(2, "child_process.js:790\n", 21child_process.js:790) = 21write(2, " throw errnoException(errno, "..., 42 throw errnoException(errno, 'spawn');) = 42write(2, " ", 1 ) = 1write(2, " ", 1 ) = 1write(2, " ", 1 ) = 1write(2, " ", 1 ) = 1write(2, " ", 1 ) = 1write(2, " ", 1 ) = 1write(2, " ", 1 ) = 1write(2, " ", 1 ) = 1write(2, " ", 1 ) = 1write(2, " ", 1 ) = 1write(2, "^", 1^) = 1write(2, "\n", 1) = 1gettimeofday({1345025503, 483495}, NULL) = 0gettimeofday({1345025503, 484996}, NULL) = 0write(2, "Error: spawn EINVAL\n at errno"..., 519Error: spawn EINVAL
at errnoException (child_process.js:838:11)at ChildProcess.spawn (child_process.js:790:11)at exports.spawn (child_process.js:614:9)at Object.<anonymous> (/opt/backups/1.js:3:14)at Module._compile (module.js:449:26)at Object.Module._extensions..js (module.js:467:10)at Module.load (module.js:356:32)at Function.Module._load (module.js:312:12)at Module.runMain (module.js:492:10)at process.startup.processNextTick.process._tickCallback (node.js:244:9)
) = 519exit_group(1) = ?