The issue you're describing suggests that you're trying to disable or mask the [email protected] on a Linux system (likely using systemd), but after rebooting, the service remains active. This can happen due to misconfiguration, dependencies, or the service being re-enabled by the system. Below are steps to troubleshoot and resolve this issue.1. Understand the [email protected] is a systemd service that provides a login prompt on the serial console (ttyS0). It is typically used for systems that require serial port access, but if you don't need it (e.g., no serial console is used), you can disable or mask it.2. Check the Current StatusFirst, verify the status of the service:bash
5. Mask the Service (Stronger Option)If disabling doesn’t work (e.g., another service or configuration re-enables it), you can mask the service to prevent it from starting:bash
6. Check for DependenciesSometimes, other services or configurations (e.g., getty.target) may cause [email protected] to start. Check for dependencies:bash
systemctl list-dependencies getty.target
Look for [email protected] in the output.
If it’s listed, you may need to modify the configuration that’s pulling it in.
7. Inspect Kernel Command LineThe serial console might be enabled via the kernel command line. Check the kernel parameters:bash
cat /proc/cmdline
Look for parameters like console=ttyS0. If present, the kernel is configured to use the serial console, which may trigger the service.
To remove it, edit the GRUB configuration:Edit /etc/default/grub.
Find the line with GRUB_CMDLINE_LINUX and remove console=ttyS0 (or similar).
Update GRUB:bash
sudo update-grub
Reboot:bash
sudo reboot
8. Check for Systemd Generator or PresetSome systems use systemd generators or presets to automatically enable serial-getty services. Check:Systemd Presets:bash
cat /usr/lib/systemd/system-preset/*.preset
Look for lines enabling [email protected]. If found, you can override this by creating a custom preset:bash
Systemd Generators:
Check for custom generators in /lib/systemd/system-generators/ or /etc/systemd/system-generators/. If one is enabling the service, you may need to modify or remove it.
9. Verify After RebootAfter making changes, reboot the system:bash
10. Additional TroubleshootingInstance Units: [email protected] is an instance of the [email protected] template. Ensure you’re targeting the correct instance (ttyS0). If other serial ports are involved, repeat the process for them (e.g., ttyS1).
Custom Configuration: Check /etc/systemd/system/ for any custom unit files overriding the default behavior:bash
If found, remove or edit them.
Firmware/BIOS Settings: Some systems enable serial consoles at the hardware level. Check your BIOS/UEFI settings for serial port configurations and disable if unnecessary.
11. If All Else FailsIf the service still starts, it’s possible that a higher-level configuration (e.g., cloud-init, container setup, or a custom script) is re-enabling it. Check:Cloud-Init: If you’re on a cloud VM, check /etc/cloud/cloud.cfg for serial console settings.
Custom Scripts: Look for scripts in /etc/rc.local or cron jobs that might start the service.
Reinstall Default Config: As a last resort, reset systemd’s configuration:bash
sudo systemctl preset-all
Then reapply the disable/mask commands.
NotesAlways back up configuration files before editing.
If you don’t need any serial console, consider disabling all serial-getty@ services by masking the template:bash
If you’re unsure about the impact of disabling the service, test in a non-production environment first.
If the issue persists after these steps, please provide:Output of systemctl status [email protected].
Output of cat /proc/cmdline.
Any relevant logs from journalctl -u [email protected].