Bug#994981: /bin/systemctl: systemcdl edit doesn't work
Xavier Bestel
xavier.bestel at free.fr
Mon Sep 27 09:53:14 BST 2021
Here's what the file looked like in my editor after my edit:
=================================================================
### Editing /etc/systemd/system/systemd-logind.service.d/override.conf
### Anything between here and the comment below will become the new contents of the file
### Lines below this comment will be discarded
### /lib/systemd/system/systemd-logind.service
# # SPDX-License-Identifier: LGPL-2.1-or-later
# #
# # This file is part of systemd.
# #
# # systemd is free software; you can redistribute it and/or modify it
# # under the terms of the GNU Lesser General Public License as published by
# # the Free Software Foundation; either version 2.1 of the License, or
# # (at your option) any later version.
#
# [Unit]
# Description=User Login Management
# Documentation=man:sd-login(3)
# Documentation=man:systemd-logind.service(8)
# Documentation=man:logind.conf(5)
# Documentation=man:org.freedesktop.login1(5)
#
# Wants=user.slice modprobe at drm.service
# After=nss-user-lookup.target user.slice modprobe at drm.service
# ConditionPathExists=/lib/systemd/system/dbus.service
#
# # Ask for the dbus socket.
# Wants=dbus.socket
# After=dbus.socket
#
[Service]
Environment=SYSTEMD_BYPASS_HIBERNATION_MEMORY_CHECK=1
# BusName=org.freedesktop.login1
# CapabilityBoundingSet=CAP_SYS_ADMIN CAP_MAC_ADMIN CAP_AUDIT_CONTROL CAP_CHOWN CAP_DAC_READ_SEARCH CAP_DAC_OVERRIDE CAP_FOWNER CAP_SYS_TTY_CONFIG CAP_LINUX_IMMUTABLE
# DeviceAllow=block-* r
# DeviceAllow=char-/dev/console rw
# DeviceAllow=char-drm rw
# DeviceAllow=char-input rw
# DeviceAllow=char-tty rw
# DeviceAllow=char-vcs rw
# ExecStart=/lib/systemd/systemd-logind
# FileDescriptorStoreMax=512
# IPAddressDeny=any
/etc/systemd/system/systemd-logind.service.d/.#override.conff7a2ac17730c287d [+] 34,53 Haut
=================================================================
All comments are somewhat gray on my screen, I didn't really pay
attention to them and I just searched for the section I was interested
in "[Service]", uncommented it and added the "Environment" line I
needed.
I completely understand why you've done it this way now but I didn't
"see" it. Maybe a message telling "please pay attention to the comments
in the file you're going to edit" before launching $EDITOR would help ?
Xav
Le lundi 27 septembre 2021 à 10:39 +0200, Michael Biebl a écrit :
> I don't understand.
> You added something to the file, but not between the comments?
> Can you share a copy of this file / or at least a screenshot.
>
> The comments (and the full copy of the original unit file) are
> actually
> there to make it easier when editing an override.
> I'd like to better understand your comments regarding the bad
> ergonomics. How would you make it differently?
>
> Am 27.09.21 um 10:16 schrieb Xavier Bestel:
> > Ok, I didn't read the comments and just added the line I needed,
> > and of
> > course it didn't work.
> > Sorry for the noise; the ergonomics aren't great but I should have
> > known better.
> >
> > Xav
> >
> > Le vendredi 24 septembre 2021 à 17:43 +0200, Michael Biebl a
> > écrit :
> > > Control: tags -1 + moreinfo unreproducible
> > >
> > > Am 24.09.21 um 12:05 schrieb Xavier Bestel:
> > > > Package: systemd
> > > > Version: 247.9-1
> > > > Severity: normal
> > > > File: /bin/systemctl
> > > >
> > > > Dear Maintainer,
> > > >
> > > > When I try to edit systemd's config:
> > > > root at dev5:~# systemctl edit systemd-logind.service
> > > > Editing "/etc/systemd/system/systemd-
> > > > logind.service.d/override.conf" canceled: temporary file is
> > > > empty.
> > > >
> > > > (the systemd-logind.service.d/ folder doesn't exist)
> > >
> > > When you run that command, you should get your EDITOR started
> > > with
> > > the
> > > following text
> > >
> > >
> > > ### Editing /etc/systemd/system/systemd-
> > > logind.service.d/override.conf
> > > ### Anything between here and the comment below will become the
> > > new
> > > contents of the file
> > >
> > >
> > >
> > > ### Lines below this comment will be discarded
> > >
> > > ### /lib/systemd/system/systemd-logind.service
> > > ...
> > >
> > >
> > > If you do not actually make any changes, i.e. the file will be
> > > empty,
> > > it
> > > will be discarded. What kind of changes did you make betweenn the
> > > ###
> > > ###
> > >
> > > ###
> > > lines?
> > > Can you attach it to this bug report?
> > >
> > > fwiw, this feature works fine here. Thus marking the bug report
> > > accordingly.
> > >
> >
>
>
More information about the Pkg-systemd-maintainers
mailing list