Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#18780 - packages should not install example configurations files under /etc

Attached to Project: Arch Linux
Opened by Heiko Baums (cyberpatrol) - Sunday, 21 March 2010, 21:00 GMT
Last edited by Andrea Scarpino (BaSh) - Wednesday, 08 September 2010, 14:38 GMT

Details

Description:
When mpd is installed, its config file is installed as /etc/mpd.conf.example as it is called in the doc directory in the source package.
It should be installed as /etc/mpd.conf instead, so that it's removed by pacman -Rn.

After installation this file needs to be renamed to /etc/mpd.conf by the user anyway to get mpd working.

Because pacman -Rn only removes files that it has installed - in this case /etc/mpd.conf.example - it doesn't remove /etc/mpd.conf, though pacman -Rn is supposed to also remove every global configuration file.

Of course the same applies to pacman -R with the obvious exception that /etc/mpd.conf doesn't get renamed to /etc/mpd.conf.pacsave as it supposed to.
This task depends upon

Closed by  Andrea Scarpino (BaSh)
Wednesday, 08 September 2010, 14:38 GMT
Reason for closing:  Won't implement
Additional comments about closing:  this should be discuss on arch-dev-public ML
Comment by Heiko Baums (cyberpatrol) - Monday, 22 March 2010, 18:00 GMT
  • Field changed: Percent Complete (100% → 0%)
For these few exapmles which doesn't follow standards and are just unlogical and senseless a bug report should be filed upstream, not to install *.conf.examples instead of real *.conf files.

Most packages and every "main" package follow these standards and install .conf files and not example files:

clamav
gimp
gnucash
apache
lxdm
midnight commander
mkinitcpio
mysql
networkmanager
pacman
php
postfix
ppp
privoxy
sane
snort
fbsplash incl. fbsplash-scripts etc.
openssl
tor
udev
wicd
abcde
abs
bash
ca-certificates
colordiff
dhcpcd
efax-gtk
esound
f-prot
foremost
fuse
filesystem
logrotate
mailx
man-db
mdadm
e2fsprogs
mailx-heirloom
nano
glibc
ntp
rkhunter
rsnapshot
rsync
rsyslog
lm_sensors
slim
openslp
slang
smartmontools
procps
syslog-ng
wvstreams
mlocate
usb_modeswitch
vim
wget
wpa_supplicant
wvdial

Do you need more examples?

Do you really want such stupid example files for all of these packages? Do you really want to be forced to rename every single config file or every single package from *.conf.example to *.conf? What a stupid, unnecessary and senseless work! And what shall pacman's parameter -Sn be for? Wouldn't make any sense.

Such example files would only make sense if there are different configuration scenarios which require completely different config files like a firewall script e.g. which needs to be completely different on a single-position system or on a internet gateway of a network.

This isn't the case with mpd and most other package.

And does it really hurt to just change the line
install -Dm644 doc/mpdconf.example ${pkgdir}/etc/mpd.conf.example || return 1
to
install -Dm644 doc/mpdconf.example ${pkgdir}/etc/mpd.conf || return 1
in the PKGBUILD?

I think this much less work than to have every single user rename this file manually by himself and to force every user to remove this file manually after uninstalling mpd.
Comment by Aaron Griffin (phrakture) - Monday, 22 March 2010, 18:01 GMT
Reopened because I tend to agree. If it's an example, it should be installed to /usr/share or something. Example files probably shouldn't pollute /etc
Comment by Gavin Bisesi (Daenyth) - Monday, 29 March 2010, 18:01 GMT
+1 for /usr/share
Comment by Heiko Baums (cyberpatrol) - Monday, 29 March 2010, 22:04 GMT
It was even better not to install it as an example, but as a config file in /etc directly (/etc/mpd.conf).
I don't see a reason for an example file, because there's only one file and only one use case, and this config file is needed to be able to run mpd.
So why shouldn't it be installed as /etc/mpd.conf directly?
Comment by Gavin Bisesi (Daenyth) - Monday, 29 March 2010, 22:09 GMT
Not everyone that uses mpd will have it using the conf in /etc/mpd.conf. That's one way to use it but you can also use it on a per-user basis.
Comment by Heiko Baums (cyberpatrol) - Tuesday, 30 March 2010, 00:37 GMT
But in this case you can easily copy the global config file to the home directory, so that you have a global and a per user config file. It's the same with e.g. alsa, abcde and many more. It's the usual behaviour. Both install or can use a global config file, which can be copied to the home directory. If the local config file exists and the program is started by the user it uses this one, otherwise it uses the global one.

This makes uninstalling and the administration easier. Of course config files in home directories are not deleted, but the global ones can and should be deleted or renamed to *.pacsave, when a package is uninstalled. So it would make things easier and wouldn't waste disk space if mpd is run at boot time. If mpd is run by the user then having /etc/mpd.conf and ~/mpd.conf take the same disk space as /usr/share/mpd/mpd.conf.example and ~/mpd.conf.

So I still don't see a reason for having an example file instead of a real config file in /etc.

An example where example config files in /usr/share make sense is ez-ipupdate. For this program you need different config files with different options depending on the dynaminc DNS provider you are using. So there are example config files for every supported DNS provider in /usr/share/ez-ipupdate/configs. Another example would be a firewall script which needs completely different rules for different setups. But this is not the case with mpd. For mpd you need only one config file, which can be stored globally in /etc or locally in ~.
Comment by Andrea Scarpino (BaSh) - Sunday, 04 July 2010, 23:31 GMT Comment by Pierre Schmitz (Pierre) - Monday, 05 July 2010, 06:02 GMT Comment by Eric Belanger (Snowman) - Monday, 05 July 2010, 06:31 GMT
I also don't see the point of installing the examples in /usr/share instead of /etc. We should either install them in /etc with the name of the real config file or just leave them in /etc.

Using the first solution, the package would then conflict with the user-created config. I'm not sure what the best way to handle this would be: .install magic, front page news, etc ?
Comment by Heiko Baums (cyberpatrol) - Monday, 05 July 2010, 06:46 GMT
Example config files need to be installed in /etc with the name of the real config file. The second solution is the same as it is done with mpd now. That's why I filed this bug report. And I don't see any problems with user-created config files. Pacman will tell the user that this file is already existing and exit, so that the user can decide if he wants to make a backup of this file and write it back later, just delete this file or run pacman -Sf to force pacman overwriting it. This only happens during the first pacman run. During the next update it is handled by pacman as every other config file.
Comment by Andreas Radke (AndyRTR) - Saturday, 14 August 2010, 21:13 GMT
The conf sample should be put into /etc when it's almost usable. If it will be named foo.conf or foo.conf.sample is just a matter of taste.

I see no need for a strict rule here. Maybe this should be discussed on the dev public list if somebody thinks we need a common rule for this.
Comment by Heiko Baums (cyberpatrol) - Saturday, 14 August 2010, 21:23 GMT
It's not a matter of taste. That's why I opened this bug report. For the arguments, why this is not a matter of taste, read my original bug report.
And I think there must be a strict rule which says that sample config files must either be installed as foo.conf.example into /usr/share or as foo.conf into /etc. Btw., this rule is already a strict rule in the common Linux standards. The latter is to be used if a config file is necessary to get a software running and there's only one possible config file like in mpd. The first one is to be used if a config file is necessary but the software supports various config file formats like ez-ipupdate (in AUR).

Loading...