I used to be able to start and stop processes in Terminal with sudo start
or sudo stop
Example: sudo start ttyS0
This would start a getty so I could log in from a serial terminal.
It doesn't work in Ubuntu 15.04. Is there an alternate way to start and stop processes in 15.04?
Best Answer
The service management system has changed.
Every system management toolset has own utilities. The utilities that you are used to using are the ones that come with upstart, which are trivial shims for
initctl start
andinitctl stop
. But this is Ubuntu version 15. You aren't using upstart any more.You're using systemd, and the service control commands are subcommands of
systemctl
rather than ofinitctl
. So services are started withsystemctl start
, stopped withsystemctl stop
, enabled withsystemctl enable
, disabled withsystemctl disable
, and queried withsystemctl status
.Services and service configuration have changed.
You've presumably followed instructions like the Serial Console How-To to turn the supplied
/etc/init/tty1.conf
into an/etc/init/ttyS0.conf
. This is an upstart configuration file and it will simply be ignored by systemd. None of what you have learned from there applies to systemd, not even the concept of run levels, which is "obsolete" in the systemd world.The systemd configuration file for a
getty
on a real terminal device is/lib/systemd/system/serial-getty@.service
. This is a template unit, parameterized on the name of the serial device file. So the actual service name to use will beserial-getty@ttyS0.service
. You just enable/disable/start/stop it like any other service.If you want an actual serial console, rather than just an ordinary serial terminal, then you don't even do that. systemd has a mechanism that automatically instantiates
serial-getty@.service
whenever the kernel is told to not have its console on a virtual terminal.Further reading
systemctl
. systemd manual pages. freedesktop.org.systemd-getty-generator
. systemd manual pages. freedesktop.org.