niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
· nixdoc.net · man pages · Linux HOWTOs · FreeBSD Tips · Forums
navigation Forum index » *nix » Linux » Distributions » Mandrake
cups, nfslock, and lpinfo in Mandriva 2006
Post new topic   Reply to topic Page 1 of 1 [7 Posts] View previous topic :: View next topic
Author Message
David Mathog
*nix forums Guru Wannabe


Joined: 23 Feb 2005
Posts: 145

PostPosted: Mon Jul 17, 2006 7:08 pm    Post subject: cups, nfslock, and lpinfo in Mandriva 2006 Reply with quote

On a stock Mandriva 2006 system nfslock starts before cups (S14 vs S15).
If by bad luck nfslock grabs port 631 cups won't start. As Murphy
commands, this happens often enough to be a problem. That would
be bad enough, but when cups fails to start the program lpinfo
then goes batshit and sucks up a lot of CPU time. You can see when
this happens during a boot sequence because following the "failed"
for cups the system just crawls along and takes at least 2-3x
longer before a login prompt appears.

The "fix" is to swap the start order, for instance cups to S14
and nfslock to S15.

Can the Mandriva folks please change this, preferably with a patch for
nfslock/cups so that cups stands a better chance of starting "out of the
box"?

Thanks,

David Mathog
Back to top
Robert M. Riches Jr.
*nix forums Guru


Joined: 22 Feb 2005
Posts: 480

PostPosted: Mon Jul 17, 2006 7:50 pm    Post subject: Re: cups, nfslock, and lpinfo in Mandriva 2006 Reply with quote

On 2006-07-17, David Mathog <mathog@caltech.edu> wrote:
Quote:
On a stock Mandriva 2006 system nfslock starts before cups (S14 vs S15).
If by bad luck nfslock grabs port 631 cups won't start. As Murphy
commands, this happens often enough to be a problem. That would
be bad enough, but when cups fails to start the program lpinfo
then goes batshit and sucks up a lot of CPU time. You can see when
this happens during a boot sequence because following the "failed"
for cups the system just crawls along and takes at least 2-3x
longer before a login prompt appears.

The "fix" is to swap the start order, for instance cups to S14
and nfslock to S15.

Can the Mandriva folks please change this, preferably with a patch for
nfslock/cups so that cups stands a better chance of starting "out of the
box"?

An alternative fix for this is to modify /etc/sysconfig/nfs
to use static port numbers:

*** /etc/sysconfig/nfs.~1~ 2005-08-23 10:52:28.000000000 -0700
--- /etc/sysconfig/nfs 2006-02-18 11:48:55.000000000 -0800
***************
*** 8,14 ****
# MOUNTD_OPTIONS=

# Pin mountd to a given port rather than random one from portmapper
! # MOUNTD_PORT=4002

# Don't advertise TCP for mount.
# MOUNTD_TCP=no
--- 8,14 ----
# MOUNTD_OPTIONS=

# Pin mountd to a given port rather than random one from portmapper
! MOUNTD_PORT=4002

# Don't advertise TCP for mount.
# MOUNTD_TCP=no
***************
*** 34,50 ****
# NFS_QS=262144

# Set fixed ports for lockd
! # LOCKD_TCPPORT=4001
! # LOCKD_UDPPORT=4001

# Set fixed port for remote quota server port
# RQUOTAD_PORT=""

# Set fixed port for statd
! # STATD_PORT=4000

# Set fixed port for statd (outgoing)
! # STATD_OUTGOING_PORT=4000

# Set statd hostname
# STATD_HOSTNAME=
--- 34,50 ----
# NFS_QS=262144

# Set fixed ports for lockd
! LOCKD_TCPPORT=4001
! LOCKD_UDPPORT=4001

# Set fixed port for remote quota server port
# RQUOTAD_PORT=""

# Set fixed port for statd
! STATD_PORT=4000

# Set fixed port for statd (outgoing)
! STATD_OUTGOING_PORT=4003

# Set statd hostname
# STATD_HOSTNAME=

The static port numbers should eliminate the risk of NFS
choosing port 631.

Please note if you're going all static, the two STATD port
numbers have to be different.

I originally did this back when I used the default pathetic
Snorewall, er Shorewall, configuration interface. Each time
my NFS server booted, I would have to manually enter the
randomly-selected port numbers via mcc.

One downside to this is it makes it certain (rather than a
roll of the dice) that chkrootkit's bindshell test will give
a false positive. To work around that, a wrapper script can
disable that test.

HTH

--
Robert Riches
spamtrap42@verizon.net
(Yes, that is one of my email addresses.)
Back to top
Bit Twister
*nix forums Guru


Joined: 19 Feb 2005
Posts: 1546

PostPosted: Mon Jul 17, 2006 8:55 pm    Post subject: Re: cups, nfslock, and lpinfo in Mandriva 2006 Reply with quote

On Mon, 17 Jul 2006 19:50:36 GMT, Robert M. Riches Jr. wrote:
Quote:

I originally did this back when I used the default pathetic
Snorewall, er Shorewall, configuration interface. Each time
my NFS server booted, I would have to manually enter the
randomly-selected port numbers via mcc.

My solution for those kinds of problems, is to run an init script
before shorewall to toggle values in /etc/shorewall/params and use
the custom variables in the /etc/shorwall files.
Back to top
David Mathog
*nix forums Guru Wannabe


Joined: 23 Feb 2005
Posts: 145

PostPosted: Mon Jul 17, 2006 10:04 pm    Post subject: Re: cups, nfslock, and lpinfo in Mandriva 2006 Reply with quote

Bit Twister wrote:
Quote:
On Mon, 17 Jul 2006 19:50:36 GMT, Robert M. Riches Jr. wrote:
I originally did this back when I used the default pathetic
Snorewall, er Shorewall, configuration interface. Each time
my NFS server booted, I would have to manually enter the
randomly-selected port numbers via mcc.

My solution for those kinds of problems, is to run an init script
before shorewall to toggle values in /etc/shorewall/params and use
the custom variables in the /etc/shorwall files.


For the case at hand I'd have been happy if chkconfig had in addition
to --del --add etc a few extra switches to allow seeing/changing
the chkconfig lines like this one:

# chkconfig: 345 14 86

in the files in /etc/rc.d/init.d. For instance:

chkconfig --showstart LEVEL
--showstop

would show the order in which things start/stop in runlevel LEVEL (as
opposed to using grep for "chkconfig" in /etc/rc.d/init.d or ls in
the level directory). The syntax might be:

S03 iptables
S05 lm_sensors
S10 network
S10 sensor_monitor
S11 portmap
etc.

And then of course the one command that would have made my
life a lot simpler here:

chkconfig --modify <name> levels start stop

ie, in this case:

chkconfig --modify nfslock 345 16 86

Which would rewrite the chkconfig line in the nfslock file. Hmm,
it would be nice if it would just write such a line in other init files,
if one wasn't already present.

The biggest problem I see with this extension is that careless
updates might stomp on the modified /etc/rc.d/init.d file.

Regards,

David Mathog
Back to top
Bit Twister
*nix forums Guru


Joined: 19 Feb 2005
Posts: 1546

PostPosted: Mon Jul 17, 2006 10:49 pm    Post subject: Re: cups, nfslock, and lpinfo in Mandriva 2006 Reply with quote

On Mon, 17 Jul 2006 15:04:26 -0700, David Mathog wrote:
Quote:

Which would rewrite the chkconfig line in the nfslock file. Hmm,
it would be nice if it would just write such a line in other init files,
if one wasn't already present.

The biggest problem I see with this extension is that careless
updates might stomp on the modified /etc/rc.d/init.d file.

Yep, that is why I try to never modify files system scripts.
I just call my script for touchups.
Back to top
Robert M. Riches Jr.
*nix forums Guru


Joined: 22 Feb 2005
Posts: 480

PostPosted: Tue Jul 18, 2006 3:05 am    Post subject: Re: cups, nfslock, and lpinfo in Mandriva 2006 Reply with quote

On 2006-07-17, Bit Twister <BitTwister@mouse-potato.com> wrote:
Quote:
On Mon, 17 Jul 2006 15:04:26 -0700, David Mathog wrote:

Which would rewrite the chkconfig line in the nfslock file. Hmm,
it would be nice if it would just write such a line in other init files,
if one wasn't already present.

The biggest problem I see with this extension is that careless
updates might stomp on the modified /etc/rc.d/init.d file.

Yep, that is why I try to never modify files system scripts.
I just call my script for touchups.

That sounds like a good idea, but I would guess it is pretty
time consuming to write a script to modify the system
scripts. I'm lazy, so I keep an RCS repository of the
system scripts I have modified, with tags for (at least)
initial and final version for each OS release. I
periodically run diff between my RCSed version and the in
/etc/sysconfig (or wherever). If I find a difference, I
reconcile what the system wants and what I want.

--
Robert Riches
spamtrap42@verizon.net
(Yes, that is one of my email addresses.)
Back to top
David Mathog
*nix forums Guru Wannabe


Joined: 23 Feb 2005
Posts: 145

PostPosted: Tue Jul 18, 2006 11:44 pm    Post subject: Re: cups, nfslock, and lpinfo in Mandriva 2006 Reply with quote

Robert M. Riches Jr. wrote:

Quote:
The biggest problem I see with this extension is that careless
updates might stomp on the modified /etc/rc.d/init.d file.
Yep, that is why I try to never modify files system scripts.
I just call my script for touchups.

That sounds like a good idea, but I would guess it is pretty
time consuming to write a script to modify the system
scripts. I'm lazy, so I keep an RCS repository of the
system scripts I have modified, with tags for (at least)
initial and final version for each OS release. I
periodically run diff between my RCSed version and the in
/etc/sysconfig (or wherever). If I find a difference, I
reconcile what the system wants and what I want.

Hmm, well that suggests making chkconfig a bit more like the orignal
IRIX version, where this data was stored outside. There might
be for instance:

chkconfig --backup [NAME] #default is all
chkconfig --compare [NAME] #default is all
chkconfig --restore [NAME] #default is all

In other words, when changing something one might do:

chkconfig --backup nfslock
chkconfig --modify nfslock levels start sop

test it for a bit, if it works then:

chkconfig --backup nfslock

Aftern a generic update do:

chkconfig --compare


to see which, if any files have changed chkconfig lines. Let's say
that nfslock, and only nfslock was changed:

Chkconfig Differences:
nfslock chkconfig line backup: 345 16 86
nfslock chkconfig line stored: 345 14 85
nfslock diff of remainder:
Quote:
# here be a few harmless comments

then do:

chkconfig --restore

It doesn't look all that hard to me, maybe when I've got some
free time I'll give it a shot. Hmm, should also be easy enough to
wrap a web interface around this so that drakconf or webmin can use it.

Regards,

David Mathog
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [7 Posts] View previous topic :: View next topic
The time now is Fri Sep 03, 2010 1:48 pm | All times are GMT
navigation Forum index » *nix » Linux » Distributions » Mandrake
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts cups problem Paras pradhan Debian 0 Fri Jul 21, 2006 2:10 pm
No new posts Ireland PyPy sprint 21th-27th August 2006 Michael Hudson python 0 Fri Jul 21, 2006 11:24 am
No new posts Work-needing packages report for Jul 21, 2006 wnpp@debian.org devel 0 Fri Jul 21, 2006 6:50 am
No new posts HPSBMA02133 SSRT061201 rev.1 - HP Oracle for OpenView (Of... Security Alert HP-UX 0 Thu Jul 20, 2006 6:43 pm
No new posts NYC LOCAL: Thursday 20 July through Sunday 23 July 2006 H... secretary@lxny.org FreeBSD 3 Thu Jul 20, 2006 5:58 pm

Copyright © 2004-2005 DeniX Solutions SRL
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum |  email marketing service
 
Sponsors: Floor Lamps | Braided Rugs | Turquoise Rings | Debt Help | Debt Help
Privacy Policy
[ Time: 0.0859s ][ Queries: 17 (0.0498s) ][ GZIP on - Debug on ]