#1056 [RFE] autostart files should be declared as %config(noreplace)
Closed: nothingtodo a year ago by imsedgar. Opened a year ago by imsedgar.

There should be a possibility for an administrator to install a package, but configure if programs are started automatically during all user login or not. It is no option to uninstall the package, because some users may want to use it.

For example, it doesn't make sense for a user without administrative rights to get sealert messages, to get informed of updates, or to configure the firewall. Programs like baloo and tracker* creates much data access to nfs servers (when home is in nfs) which is not useful.

I regularly change files in /etc/XDG/autostart/ so that the programs are not started (X-GNOME-Autostart-enabled=false, Hidden=true). But after some time packages are updated and my changes are lost. The programs are started again when users log in to graphical desktop.

There should be a simple command to enable and disable autostart of programs. Accordingly like systemctl enable … and systemctl disable ….

But until then, it would be helpful if admins can change the files in /etc/XDG/autostart/ to disable starting some programs on log in, and that these changes are not overwritten during update of packages.

I would like to see included in the package guidelines that such autostart files must be marked with %config(noreplace).

PS: Sorry if this would not be the right forum for this.


The relevant packaging guidelines are https://docs.fedoraproject.org/en-US/packaging-guidelines/#_configuration_files

So... what you want is already there, isn't it? (Obviously something to enable and disable autostarting is well outside the scope of the packaging guidelines.)

Yes, your are right, the general rule is already there. But many packages don't declare files in /etc/xdg/autostart/as config files.

I thought maybe it would help to mention these files explicitly, possibly as examples.

Maybe one should have to specify all files in /etc/ as configuration files, unless there are reasons against it in the individual case?

What else is there to do so that the autostart configuration files are no longer overwritten?
I could create individual bug reports for all packages.
I found 42 packages on my Fedora 33 machine.

# rpm -qf $( rpm -ql --noconfig $(rpm -qf /etc/xdg/autostart/*|sort -u ) | grep -i /etc/xdg/autostart ) | sort -u | wc
42 42 1447

For what it's worth, I think rpmlint already complains if you put files under /etc and don't mark them as %config, and it also complains if you don't use %config(noreplace).

I don't see the value in mentioning any specific file when the general rule covers every single file under /etc. If there are packages which don't follow the guidelines as written, then feel free to file bugs or send patches to the maintainers. As mentioned above, the tooling already complains. Adding this specific instance would seem to me to be calling out the relevant maintainers, which I don't personally see as being particularly productive.

Most likely this is just an instance where one spec which was doing things improperly has been copied elsewhere. But perhaps the maintainers have actual reasons for not marking them that way; it's quite possible. They should of course be commenting on that fact but the one example I checked (dolphin) does not.

If only it were possible to store the files somewhere under /usr, and then provide an override mechanism in /etc similar to systemd unit files. But I doubt the desktop file mechanism works that way, and of course unless that mechanism exists it is out of scope of the packaging guidelines. (If it does happen to exist then we should be requiring that it be used.)

If only it were possible to store the files somewhere under /usr, and then provide an override mechanism in /etc similar to systemd unit files. But I doubt the desktop file mechanism works that way, and of course unless that mechanism exists it is out of scope of the packaging guidelines. (If it does happen to exist then we should be requiring that it be used.)

@kukuk has been looking into this as part of openSUSE's migration of configuration to /usr/etc. Perhaps he might have some idea if anything is going on here for XDG autostart files.

Thanks all for your comments!

I agree that autostart files in /etc are already covered by the current packaging guidelines.
I think about sending patches to the maintainers of packages that doesn't use the config specification and / or create bug reports.

I didn't find a xdg directory unter /usr, so I think there is currently no mechanism as in systemd. But it would be a good idea to do it the same way.

Metadata Update from @imsedgar:
- Issue close_status updated to: nothingtodo
- Issue status updated to: Closed (was: Open)

a year ago

For what it's worth, I think rpmlint already complains if you put files under /etc and don't mark them as %config, and it also complains if you don't use %config(noreplace).

I have downloaded https://src.fedoraproject.org/rpms/firewalld/raw/main/f/firewalld.spec and run rpmlint firewalld.spec on this file. It doen't complain about the line
%{_sysconfdir}/xdg/autostart/firewall-applet.desktop

hippogriff:~❯ rpmlint firewall-applet
firewall-applet.noarch: E: explicit-lib-dependency libnotify
firewall-applet.noarch: W: non-conffile-in-etc /etc/firewall/applet.conf
firewall-applet.noarch: W: non-conffile-in-etc /etc/xdg/autostart/firewall-applet.desktop
1 packages and 0 specfiles checked; 1 errors, 2 warnings.

True...
If I use the spec file as argument then there is no warning about the file. Only if I use the name of the installed package. Strange...

$ rpmlint firewalld.spec
firewalld.spec:36: W: unversioned-explicit-provides variant_config(Server)
firewalld.spec:37: W: unversioned-explicit-provides variant_config(Workstation)
firewalld.spec:118: E: hardcoded-library-path in %{_prefix}/lib/firewalld/zones/
firewalld.spec:119: E: hardcoded-library-path in %{_prefix}/lib/firewalld/zones/FedoraServer.xml
firewalld.spec:120: E: hardcoded-library-path in %{_prefix}/lib/firewalld/zones/FedoraWorkstation.xml
firewalld.spec:196: E: hardcoded-library-path in %{_prefix}/lib/firewalld/icmptypes/*.xml
firewalld.spec:197: E: hardcoded-library-path in %{_prefix}/lib/firewalld/ipsets/README
firewalld.spec:198: E: hardcoded-library-path in %{_prefix}/lib/firewalld/policies/*.xml
firewalld.spec:199: E: hardcoded-library-path in %{_prefix}/lib/firewalld/services/*.xml
firewalld.spec:200: E: hardcoded-library-path in %{_prefix}/lib/firewalld/zones/*.xml
firewalld.spec:201: E: hardcoded-library-path in %{_prefix}/lib/firewalld/helpers/*.xml
firewalld.spec:250: E: hardcoded-library-path in %{_prefix}/lib/firewalld
firewalld.spec:251: E: hardcoded-library-path in %{_prefix}/lib/firewalld/helpers
firewalld.spec:252: E: hardcoded-library-path in %{_prefix}/lib/firewalld/icmptypes
firewalld.spec:253: E: hardcoded-library-path in %{_prefix}/lib/firewalld/ipsets
firewalld.spec:254: E: hardcoded-library-path in %{_prefix}/lib/firewalld/policies
firewalld.spec:255: E: hardcoded-library-path in %{_prefix}/lib/firewalld/services
firewalld.spec:256: E: hardcoded-library-path in %{_prefix}/lib/firewalld/zones
0 packages and 1 specfiles checked; 16 errors, 2 warnings.
$ rpmlint firewall-applet
firewall-applet.noarch: E: explicit-lib-dependency libnotify
firewall-applet.noarch: W: non-conffile-in-etc /etc/firewall/applet.conf
firewall-applet.noarch: W: non-conffile-in-etc /etc/xdg/autostart/firewall-applet.desktop
1 packages and 0 specfiles checked; 1 errors, 2 warnings.

rpmlint will accept a specfile, a source RPM, a binary RPM or the name of an installed package. It can do different tests depending on what it was provided. The non-conffile-in-etc check requires one of the latter two, because it checks what is in the final package.

Login to comment on this ticket.

Metadata