Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora Development (http://www.linux-archive.org/fedora-development/)
-   -   Move a configuration file (http://www.linux-archive.org/fedora-development/337512-move-configuration-file.html)

Johan Cwiklinski 03-07-2010 03:55 PM

Move a configuration file
 
Hello,

I have a small question regarding a "configuration file" for BackupPC.

BackupPC requires a file for apache users. This file is referenced in
/etc/httpd/conf.d/BackupPC.conf and points to
/usr/share/BackupPC/apache.users.

I think that is a mistake, and such a file should better be placed in
/etc/BackupPC/apache.users.

If I change the path in conf.d/BackupPC.conf ; users who have modified
the .conf file will get a conf.rpmnew file ; that's fine.
The ones who did not change the .conf file will have it replaced by RPM,
breaking the apache authentication.

Any thoughts about that?

Thanks,
Johan
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Steve Grubb 03-07-2010 06:32 PM

Move a configuration file
 
On Sunday 07 March 2010 11:55:11 am Johan Cwiklinski wrote:
> If I change the path in conf.d/BackupPC.conf ; users who have modified
> the .conf file will get a conf.rpmnew file ; that's fine.
> The ones who did not change the .conf file will have it replaced by RPM,
> breaking the apache authentication.
>
> Any thoughts about that?

I think the traditional fix is to have a post install script that checks the
old location and moves/copies it to the new location. If this can be done
during a period where the config file is not getting features added, its more
likely to not cause any problems.

Also note that any change in location of important files is likely to affect SE
Linux labeling. Policy may have to get adjusted and you might need to
coordinate the change so both get pushed out at the same time.

-Steve
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Ville Skyttä 03-07-2010 06:42 PM

Move a configuration file
 
On Sunday 07 March 2010, Johan Cwiklinski wrote:

Not that I know anything about BackupPC, but:

> If I change the path in conf.d/BackupPC.conf ; users who have modified
> the .conf file will get a conf.rpmnew file ; that's fine.

If apache.users moves from /usr/share/BackupPC to /etc/BackupPC, it'll break
these setups because the old conf.d/BackupPC.conf that is left in place still
refers to the old location, no?

> The ones who did not change the .conf file will have it replaced by RPM,
> breaking the apache authentication.

...assuming apache.users was modified and the modified one is required for
authentication to work? Is apache.users a config file? If it was not
modified, nothing should break. But I'm guessing that it is a config file and
people are supposed to modify it so it's likely that these setups would break
as well.

> Any thoughts about that?

Not suitable as an update to released distro versions IMO. The way I've
handled cases like this sometime is to do it only between distro versions, and
try to do migration in package scriptlets for some conceivably common cases.
And adding a note about this to distro release notes would not hurt.

One example of such migration (that I'm not at all proud of, but AFAIK it
ended up working fine) is %post in the vdr package. Hm, I see I've put a TODO
comment to get rid of it in F-13 but have happily forgotten it... will do for
F-14 right away ;)
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

James Antill 03-08-2010 06:07 AM

Move a configuration file
 
On Sun, 2010-03-07 at 17:55 +0100, Johan Cwiklinski wrote:
> Hello,
>
> I have a small question regarding a "configuration file" for BackupPC.
>
> BackupPC requires a file for apache users. This file is referenced in
> /etc/httpd/conf.d/BackupPC.conf and points to
> /usr/share/BackupPC/apache.users.
>
> I think that is a mistake, and such a file should better be placed in
> /etc/BackupPC/apache.users.
>
> If I change the path in conf.d/BackupPC.conf ; users who have modified
> the .conf file will get a conf.rpmnew file ; that's fine.
> The ones who did not change the .conf file will have it replaced by RPM,
> breaking the apache authentication.
>
> Any thoughts about that?

To give a slightly different opinion, I'd move the users file but put a
symlink in the old place pointing to the new place ... then both old and
new config. files will work.
As other said, watch out for relabeling etc.

--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Johan Cwiklinski 03-08-2010 07:02 AM

Move a configuration file
 
Hello,

Le 07/03/2010 20:42, Ville Skyttä a écrit :
>> If I change the path in conf.d/BackupPC.conf ; users who have modified
>> the .conf file will get a conf.rpmnew file ; that's fine.
>>
> If apache.users moves from /usr/share/BackupPC to /etc/BackupPC, it'll break
> these setups because the old conf.d/BackupPC.conf that is left in place still
> refers to the old location, no?
>

You are right, indeed.

>
>> The ones who did not change the .conf file will have it replaced by RPM,
>> breaking the apache authentication.
>>
> ...assuming apache.users was modified and the modified one is required for
> authentication to work? Is apache.users a config file? If it was not
> modified, nothing should break. But I'm guessing that it is a config file and
> people are supposed to modify it so it's likely that these setups would break
> as well.
>

apache.users is not shipped by the package, it's up to the user to
create it with the appropriate command, and in the right place. By
default, .conf and README files are pointing to /usr/share/BackupPC.

>
>> Any thoughts about that?
>>
> Not suitable as an update to released distro versions IMO. The way I've
> handled cases like this sometime is to do it only between distro versions, and
> try to do migration in package scriptlets for some conceivably common cases.
> And adding a note about this to distro release notes would not hurt.
>
> One example of such migration (that I'm not at all proud of, but AFAIK it
> ended up working fine) is %post in the vdr package. Hm, I see I've put a TODO
> comment to get rid of it in F-13 but have happily forgotten it... will do for
> F-14 right away ;)
>

I think this could be the better solution for that case.

A simple symlink as James has proposed would not be ok I think, since
the apache.user file is not shipped with the package, It will add a
possibly dangling symlink, I'd prefer not to do that.

I think I'll do that "the vdr way", it appears to be the most flexible
solution for my issue.

Many thanks all for your help :-)

Regards,
Johan
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel


All times are GMT. The time now is 10:57 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.