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
  •  


KNOPPIX 9.1 Linux Install & Live DVD 32bit & 64bit picture

KNOPPIX 9.1 Linux Install & Live DVD 32bit & 64bit

$19.99



Windows XP, Vista, 8.1, Linux Knoppix, Office XP,  (6 CDS) picture

Windows XP, Vista, 8.1, Linux Knoppix, Office XP, (6 CDS)

$10.00



Knoppix Live GNU Linux System 9.1 on Bootable CD / DVD / USB Flash Drive picture

Knoppix Live GNU Linux System 9.1 on Bootable CD / DVD / USB Flash Drive

$5.99



KNOPPIX USB DVD OS , BEST OF ALL HIGHLY RECOMENDED picture

KNOPPIX USB DVD OS , BEST OF ALL HIGHLY RECOMENDED

$11.99



Knoppix Linux Bootable OS v8.6

Knoppix Linux Bootable OS v8.6 "Original Live Operating System" 16G USB Stick

$20.85



VINTAGE SOFTWARE | KNOPPIX STD 0.1 (SECURITY TOOLS DISTRIBUTION) picture

VINTAGE SOFTWARE | KNOPPIX STD 0.1 (SECURITY TOOLS DISTRIBUTION)

$7.57



Knoppix NSM 1.2 picture

Knoppix NSM 1.2

$8.00



Knoppix Linux Bootable OS v8.6

Knoppix Linux Bootable OS v8.6 "Original Live Operating System" 32G USB Stick

$21.42



Hamshack Live DVD-ROM picture

Hamshack Live DVD-ROM

$7.00



Knoppix 5.0.1 ULTRA RARE Linux DVD - Linux Pro Extra August 2006 picture

Knoppix 5.0.1 ULTRA RARE Linux DVD - Linux Pro Extra August 2006

$33.98