services module rewritten

Kok, Auke sofar at foo-projects.org
Tue Jul 17 01:03:39 CEST 2007


Zbigniew Luszpinski wrote:
> Monday 16 of July 2007 22:55:38 Kok, Auke wrote:
>> still don't like this - this again throws away any user-made entries
>> previously made.
> 
> Not true if you update /etc/services to 1.0 version. Have you tried new 
> services format 1.0? If so add something at right place in services and check 
> if it survives update/lining? I checked and I'm sure it does.
> 
> This is the same situation as with:
> http://www.lunar-linux.org/index.php?option=com_content&task=view&id=52&Itemid=1
> If /etc/services file is not compatible with 1.0 Lunar services format (which 
> comes with services module) the services module won't be installed and you 
> end up with message saying you need to remove /etc/services

that's counterintuitive and exactly the problem: you force the user to either 
live with an outdated version _or_ that the user tracks down which entries it 
had manually, which can be a pain if you -like me- have added several over the 
years that passed.


> The best way to make b) working is:
> 1. move /etc/services to safe place.
> 2. then remove /etc/services
> 3. lin services

NO,

the BEST way to make this module work is to:

1) preserve each and every entry in *any* /etc/services file
2) *insert* new entries when they are missing

sort of like this:

while read ENTRY PORT STUFF ; do
	if ! grep -qw $PORT /etc/services; then
		# write magic code here to insert entry in the right spot
	fi
done < new_services_file

We *have* to stop writing modules that require the user to delete stuff, 
especially when it's completely not needed.

> (services module will detect there is no /etc/services and will build new one)
> The new, created /etc/services will be saved as new Lunar 1.0 format and this 
> one is updatable. Now you can copy paste your nonstandard services to the end 
> of services file. There is special section which will hold them and protect 
> against overwritting during updates.
> Now you can lin services module again to see that entries in protected user 
> section are still there.
> 
> If you have mess in /etc/services where iana entries are mixed with local 
> entries you may not like new format which forces order and division to 
> iana/lunar/local group of entries. If so consider services file cleanup - it 
> will make future Lunar iso changes easier (in case where you not 
> overwrite /etc/services with the one from backup).

I don't mind adding a new services file to the ISO, that would be trivial, but 
that is not the discussion.

> And you can always keep an eye on a list of nonstandard entries you added 
> because you have them in one section.

again, this doesn't help users who ordered their own entries already in a way 
they prefer...

>> Either make a smart script (in POST_INSTALL) that *inserts* new entries in
>> the right location (sorted) or forget about this, you're wasting your time.
> 
> No. Sorting has no sense. I constructed services file in a way which allow 
> prioritization. Thanks to this if you want to temporary run local service on 
> for example port 110 you do not have to delete/modify pop3 in services file.
> Just add another blahblah 110/tcp definition in user section at the bottom of 
> file and you are done. If local service blahblah is not needed on 110 port 
> anymore just simply remove 110 definition from local user section.
> 
> The current layout has the following priorities:
> 1. local user services
> 2. lunar services
> 3. iana services.
> So if the same port number is in local user list and in iana list the entry 
> from user list is taken.

local user? this is a SUPERUSER file. The admin should be able to do to it what 
he wants (including deleting entries IMO).

The more I think about this the more useless I think it is. This module is a 
waste of time. I'll make sure to put an updated services file on new ISO's, but 
this module is a big mess for little gain and doesn't help many users at all.

Auke


More information about the Lunar-dev mailing list