Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6062065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:00:32+00:00 2026-05-23T09:00:32+00:00

First of all, this may need to be moved to superuser. I couldn’t decide

  • 0

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)
Host <- 'zachec2.dyndns.org'
cores <- multicore:::detectCores()
TO <- 24*3600

#Start Workers
require('doRedis')
startLocalWorkers(cores,'jobs',host=Host,port=6379, timeout = TO)

But when I run it, I get the following output:

Loading required package: utils
Loading required package: multicore
Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called 'multicore'
Error in loadNamespace(name) : there is no package called 'multicore'
Calls: ::: ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted

I know I have multicore installed on my system!

/EDIT2: I had to move all my R packages to cd /usr/lib/R/site-library and now the littler shell script works. I added the script to /etc/rc.local and it starts up perfectly!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:00:33+00:00Added an answer on May 23, 2026 at 9:00 am

    This is a bit of an R question, and a bit on an Ubuntu sysadmining question. here are a few points:

    1. For simple start-up tasks, I recommned just using /etc/rc.local where you can append you jobs.

    2. I just don’t like R CMD BATCH which is why Jeff Horner and I wrote littler which gives you /usr/bin/r and much easier R scripting. R itself also gives you Rscript; either one is preferable over R CMD BATCH.

    3. To test scripts, just run them as root. Once theyw ork, add them to /etc/rc.local.

    Hope this helps. The r-sig-debian list is a good source of Ubuntu / Debian tips too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First of all I am not a designer. so this question is may be
First of all there is probably a question like this already but i couldn't
First of all I'm not sure this is even possible, however I need to
First of all this is my markup: <div class=first></div> <div class=second></div> <div class=second></div> <div
first of all: this is not the same as this . The ModelBackend has
first of all this is my third question about web services here and i
First of all: This question is not directly programming related. However, the problem only
Well, first of all sorry about this question it must be pretty straight forward
Maybe it's a similar beginning, but it's true. first of all sorry if this
First of all I don't know if this is the right approach. I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.