This question is different from the possible candidate since here I am asking how to remove the service at startup
I am using a Seeed ReSpeaker Core v2.0 board. I would like to use the UART interface to make this board communicate with another one. But the UART port /dev/ttyS2 is linked to the console. I have identified a service linked to the board and I would like to disable it in order to prevent it from starting at boot:
userk@glutamate:~$ sudo systemctl status | grep ttyS2 │ │ ├─serial-getty@ttyS2.service │ │ │ └─1078 /sbin/agetty --keep-baud 115200,38400,9600 ttyS2 vt220 │ ├─1093 grep ttyS2
There is no information related to the bootloader on the official page. I already asked a question on their forum.
the service is statically enabled
userk@glutamate:~$ systemctl list-dependencies --reverse serial-getty@ttyS2 serial-getty@ttyS2.service ● └─getty.target ● └─multi-user.target ● └─graphical.target
When I stop and disable it, the situation seems fine:
userk@glutamate:~$ sudo systemctl stop serial-getty@ttyS2.service userk@glutamate:~$ sudo systemctl disable serial-getty@ttyS2.service userk@glutamate:~$ sudo systemctl status | grep ttyS2 │ ├─1135 grep ttyS2
But when I reboot the system, it appears again.
- I am working with Debian 9 (stretch). I used an image made by SeedStudio.
- I asked another question related to this service here. As @JdeBP stated in his answer
The fundamental configuration item that drives this is the console setting that one gives on the command line to the kernel via the boot loader. It's that that tells the generator what serial console services to start. It is that that tells the kernel where to send kernel console output. It is that that tells the kernel where to send /dev/console output. If you do not want your serial device to be a console, it is that that you need to adjust.
I cannot find the serial-getty@ttyS2.service in /lib/systemd/system folder. I am using
grep -rl serial-getty@ttyS2.service /lib/systemd/system.