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
│ │ ├─[email protected]
│ │ │ └─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.
EDIT 0
the service is statically enabled
userk@glutamate:~$ systemctl list-dependencies --reverse serial-getty@ttyS2
[email protected]
● └─getty.target
● └─multi-user.target
● └─graphical.target
When I stop and disable it, the situation seems fine:
userk@glutamate:~$ sudo systemctl stop [email protected]
userk@glutamate:~$ sudo systemctl disable [email protected]
userk@glutamate:~$ sudo systemctl status | grep ttyS2
│ ├─1135 grep ttyS2
But when I reboot the system, it appears again.
EDIT 1
- 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.
EDIT 2
I cannot find the [email protected] in /lib/systemd/system folder. I am using grep -rl [email protected] /lib/systemd/system.
consolesetting. This question could be improved by telling answerers what that setting now is.cat /proc/cmdline, i.e. seeing if it containsconsole=ttyS2systemctl disabledoes for most services.systemd-getty-generator