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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:22:54+00:00 2026-06-04T16:22:54+00:00

I have a script which runs when the system boot first time. But that

  • 0

I have a script which runs when the system boot first time. But that same script second time also used by skiping one command only.

So i was trying with variable but it seems there is no way to track it.

E.g: /var/tmp/runme.sh << this same script is to use

#!/bin/bash
mkfifo pipe;
mkfifo pipe1;
ps aux | grep Java.jar | awk '{print $2}' | xargs kill -9;
sleep 1;

#
# Question on this:
# only one time it execute / its my application boot process
# - this is only one time on system startup
#
##############################################################
export DISPLAY=:0.0 && java -cp Java.jar main.Boot &

#
# second time this following should always execute
# This is my software kernel, which crash often 
# on the fly i restart it
#
while true; do cat /var/jpeg1.jpeg >> pipe; done
while true; do cat /var/jpeg2.jpeg >> pipe1; done
export DISPLAY=:0.0 && java -cp Java.jar main.Desktop &
  • 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-04T16:22:57+00:00Added an answer on June 4, 2026 at 4:22 pm

    Just use a lockfile 🙂 Eg: at the begining of the script add:

    lockfile= /var/lock/MyLockFile
    if [! -f $lockfile ] then
      touch $lockfile
      ....place your run-once commands here...
    fi
    

    Please remember to delete $tmpfile in script at system shutdown OR in script at early stage of boot!

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

Sidebar

Related Questions

I have a script which, each time is called, gets the first line of
I have a bash script which runs without needing to be root . But
Currently I have a bash script which runs the find command, like so: find
I have a simple Perl script which runs as a Linux daemon using an
I have a cron job to run a Ruby script, which runs fine on
I have a Haskell script that runs via a shebang line making use of
I have written a Perl script that runs as a daily crontab job that
I have have a R script which queries a database, runs some analysis, plots
I have made a batch script which runs a Python application. This batch script
I have a script in kohana which runs fine on php 5.2.11. I took

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.