[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Getting a serial console to work on Jessie



On Sun, 06 Sep 2015 16:06:35 -0400 (EDT), Michael Biebl wrote:
> Am 06.09.2015 um 21:04 schrieb Stephen Powell:
>> ... 
>>    [Service]
>>    ExecStart=-/sbin/agetty -8 --noclear %I 38400 ibm3151
>> 
>> But when I restart the service, I get the following error:
>> 
>> systemd[1]: serial-getty@ttyS0.service: Service has more than one ExecStart= setting, which is only allowed for Type=oneshot services. Refusing.
>> 
>> I want to override "ExecStart", not add a new one.  What am I doing wrong?
> 
> By default, systemd will simply merge all drop-ins.
> In your case, ExecStart is a setting which can not be specified more
> then once. So you need to "clear" it first. The following should do the
> trick:
> 
> [Service]
> ExecStart=
> ExecStart=-/sbin/agetty -8 --noclear %I 38400 ibm3151
> 
> 
> The "ExecStart=" resets the existing setting.
> 
> ...

That works.  This is definitely a better solution than copying
serial-getty@.service from /lib/systemd/system to /etc/systemd/system
and then editing the copy in /etc/systemd/system to change the ExecStart
value.  It is better for two reasons:

(1) When systemd is serviced, I don't need to recopy and reedit the file
in order to keep my changes synced up with changes to the file made by
service to systemd.

(2) It allows two different serial ports to have different ExecStart values
for two different terminal types, for example.  Using my original method,
both serial ports would be locked into the same terminal type.

I shall change my documentation accordingly.  Thanks, Michael and Sven
for your suggestions and help.

Regards,

-- 
  .''`.     Stephen Powell    <zlinuxman@wowway.com>
 : :'  :
 `. `'`
   `-


Reply to: