[systemd-devel] getty at .service.m4 and serial-getty at .service.m4

Lennart Poettering lennart at poettering.net
Wed Nov 10 15:37:44 PST 2010

On Wed, 03.11.10 22:49, Andrew Edmunds (Andrew.Edmunds at yahoo.com.au) wrote:

> Hi,
> A few points about these two source files.
> 1. getty at .service.m4 has:
> > m4_ifdef(`TARGET_FEDORA', `m4_define(`GETTY', `/sbin/agetty 38400')')m4_dnl
> > m4_ifdef(`TARGET_SUSE', `m4_define(`GETTY', `/sbin/agetty 38400')')m4_dnl
> > m4_ifdef(`TARGET_DEBIAN', `m4_define(`GETTY', `/sbin/getty 38400')')m4_dnl
> > m4_ifdef(`TARGET_UBUNTU', `m4_define(`GETTY', `/sbin/getty 38400')')m4_dnl
> > m4_ifdef(`TARGET_GENTOO', `m4_define(`GETTY', `/sbin/agetty 38400')')m4_dnl
> > m4_ifdef(`TARGET_ARCH', `m4_define(`GETTY', `/sbin/agetty -8 38400')')m4_dnl
> This code should be duplicated into serial-getty at .service.m4, or
> pulled out into configure.ac so that it can be used by both units.
> Currently serial-getty at .service tries to invoke /sbin/agetty on
> Debian/Ubuntu, which doesn't exist.

Fixed this now. Ideally Debian/Ubuntu would stop renaming agetty like
this, or at least do it via symlink only. I'd love to get rid of the
differences between the distros here. 

> 2. serial-getty at .service.m4 invokes agetty with option "-s", which
> seems to have been recently added to agetty at Lennart's request.
> getty on Debian/Ubuntu doesn't have that option yet and I would
> guess that other distros may be in the same position. Since ifdefs
> are needed here anyway, it would be nice to apply that option only
> to the distros where it currently works.

Hmm, I'd very much prefer if those distros would upgrade their u-l-ng
patches instead.

Note that not using -s is difficult here, since then the baudrate and
other connection parameters might be incorrectly set up. Fedora used to
have a wrapper for agetty that would figure out the right parameters and
then exec agetty. However because I didn't want to have that I asked
Karel to add -s insetad. So, simply dropping -s on your distro won't
really fix the problem for you, since without that wrapper automatic
serial gettys still wouldn't work properly.

> 3. Both files have:
> > m4_ifdef(`TARGET_FEDORA',
> > After=rc-local.service
> > )m4_dnl
> > m4_ifdef(`TARGET_ARCH',
> > After=rc-local.service
> > )m4_dnl
> Is there a reason why this applies only to Fedora and Arch?  It seems
> appropriate for all users as far as I can see.

Only Fedora and Arch have rc.local. If you ask me rc.local is something
that should just die, hence I am very reluctant to support it on any
more distros than we currently support it on.

> Incidentally, HP-UX used to have (possibly still has) a nice feature
> where getty would normally be started at the end of the boot sequence
> but you could press the Break key to start it immediately, if an
> init script was hanging for example.  As a wishlist item, perhaps
> getty could be started via some little helper program that provides
> similar functionality.

The big problem here is that there isn't really a well defined point in
time anymore where bootup is finished. In traditionally sysvinit startup
messages were only printed on the console for proper sysv services and
only when started at boot time. However, in the much more dynamic
systemd we print them for all services (including D-Bus services, which
actually account for more services than SysV on most setups right
now). The effect of that is that services come all the time and there's
little point in synchronizing getty startup to that.


Lennart Poettering - Red Hat, Inc.

More information about the systemd-devel mailing list