3

How can I stop auto serial port auto login console and getty in the Raspbian 8 (Jessie) OS, and why is /etc/inittab/ empty?

Where can I get this (#Spawn a getty on Raspberry Pi serial line T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100 ) in Raspbian 8 (Jessie)?

8

inittab was a part of sysvinit, which has been replaced with systemd.. Serial getty is now a service like any other. So in order to stop this service, simply write in terminal;

sudo systemctl stop serial-getty@ttyAMA0.service
  • 4
    If you don't want it to start again at boot, you will also need systemctl disable serial-getty@ttyAMA0.service. – goldilocks Jun 7 '16 at 15:57
5

For Raspbian try

sudo raspi-config

It should have an option to disable serial boot messages and getty under Advanced -> Serial.

You may need to reboot for that to take affect.

Alternatively disable the service if running with systemd.

sudo sysctl -p
sudo systemctl disable serial-getty@ttyAMA0.service
  • @joan what does the sudo sysctl -p do and/or why is it used? – Diederik de Haas Dec 9 '15 at 15:20
  • @DiederikdeHaas I can tell you what man says but that does not help. It is just something I have seen done before the systemctl command and frankly I have no idea if it is needed or not. – joan Dec 9 '15 at 16:07
  • I've seen the manpage (and sysctl --help) but it didn't tell me much. Tried it myself and didn't see anything visible happen and I had never seen the use of it before disabling a service with systemd. – Diederik de Haas Dec 9 '15 at 16:18
  • You can switch back to the sysvinit package in Jessie (it was the default in all previous Raspian & Debian distributions) if you really want to - and once you have rebooted so that init is your PID 1 you can then uninstall systemd - you may need to add/remove other dependencies. I haven't been much impressed by systemd in some areas (documentation; use in non-"standard" system settings) and that is why I try to avoid it like the plague... – SlySven Dec 9 '15 at 18:38
  • I also believe that the systemctl disable command will stop the getty from restarting after rebooting, but if we want to stop it while it is already running we might need: sudo systemctl stop serial-getty@ttyAMA0.service – Kolban Jan 9 '16 at 6:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.