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.
EDIT 0
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.
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 serial-getty@ttyS2.service in /lib/systemd/system folder. I am using grep -rl serial-getty@ttyS2.service /lib/systemd/system
.
console
setting. This question could be improved by telling answerers what that setting now is. – JdeBP Nov 06 '18 at 14:48cat /proc/cmdline
, i.e. seeing if it containsconsole=ttyS2
– sourcejedi Nov 06 '18 at 15:09console=ttyS2,115200n8 rw coherent_pool=1M quiet init=/lib/systemd/systemd root=PARTUUID=0fb4d56f-02 rootfstype=ext4 earlycon=uart8250,mmio32,0x11030000
– UserK Nov 06 '18 at 15:19systemctl disable
does for most services. – sourcejedi Nov 06 '18 at 16:05systemd-getty-generator
– sourcejedi Nov 06 '18 at 16:17dmesg --console-off
). Let me know if you think you can do that. – sourcejedi Nov 06 '18 at 18:28grep -rl something.service /some/directory
will show you files containing the text "something.service
", it won't match on filenames themselves. – JigglyNaga Nov 08 '18 at 13:20