Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #157352
| From | Stephen Powell <zlinuxman@wowway.com> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: Getting a serial console to work on Jessie |
| Date | 2015-09-03 03:20 +0200 |
| Message-ID | <q4rm2-5k7-1@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. Thanks for the tip, Sven. I'll try to incorporate your suggestion in the next revision of my serial console document. With luck, I may get to it this weekend. Do you know a similar technique for overriding individual udev rules in a system-provided rules file? -- .''`. 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