Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #157468
| From | Stephen Powell <zlinuxman@wowway.com> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: Getting a serial console to work on Jessie |
| Date | 2015-09-06 21:10 +0200 |
| Message-ID | <q5Nua-7Ec-23@gated-at.bofh.it> (permalink) |
| References | <q3WrU-3db-17@gated-at.bofh.it> <q4gTE-7hJ-31@gated-at.bofh.it> <q4lzY-5B5-27@gated-at.bofh.it> <q4ns6-8gJ-5@gated-at.bofh.it> <q4nV8-mO-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, 02 Sep 2015 17:29:40 -0400 (EDT), Sven Hartge wrote:
>
> systemd provides a way to override or ammend parts of units. You do this
> by creating a directory structure like this:
>
> /etc/systemd/system/foo.service.d/
>
> This will contain all additional config files for the unit
> "foo.service".
>
> For example: I don't want systemd to clear the screen on tty1 when it
> starts a new getty. The unit responsible for this TTY is named
> "getty@tty1.service". I created
>
> /etc/systemd/system/getty@tty1.service.d
>
> and put a file named "noclear.conf" in it with this content:
>
> ,----
> | [Service]
> | TTYVTDisallocate=no
> `----
>
> This will add (or change) the TTYVTDisallocate option to the unit.
> The original path to the unit is "/lib/systemd/system/getty@.service"
> and if this file is changed by a package update, its new content will be
> used.
>
> If I had copied the _whole_ file to /etc/systemd/system then the new
> version of the unit in "/lib/systemd/system" would never get used, just
> my own version. This may be fine but may also cause major problems in
> the future.
>
> This is what I meant by "future changes are preserved" as you don't just
> clobber them with your own full copy of the (then) old unit file.
>
> You can check which files are used for a unit with systemctl:
>
> systemctl cat getty@tty1.service
>
> and you will get an output like this (a bit shortened by me for this
> mail):
>
> ,----
> | # /lib/systemd/system/getty@.service
> |
> | [Unit]
> | Description=Getty on %I
> | Documentation=man:agetty(8) man:systemd-getty-generator(8)
> | Documentation=http://0pointer.de/blog/projects/serial-console.html
> | After=systemd-user-sessions.service plymouth-quit-wait.service
> | <<----8<--->>
> | [Service]
> | # the VT is cleared by TTYVTDisallocate
> | TTYVTDisallocate=yes
> | KillMode=process
> | IgnoreSIGPIPE=no
> | SendSIGHUP=yes
> |
> | # Unset locale for the console getty since the console has problems
> | # displaying some internationalized messages.
> | Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE=
> | LC_MONETARY= LC_MESSAGES= LC_
> |
> | [Install]
> | WantedBy=getty.target
> | DefaultInstance=tty1
> |
> | # /etc/systemd/system/getty@tty1.service.d/noclear.conf
> | [Service]
> | TTYVTDisallocate=no
> `----
>
> Note how my own addition shows up at the bottom.
>
> Also note how a later "TTYVTDisallocate=no" overrides the earlier
> "TTYVTDisallocate=yes".
>
> You can also use "systemd-delta" to check which units have overrides or
> extentions. And with newer systemd (Stretch and newer) you can even use
> "systemctl edit unitname" and it will create the needed directory
> structure in the correct place for you.
>
> But you are also correct that this "override feature" is a bit different
> than the normal proceedings during upgrades and dealing with
> .dpkg-{old,new,dist}.
>
> But it is the way systemd is designed and you can either work with it or
> fight it every centimeter of the way.
>
Well, Sven, that's a nice idea, but I can't get it to work for me in this
situation. I issued
systemctl edit serial-getty@ttyS0.service
and placed the following two lines into the file:
[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?
--
.''`. Stephen Powell <zlinuxman@wowway.com>
: :' :
`. `'`
`-
Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Getting a serial console to work on Jessie David Parker <dparker@utica.edu> - 2015-09-01 18:20 +0200
Re: Getting a serial console to work on Jessie Michael Biebl <biebl@debian.org> - 2015-09-01 19:20 +0200
Re: Getting a serial console to work on Jessie Michael Biebl <biebl@debian.org> - 2015-09-01 21:00 +0200
Re: Getting a serial console to work on Jessie Sven Hartge <sven@svenhartge.de> - 2015-09-01 22:00 +0200
Re: Getting a serial console to work on Jessie Stephen Powell <zlinuxman@wowway.com> - 2015-09-02 00:50 +0200
Re: Getting a serial console to work on Jessie David Parker <dparker@utica.edu> - 2015-09-02 16:10 +0200
Re: Getting a serial console to work on Jessie Sven Hartge <sven@svenhartge.de> - 2015-09-02 21:10 +0200
Re: Getting a serial console to work on Jessie Eike Lantzsch <zp6cge@gmx.net> - 2015-09-02 23:10 +0200
Re: Getting a serial console to work on Jessie Sven Hartge <sven@svenhartge.de> - 2015-09-02 23:40 +0200
Re: Getting a serial console to work on Jessie Eike Lantzsch <zp6cge@gmx.net> - 2015-09-02 23:50 +0200
Re: Getting a serial console to work on Jessie Stephen Powell <zlinuxman@wowway.com> - 2015-09-03 03:20 +0200
Re: Getting a serial console to work on Jessie Sven Hartge <sven@svenhartge.de> - 2015-09-03 09:50 +0200
Re: Getting a serial console to work on Jessie Michael Biebl <biebl@debian.org> - 2015-09-04 02:10 +0200
Re: Getting a serial console to work on Jessie Stephen Powell <zlinuxman@wowway.com> - 2015-09-04 15:20 +0200
Re: Getting a serial console to work on Jessie Stephen Powell <zlinuxman@wowway.com> - 2015-09-06 21:10 +0200
Re: Getting a serial console to work on Jessie Michael Biebl <biebl@debian.org> - 2015-09-06 22:10 +0200
Re: Getting a serial console to work on Jessie Christian Seiler <christian@iwakd.de> - 2015-09-06 23:10 +0200
Re: Getting a serial console to work on Jessie Stephen Powell <zlinuxman@wowway.com> - 2015-09-07 04:00 +0200
Re: Getting a serial console to work on Jessie David Parker <dparker@utica.edu> - 2015-09-07 16:00 +0200
Re: Getting a serial console to work on Jessie Stephen Powell <zlinuxman@wowway.com> - 2015-09-07 16:50 +0200
Re: Getting a serial console to work on Jessie Sven Hartge <sven@svenhartge.de> - 2015-09-07 17:50 +0200
Re: Getting a serial console to work on Jessie Stephen Powell <zlinuxman@wowway.com> - 2015-09-08 01:30 +0200
Re: Getting a serial console to work on Jessie Sven Hartge <sven@svenhartge.de> - 2015-09-08 14:10 +0200
Re: Getting a serial console to work on Jessie Bob Bernstein <bob@fanatick.org> - 2015-09-08 00:30 +0200
Re: Getting a serial console to work on Jessie Stephen Powell <zlinuxman@wowway.com> - 2015-09-08 13:20 +0200
Re: Getting a serial console to work on Jessie Sven Hartge <sven@svenhartge.de> - 2015-09-06 22:10 +0200
csiph-web