-
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)
-
Senior Member
registered user
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.

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
-
By doglover in forum Hardware & Booting
Replies: 4
Last Post: 01-05-2007, 11:37 AM
-
By chaosnine in forum Customising & Remastering
Replies: 1
Last Post: 08-17-2005, 07:35 PM
-
By teccim in forum Hdd Install / Debian / Apt
Replies: 8
Last Post: 06-14-2005, 04:09 PM
-
By philhu in forum General Support
Replies: 0
Last Post: 07-30-2004, 03:21 PM
-
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
-
Forum Rules

SK Hynix Server Memory 32GB (1x32GB) RAM DDR4 2400MHz HMA84GR7MFR4N Lot of 12
$1599.99

SK Hynix 64GB PC4-2666V RDIMM Server Memory RAM HMAA8GL7CPR4N-VK
$299.99

x4 Intel 128GB NMB1XXD128GPS Optane Memory 200 Series PMEM Module 3200 DDR4 RAM
$329.99

MICRON MTA36ASF4G72PZ-2G6E1 | 32GB PC4-2666V ECC RDIMM Server RAM
$184.95

Lot Of 25 16GB PC4 2133P 2400T 2666V RAM DIMM ECC Server Memory *From Scrap*
$1999.99

USB 3.0 Flash Drive 32GB 64GB 128GB Memory Stick Thumb Stick Lot Pack
$826.09

Lot Of 20 4GB PC4 2133P 2400T RAM SODIMM laptop Memory Mixed Brands *From Scrap*
$239.99

SK Hynix 64B PC4-2933Y Server Memory DDR4 RAM HMAA8GR7MJR4N-WM
$499.99

1/ 10/ 100pcs USB 2.0 2GB, 4GB ,8GB ,16GB ,32GB ,64GB 128GB USB Flash Drives Lot
$137.70

SMART(Micron)SafeStor 32GB(1X32GB) 1RX4 NN4-3200AA(DDR4) HPE Server Memory
$159.98