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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:32:49+00:00 2026-05-24T06:32:49+00:00

I am writing a init.d script that should run commands with certain options if

  • 0

I am writing a init.d script that should run commands with certain options if it were being executed at system startup. The same script should run commands with other options if the user was manually executing the script.

For example, in a networking script, if it was being run at the system start up, then certain network interface would not be brought up depending on whether they should be configured ONBOOT. Otherwise, if the user was manually running the networking script (service network start), then all network interfaces would be brought up.

One way i can achieve this is to create a file say “/tmp/.boot” from the parent rc script, which is deleted after all startup scripts are executed. And then in the init script check of the existence of the file /tmp/.boot to determine if the script is being run as part of the startup sequence or not.

I was wondering if there is any existing way of knowing that the system is in its boot up sequence. Could something in /proc/ or elsewhere tell me that the system is in its boot sequence?

Looking forward to your suggestions.

Thanks and Regards
~Sameer

  • 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-24T06:32:50+00:00Added an answer on May 24, 2026 at 6:32 am

    Firstly, the state in /proc should not be that much different for many scripts. The runlevel indicates whether you are in an early boot phase (runlevel gives access to it), but at mid-boot the startup runlevel S is left.

    However, this is not a bad thing and trying to write scripts that modify behaviour depending on the runlevel is evil. Undebugable. You might simply try other command line arguments instead, like ‘start-all’ instead of ‘start’. Or you separate the RC script like Debian does.

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

Sidebar

Related Questions

at the moment I'm writing a simple script in ksh who should take some
I'm currently writing a Java daemon. I'm writing a script that will have the
I was working on (for fun) writing a script that would recognize palindromes. So
I'm writing a C app that has an embedded lua script in it. The
I am currently writing a php script that validates a username and password. I
I'm writing a SQL script that we want our accounting team to be able
I have a python script that is constantly grabbing data from Twitter and writing
I have a few questions regarding an init script I'm writing. I haven't actually
I am writing a python script that will parse through a file quickly by
I am writing a script that deals with hex color values and 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.