Hardware manual

setserial, and a valid device name. You could do a test by executing this file manually (just type its name
as the super-user) to see if it works right. Testing like this was a lot faster than doing repeated reboots to get it
right.
For versions >= 2.15 (provided your distribution implemented the change, Redhat didn't at first) it may be
more tricky to do since the file that runs setserial on startup, /etc/init.d/setserial or the like was not intended to
be edited by the user. See Configuration method using /etc/serial.conf, etc..
An example line in such a script was:
/sbin/setserial /dev/ttyS3 irq 5 uart 16550A skip_test
or, if you wanted setserial to automatically determine the uart and the IRQ for ttyS3 you would have used
something like this:
/sbin/setserial /dev/ttyS3 auto_irq skip_test autoconfig
This was done for every serial port you wanted to auto configure, using a device name that really does exist
on your machine. In some cases it didn't work right due to the hardware.
Configuration method using /etc/serial.conf, etc.
Prior to setserial version 2.15 (1999), the way to configure setserial was to manually edit the shell-script that
ran setserial at boot-time. See Edit a script (before version 2.15). This was simple, but the simple and clear
method has been changed to something that is unnecessarily complex. Today the script and configuration file
are two different files instead of one. This shell-script is not edited but gets its data from a configuration file
such as /etc/serial.conf (or /var/lib/setserial/autoserial.conf).
Furthermore you may not even need to edit serial.conf (or the like) because using the "setserial" command on
the command line may automatically cause serial.conf to be edited appropriately. This was done so that you
may not need to edit any file in order to set up (or change) what setserial does each time that Linux is booted.
What often happens is this: When you shut down your PC the script that ran "setserial" at boot-time is run
again, but this time it only does what the part for the "stop" case says to do: It uses "setserial" to find out what
the current state of "setserial" is, and it puts that info into the serial configuration file such as serial.conf.
Thus when you run "setserial" to change the serial.conf file, it doesn't get changed immediately but only when
and if you shut down normally.
Now you can perhaps guess what problems might occur. Suppose you don't shut down normally (someone
turns the power off, etc.) and the changes don't get saved. Suppose you experiment with "setserial" and forget
to run it a final time to restore the original state (or make a mistake in restoring the original state). Then your
"experimental" settings are saved. And worst of all, unless you know which options were set in the
configuration file, you don't know what will happen. One option in Debian (and likely other distributions) is
known as "AUTOSAVE-ONCE" which saves changes only for the first time you make them with the setserial
command.
If the option "###AUTOSAVE###" is set and you manually edit serial.conf, then your editing is destroyed
when you shut down because it gets changed back to the state of setserial at shutdown. There is a way to
disable the changing of serial.conf at shutdown and that is to remove "###AUTOSAVE###" or the like from
first line of serial.conf. In the Debian distribution, the removal of "###AUTOSAVE###" from the first line
was once automatically done after the first time you shutdown just after installation. To retain this effect the
Serial HOWTO
Edit a script (required prior to version 2.15) 46