On 8/28/20 12:00 PM, Chuck Hast wrote:
> Folks,
> I have a server that I would like to have HTOP startup in
> one of the TTY's so far all I find are how to do it from the
> GUI (no gui this is a server) I would like for HTOP to start
> in say terminal 3 for grins (I use 1 and 2 for doing changes
> or whatever stuff I need if I am not doing it over and SSH
> screen)
> 
> So far I have not been able to find some instruction to have
> a terminal (tty) start a program, any guidance here?
> 
> 

As mentioned, assuming no X sessions, you can add a line to /etc/inittab

For example (in Slackware):

...
# These are the standard console login getties in multiuser mode:
c1:12345:respawn:/sbin/agetty --noclear 38400 tty1 linux
c2:12345:respawn:/sbin/agetty 38400 tty2 linux
c3:12345:respawn:/sbin/agetty 38400 tty3 linux
c4:12345:respawn:/sbin/agetty 38400 tty4 linux
c5:12345:respawn:/sbin/agetty 38400 tty5 linux
c6:12345:respawn:/sbin/agetty 38400 tty6 linux
htop:2345:respawn:/usr/bin/htop </dev/tty7 >/dev/tty7 2>&1

...

That last line runs htop in tty7 accessible via ALT-F7

However, a better way is to use screen or tmux (or similar).  That way
you can access everything locally OR via ssh. If htop is already running
on a tty, there is no good way to access it via ssh.

If you are on a systemd box, then there is a config file for tty setup.

-Ed

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
PLUG: https://pdxlinux.org
PLUG mailing list
PLUG@pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to