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 8675205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:53:41+00:00 2026-06-12T19:53:41+00:00

I thought I could just use this related question: How Do I write a

  • 0

I thought I could just use this related question: How Do I write a bash script to restart a process if it dies. @lhunath had a great answer and told me everything I might do about it was wrong, but I’m restarting a daemon process and if I’m hoping there’s something I can do in a single script that works.

my process starts with a kick off script that shows the startup log, but then quits and leaves the process running off the shell:

>sudo ./start
R CMD Rserve --RS-conf /var/FastRWeb/code/rserve.conf --vanilla --no-save
...
Loading required package: FastRWeb
FastRWeb: TRUE
Loading data...
Rserv started in daemon mode.
>

The process is up and running,

ps -ale | grep Rserve
1 S 33 16534 1 0 80 0 – 60022 poll_s ? 00:00:00 Rserve

Is there a simple way to wrap or call the ‘start’ script from bash and restart when the process dies or is this a case where PID files are actually called for?

Dang – question got closed even after pointing to a very similar question that was not closed on stackoverflow. you guys suck

  • 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-06-12T19:53:42+00:00Added an answer on June 12, 2026 at 7:53 pm

    A very simple way to monitor the program is to use cron: check every minute (or so) if the program still is alive, ./start it otherwise.

    As root, invoke crontab -e.

    Append a line like this:

    * * * * * if ! pidof Rserve 2>&1 >/dev/null; then /full/path/to/start; fi
    

    This method will stay persistent, i.e., it will be executed after a reboot etc. If this is not what you want, move it to a shell script:

    #! /bin/bash
    # monitor.sh
    while true; do
      if ! pidof Rserve 2>&1 >/dev/null; then /full/path/to/start; fi
      sleep 10
    done
    

    This script has to be started manually from the command line, and can be easily stopped with Ctrl-C.

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

Sidebar

Related Questions

Yesterday i had a question in an interview which i thought i could find
This is perhaps more of a discussion question, but I thought stackoverflow could be
I thought that a 32-bit process could use at most 2GB RAM, since half
I had thought I could enumerate the types using IMetaDataImport.EnumTypeDefs and for each of
I'm using the Dapper micro ORM. I thought it could handle enumerables like this:
I always thought that you could use OR in a LIKE statment to query
This question might not belong here, and since this is related to HTML and
(Since this is my first SO question, let me just say I hope it's
This question is related to another question that I posted on SO earlier How
I did search before posting this question and didn't find anything directly related, so

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.