services module rewritten

Zbigniew Luszpinski zbiggy at o2.pl
Tue Jul 17 20:05:48 CEST 2007


Tuesday 17 of July 2007 01:03:39 Kok, Auke wrote:
> Zbigniew Luszpinski wrote:
> > Monday 16 of July 2007 22:55:38 Kok, Auke wrote:
> > This is the same situation as with:
> > http://www.lunar-linux.org/index.php?option=com_content&task=view&id=52&I
> >temid=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

c) copy-paste whole old services file to user section.
Or do cat services.old >> /etc/services (if you installed module)
Thanks to this you will not loose the entries you added over the years and 
fresh iana part will fill the gaps (the entry not existing in user section 
will be read from iana part which is in upper part of file). Another plus you 
get is now file is updatable.

Another plus of such file layout is that any module going to install service 
can add its entry to /etc/services using: (for example)
echo blob 110/blob >> /etc/services
or Lunar developer can add this line to services.lunar.tar.bz2
and then cover standard 110 port association (pop3) with blob service 
name.

> _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.

OMG
Sooner or later you would end up with this problem even if I wouldn't posted 
services module. If not you then person who encounter your services file will 
have trouble reading local changes in services.

Keeping the services file in usable order is Good Thing(tm).
In case of services module it is easy:
Just ctrl+end in any text editor and you have control of what services are 
added by you. I can not understand why you do not like it (maybe except 
forced cleaning reason) :-)

> the BEST way to make this module work is to:
>
> 1) preserve each and every entry in *any* /etc/services file

No. This is right occasion to make general cleanups and start keeping services 
in order. I think most people do not write own services file and can delete 
default one (all significant entries from default services file are preserved 
in services module).

> 2) *insert* new entries when they are missing

No. This way they will get mixed. I will loose control over services names. I 
can not do this.
I have my own entries in services too.  The services layout I presented in 
services file is optimal for me and I'm sure people will find it comfortable 
too. Thanks to my file layout I do not remove official ports. Just add entry 
above EOF so can find it and then add/remove fast without browsing/breaking 
official entries.

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

Yes. But services file is fragile thing and this way I'm sure the change will 
be made deliberately. Otherwise several angry admins with forks and torches 
would knock to my doors at night asking where are their changes to 
services :-).

> > 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...

services module is optional and is not dependency to anything. Free will to 
use it or not. There is no bad consequences if it is not installed*. I wrote 
it for myself to make services management easy.
Just posted it because I thought it would be useful to anybody so might be 
added to moonbase.

*The bad consequences will appear suddenly when you someday run a service and 
realize it does not work due to some weird reason. After deep investigation 
you'll discover old and short services file without service name/port you 
need. For example "submission 587/tcp" is missing.

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

I mean local (changes made by super) user.
The services module allows entries to be added by admin. But admin is forced 
to do it in right place. If admin will start putting junk in services, right 
order will be restored after update. No mercy because some day two group of 
users will struggle: those saying keep hands away from my services file and 
another saying service file is from middle ages - do something.

> 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.

For me it is very useful. Will keep it using from zlocal. Thank you for 
discussion.

Zbigniew


More information about the Lunar-dev mailing list