Results 1 to 2 of 2

Thread: Autostart cmd-line prog on boot?

  1. #1
    Junior Member
    Join Date
    Jan 2006
    Posts
    1

    Autostart cmd-line prog on boot?

    I am trying to turn my PC into a dedicated single-purpose controller for a project. Basically, I want to automatically start an interactive command-line program upon boot. Putting a line in /etc/inittab starts the program, but then the prompt shows up afterward. How can I autostart the program late enough in the boot process to "absorb" the prompt?

    Details:
    KNOPPIX 3.4 (recompiled, but still vanilla 2.4.26)
    HD installed
    Default runlevel 1 (necessary for quality-of-service reasons)

  2. #2
    Senior Member registered user
    Join Date
    Nov 2002
    Location
    USA, IL
    Posts
    1,041

    Re: Autostart cmd-line prog on boot?

    Posting your inittab would help, but basically you should disable the "getty" line for whatever VT is displaying the program.

    You should almost always have a getty on tty1 (or SOMEWHERE), but you might be able to start (and switch to) your interactive program on tty2:

    inittab excerpt:
    Code:
    1:2345:respawn:/sbin/getty 38400 tty1
    2:23:respawn:/sbin/getty 38400 tty2
    3:23:respawn:/sbin/getty 38400 tty3
    4:23:respawn:/sbin/getty 38400 tty4
    ##5:23:respawn:/sbin/getty 38400 tty5
    ##6:23:respawn:/sbin/getty 38400 tty6
    
    # XXX 2005.1021 added
    5:2345:respawn:/usr/bin/open -f -c 5 -w -- /usr/bin/nice /usr/bin/ethstatus -S3m
    6:2345:respawn:/usr/bin/open -f -c 6 -w -- /usr/bin/watch -n 30 /bin/df -h
    8:2345:respawn:/usr/bin/tail -f -n 30 /mnt/squid/access.log >>/dev/tty8
    9:2345:respawn:/usr/bin/open -f -c 9 -w -- /usr/bin/top -s -d 10
    As an example, you could do something like this:
    Code:
    2:1:respawn:/usr/bin/open -f -c 2 -s -w /yourproghere
    --See ' man open ' for details.

    Quote Originally Posted by somebagel
    I am trying to turn my PC into a dedicated single-purpose controller for a project. Basically, I want to automatically start an interactive command-line program upon boot. Putting a line in /etc/inittab starts the program, but then the prompt shows up afterward. How can I autostart the program late enough in the boot process to "absorb" the prompt?

    Details:
    KNOPPIX 3.4 (recompiled, but still vanilla 2.4.26)
    HD installed
    Default runlevel 1 (necessary for quality-of-service reasons)

Similar Threads

  1. Multiple items on boot line
    By doglover in forum Hardware & Booting
    Replies: 4
    Last Post: 01-05-2007, 11:37 AM
  2. Knoppix - boot straight to command line?
    By chaosnine in forum Customising & Remastering
    Replies: 1
    Last Post: 08-17-2005, 07:35 PM
  3. boot only in command line - help
    By teccim in forum Hdd Install / Debian / Apt
    Replies: 8
    Last Post: 06-14-2005, 04:09 PM
  4. Replies: 0
    Last Post: 07-30-2004, 03:21 PM
  5. Console prog on Knoppix?
    By scubacuda in forum Networking
    Replies: 1
    Last Post: 07-16-2004, 09:12 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
  •  


Dell EMC PowerEdge R740 8 Bay Server w/ 32GB RAM 2x GOLD 6132 2x 1600W PSU H730p picture

Dell EMC PowerEdge R740 8 Bay Server w/ 32GB RAM 2x GOLD 6132 2x 1600W PSU H730p

$499.88



Dell EMC PowerEdge R440 Xeon silver 4215 2.5GHz 16 GB ram  2x 550W PSU No HDD picture

Dell EMC PowerEdge R440 Xeon silver 4215 2.5GHz 16 GB ram 2x 550W PSU No HDD

$275.00



Dell EMC VxRail E560F 10-SFF 2*Gold 6230R 2.1GHz No RAM HBA330 iDrac Ent Server picture

Dell EMC VxRail E560F 10-SFF 2*Gold 6230R 2.1GHz No RAM HBA330 iDrac Ent Server

$349.99



Dell PowerEdge R730XD 28 Core Server 2X Xeon E5-2680 V4 H730 32GB RAM No HDD picture

Dell PowerEdge R730XD 28 Core Server 2X Xeon E5-2680 V4 H730 32GB RAM No HDD

$381.93



Dell Poweredge R730xd 12LFF 2*2660v4 4*1Gbe h730 2x 750W Server CTO picture

Dell Poweredge R730xd 12LFF 2*2660v4 4*1Gbe h730 2x 750W Server CTO

$308.00



Dell Poweredge R630 2x Xeon E5-2680 v3 2.5ghz 24-Cores / 64gb / Raid / 2x 1Tb picture

Dell Poweredge R630 2x Xeon E5-2680 v3 2.5ghz 24-Cores / 64gb / Raid / 2x 1Tb

$374.99



Dell PowerEdge C4130 1U AI GPU Server | 2x E5-2680 v3 | 32gb Ram | 2x 1600W picture

Dell PowerEdge C4130 1U AI GPU Server | 2x E5-2680 v3 | 32gb Ram | 2x 1600W

$409.99



Dell R740XD All Flash 2U Server Full 24 x U.2 NVME 2x Xeon 6240R 48 CORE HOMELAB picture

Dell R740XD All Flash 2U Server Full 24 x U.2 NVME 2x Xeon 6240R 48 CORE HOMELAB

$849.95



NEW DELL TRUSTED PLATFORM MODULE TPM 2.0 POWEREDGE R730 SERVER M48YR RXW6R K98XH picture

NEW DELL TRUSTED PLATFORM MODULE TPM 2.0 POWEREDGE R730 SERVER M48YR RXW6R K98XH

$225.00



Dell Poweredge R630 2x Xeon E5-2680 v3 2.5ghz 24-Core | HBA330 | No RAM or HDD picture

Dell Poweredge R630 2x Xeon E5-2680 v3 2.5ghz 24-Core | HBA330 | No RAM or HDD

$169.99