04-09-2019, 08:37 PM
Use systemctl [stop|start|enable|disable]
1. Check for getty
$ ps aux | grep getty
root 829 0.0 0.0 3980 1992 ttyS2 Ss+ 02:21 0:00 /sbin/agetty -o -p -- \u --keep-baud 115200,38400,9600 ttyS2 vt220
2. Stop getty on ttyS2.
$ sudo systemctl stop serial-getty@ttyS2.service
Repeating the ps command will show that getty is gone, but it will return after reboot. To persist you can:
3. Disable getty on ttyS2:
$ sudo systemctl disable serial-getty@ttyS2.service
1. Check for getty
$ ps aux | grep getty
root 829 0.0 0.0 3980 1992 ttyS2 Ss+ 02:21 0:00 /sbin/agetty -o -p -- \u --keep-baud 115200,38400,9600 ttyS2 vt220
2. Stop getty on ttyS2.
$ sudo systemctl stop serial-getty@ttyS2.service
Repeating the ps command will show that getty is gone, but it will return after reboot. To persist you can:
3. Disable getty on ttyS2:
$ sudo systemctl disable serial-getty@ttyS2.service