Results 1 to 2 of 2

Thread: Run a shell script after booting

  1. #1
    Junior Member
    Join Date
    Jul 2005
    Posts
    1

    Run a shell script after booting

    Greetings!

    I am creating a text-mode (init level 3) Knoppix system and I want to execute a shell script automatically when the CD boots.

    What I have tried is an init script, but since the shell script doesn't ever exit, the inits never finish.

    I have added the line to the /root/.bash_profile but it doesn't seem to get executed.

    I have put the line (and the script itself for that matter) in /etc/profile but that didn't work either.

    What I need is a remote linux server that ANYone can run. Even people who still look for the any key. The next piece I need to conquer is getting the shell script to automatically run in tty1 without any user intervention.

    Anyone done this yet?

    The script I am trying to execute is pretty simple:

    Code:
    #!/bin/sh
    
    /usr/local/sbin/info_screen
    And that's it!

    Any help would be appreciated.

    Thanx!

    -Michael

  2. #2
    Senior Member registered user
    Join Date
    Feb 2005
    Location
    Saint Louis, MO, USA
    Posts
    376

    Re: Run a shell script after booting

    Quote Originally Posted by mpweber77
    I am creating a text-mode (init level 3) Knoppix system and I want to execute a shell script automatically when the CD boots. What I have tried is an init script, but since the shell script doesn't ever exit, the inits never finish.
    Have you tried adding your script to /etc/inittab? For example, to have "/usr/bin/top" running on virtual console 1 in runlevel 3, remove this single line from /etc/inittab:
    Code:
    1:12345:respawn:/bin/bash -login >/dev/tty1 2>&1 </dev/tty1
    and replace it with these two:
    Code:
    1:1245:respawn:/bin/bash -login >/dev/tty1 2>&1 </dev/tty1
    1a:3:respawn:/usr/bin/top >/dev/tty1 2>&1 </dev/tty1
    Replace your script for "/usr/bin/top" and it should work.

    Let us know how things go.

    Regards,
    - Robert
    http://www.cwelug.org/

Similar Threads

  1. shell script to automount a USB upon insertion
    By ecliu in forum General Support
    Replies: 0
    Last Post: 02-20-2009, 11:14 AM
  2. shell script (printer configuration)
    By migs_sison in forum Hdd Install / Debian / Apt
    Replies: 0
    Last Post: 02-24-2006, 01:21 AM
  3. running shell script
    By splittik in forum General Support
    Replies: 1
    Last Post: 03-22-2005, 07:38 AM
  4. Help with shell script + startup
    By niXnoob in forum General Support
    Replies: 3
    Last Post: 10-06-2004, 04:56 AM
  5. Anybody knows how to deamonize a shell script ?
    By ktheking in forum General Support
    Replies: 4
    Last Post: 06-29-2003, 12:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


RAM-HOL-SAM60CPU RAM USB-C Powered Dock for Samsung Tab Active5 - 3 - 2 picture

RAM-HOL-SAM60CPU RAM USB-C Powered Dock for Samsung Tab Active5 - 3 - 2

$81.99



Samsung 2.5

Samsung 2.5" 870 EVO SSD SATA III 250GB 500GB 1TB Internet Solid State Drive Lot

$60.00



New Samsung 512GB FIT Plus USB 3.2 Gen 1 Type-A Flash Drive MUF-512AB/AM NEW picture

New Samsung 512GB FIT Plus USB 3.2 Gen 1 Type-A Flash Drive MUF-512AB/AM NEW

$120.00



NEW Samsung NoteBook NT930QCG touch LCD Full Screen Assembly Blue picture

NEW Samsung NoteBook NT930QCG touch LCD Full Screen Assembly Blue

$225.77



RAM-HOL-SAM52CPU RAM USB-C Powered Dock Samsung Tab Active4 Pro & Tab Active Pro picture

RAM-HOL-SAM52CPU RAM USB-C Powered Dock Samsung Tab Active4 Pro & Tab Active Pro

$81.99



RAM-GDS-SKIN-SAM54-NG-1 RAM Mounts IntelliSkin® Next Gen for Samsung Tab Active4 picture

RAM-GDS-SKIN-SAM54-NG-1 RAM Mounts IntelliSkin® Next Gen for Samsung Tab Active4

$93.99



RAM-GDS-DOCK-SAM88CPU RAM GDS® Tough-Dock™ for Samsung Tab A9+ picture

RAM-GDS-DOCK-SAM88CPU RAM GDS® Tough-Dock™ for Samsung Tab A9+

$174.99



Samsung SCXSTP000, SCX-STP000 (Swingline Staple Cartridge - 3 Refills) picture

Samsung SCXSTP000, SCX-STP000 (Swingline Staple Cartridge - 3 Refills)

$57.99



Samsung 24

Samsung 24" S3 Essential IPS 100Hz Monitor | Sealed | Fast shipping

$50.00



Samsung Galaxy View Tablet 18.4 SM-T670/677A Charging Port 100% Original Oem picture

Samsung Galaxy View Tablet 18.4 SM-T670/677A Charging Port 100% Original Oem

$98.99