KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
First of all, this may need to be moved to superuser. I couldn't decide which venue was better. I am trying to write an R script that will run at boot/reboot and add that machine to a pool of doRedis workers. (doRedis is a foreach backend). Here is my R script, "~/Rworker.R" #Define Parameters require(multicore) Host <- 'ip_of_doRedis_Server' cores <- multicore:::detectCores() TO <- 24*3600 #Start Workers require('doRedis') startLocalWorkers(cores,'jobs',host=Host,port=6379, timeout = TO) I can run this script from the command line, using the command sudo R CMD BATCH ~/Rworker.R ~/RLog . Next, I wrote a shell script to run the R script, titled "/etc/init.d/StartWorkers.sh" #!/bin/sh sudo echo "Starting R workers" sudo R CMD BATCH ~/Rworker.R ~/RLog I made this shell script executable, using chmod +x StartWorkers.sh . When I run ./StartWorkers.sh everything works great and the R session starts up and the workers get added to the pool. Now, I need this shell script to run when I boot/reboot the machine, so I type update-rc.d StartWorkers.sh defaults . This command appears to work, but I get the following warning: 'update-rc.d: warning: /etc/init.d/StartWorkers.sh missing LSB information' However, a check with rcconf confirms that "StartWorkers.R" is on the startuplist. However, when I reboot the machine, the script fails to run. What am I doing wrong? The shell script runs fine from the command line, but fails when I try to run it at startup. /EDIT: ok, per Dirk's answer, I installed littler, and changed 'StartWorkers.sh' to the following: #! /usr/bin/r #Define Parameters require(multicore)
Tags (comma-separated)
Save Edits
Cancel