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

  • Home
  • SEARCH
  • 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 823235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:55:11+00:00 2026-05-15T02:55:11+00:00

I’m trying to execute a firmware upgrade while my programming is running in inittab.

  • 0

I’m trying to execute a firmware upgrade while my programming is running in inittab. My program will run 2 commands. One to extract the installer script from the tarball and the other to execute the installer script. In my code I’m using the system() function call. These are the 2 command strings below,

   system ( "tar zvxf tarball.tar.gz -C / installer.sh 2>&1" );

   system( "nohup installer.sh tarball >/dev/null 2>&1 &" );

The installer script requires the tarball to be an argument. I’ve tried using sudo but i still have the same problem. I’ve tried nohup with no success. The installer script has to kill my program when doing the firmware upgrade but the installer script will stay alive.

If my program is run from the command line or rc.local, on my target device, my upgrade works fine, i.e. when my program is killed my installer script continues.

But I need to run my program from /etc/inittab so it can respawn if it dies. To stop my program in inittab the installer script will hash it out and execute “telinit q”. This is where my program dies (but thats what I want it to do), but it also kills my installer script.

Does anyone know why this is happening and what can I do to solve it?

Thanks in advance.

  • 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-15T02:55:11+00:00Added an answer on May 15, 2026 at 2:55 am

    My guess what happens here is that init is sending the SIGTERM/SIGKILL not only to the process but to the whole process group. It does this to ensure that all children of a process are properly cleaned up. When your program calls system(), it will internally do a fork()/exec(). This newly forked process is in the same process group as you program so it also gets killed.

    You could try to run your installer script in a new session by doing a

    system( "setsid nohup installer.sh tarball >/dev/null 2>&1 &" );
    

    If your system doesn’t provide the setsid commandline utility you can simply write your own. setsid is just a small wrapper around the setsid() system call.

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

Sidebar

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.