On 03/01/2013 22:14, Oleg Moskalenko wrote: > So, what is the general recommended policy on the network services > ports in regard to /etc/rc.conf file ? If I install a port that > creates a service "foodbank", then which choice is better: > > 1) "Automatically" edit /etc/rc.conf in the port installation script > to include the line: foodbank_enable="YES", > > or: > > 2) Display a message to the user like "you must edit /etc/rc.conf to > add line foodbank=YES file" ? > > The same question applies to the port de-installation.
That's a rather different question to the original. In this case, the policy is clear: always choice 2 -- advise the admin about what to do, where necessary. Installing a port does not reliably imply intent to run it as a service and hence automatically enabling it in rc.conf is simply wrong. Although adding 'foodbank_enable="YES"' to /etc/rc.conf is such a routine action that you probably don't really need to mention it. The original question was more along the lines of 'should installing or deinstalling the port mean automatically editing /usr/local/etc/foodbank.conf ?' Well, maybe. Editing the port on deinstall only makes sense if there are several different ported applications that all use the same configuration file. Otherwise, there's no point editing the config file, since deleting the port means there's nothing left to read it. The classic example of automatically editing a config file occurs with httpd.conf when installing/deinstalling apache modules. That fulfils the multiple ports using the same config file criterion in an exemplary way. Customising a config file used exclusively by one port at install time (but only if there isn't a pre-existing config file) is more of a grey area. On the whole ports tend not to do this, citing the 'Tools not Policy' mantra. But I don't think it is actually forbidden. Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. PGP: http://www.infracaninophile.co.uk/pgpkey
signature.asc
Description: OpenPGP digital signature