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
  •  


Vintage DEC Digital Equipment Flip-Chip Module Lot Parts picture

Vintage DEC Digital Equipment Flip-Chip Module Lot Parts

$59.99



Vintage Digital VR241-A color CRT monitor, powers on, DEC Rainbow or terminal picture

Vintage Digital VR241-A color CRT monitor, powers on, DEC Rainbow or terminal

$150.00



Vintage DEC Digital XMI-A1 5017293-01A1 LWPR BE3-0 VAX Circuit Board T2012 picture

Vintage DEC Digital XMI-A1 5017293-01A1 LWPR BE3-0 VAX Circuit Board T2012

$74.99



Vintage DEC Digital T1043 DWMBB/B VAXBI XMI Adapter 5018232-01 C1 VAX Board picture

Vintage DEC Digital T1043 DWMBB/B VAXBI XMI Adapter 5018232-01 C1 VAX Board

$109.99



DEC Digital DECmate III PC238 PDP-8 6120 RX50 Dual Floppy Vintage Computer picture

DEC Digital DECmate III PC238 PDP-8 6120 RX50 Dual Floppy Vintage Computer

$649.95



Vintage DEC Digital Equipment DELNI 8-Port Ethernet Local Network Hub VAXstation picture

Vintage DEC Digital Equipment DELNI 8-Port Ethernet Local Network Hub VAXstation

$79.95



Vintage DEC VT100 Series Terminal (Powers On) picture

Vintage DEC VT100 Series Terminal (Powers On)

$499.99



Vintage DEC Digital VR319-DA 19

Vintage DEC Digital VR319-DA 19" High Resolution Monochrome CRT Monitor - Tested

$180.00



Vintage DEC Digital Starion 200 Desktop PC Powers On Boots To BIOS NO HDD - DW picture

Vintage DEC Digital Starion 200 Desktop PC Powers On Boots To BIOS NO HDD - DW

$269.99



Vintage DEC/Mostek memory systems MK 8015 AA-00 6805-08015 1100 REV C(B7) picture

Vintage DEC/Mostek memory systems MK 8015 AA-00 6805-08015 1100 REV C(B7)

$279.99