Bug 54041 - network/netfs restart should be conditional
Summary: network/netfs restart should be conditional
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: apmd   
(Show other bugs)
Version: 7.2
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact: Aaron Brown
Depends On:
TreeView+ depends on / blocked
Reported: 2001-09-26 14:16 UTC by Toralf
Modified: 2007-04-18 16:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-11-16 10:46:11 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Proposed update (967 bytes, patch)
2001-11-16 10:37 UTC, Toralf
no flags Details | Diff
Introduce ypbind restart in apmscript (1.56 KB, patch)
2001-11-16 10:54 UTC, Toralf
no flags Details | Diff

Description Toralf 2001-09-26 14:16:07 UTC
Description of Problem:
The new network/netfs restart logic of apmd is really nice, but shouln't
the script also check if the service was actually running and/or if it's
enabled in chkconfig, at least for netfs. Actually, I would prefer shutdown
to be unconditional, and startup to be conditional on chkconfig.

Also, similar setup for ypbind would be useful.

Version-Release number of selected component (if applicable):

Comment 1 Bernhard Rosenkraenzer 2001-09-27 12:24:19 UTC
It already is. Use the NETFS_RESTART parameter in /etc/sysconfig/apmd.

Comment 2 Toralf 2001-09-27 12:35:53 UTC
You didn't really read the bug description, did you?

NETFS_RESTART="yes" will cause netfs to be started when resuming regardless of
whether it was actually active, or enabled via chkconfig, when suspending. I
think this is wrong as the state should remain the same after suspend + resume.
Also, you shoudn't have to change several config files to disable or enable a
service, 'chkconfig' should be enough.

Comment 3 Toralf 2001-09-27 12:44:01 UTC
To put it differently, the values of these flags should in my opinion be
intepreted as follows:

<service>_RESTART="no" : Leave <service> alone.
<service>_RESTART_"yes": Restart <service> if it was already running and/or
'chkconfig <service>' is true.

Comment 4 Toralf 2001-11-16 10:35:13 UTC
No change after upgrade to Red Hat Linux 7.2.

Comment 5 Toralf 2001-11-16 10:37:08 UTC
Created attachment 37743 [details]
Proposed update

Comment 6 Toralf 2001-11-16 10:46:05 UTC
The attached patch introduces chkconfig support in apmscript. The services will
be  always be stopped on suspend, but restarted on resume only if enabled via
'chkconfig' - all provided that the appropriate flag is set in
/etc/sysconfig/apmd, of course.

This means that the system will be brought back to the default state after
suspend, i.e. the same one as after a reboot. You could say that this is also
wrong, and that the state shouldn't be changed at all, but in many causes I want
a reset like this as I often disconnect the machine from the network while it's

Comment 7 Bernhard Rosenkraenzer 2001-11-16 10:49:16 UTC
I've changed this in -36, differently, though.
It returns things to the state they were in at suspend time; I think this is 
preferrable (do you want to start netfs even when you're on a train/plane? If 
not, simply "service netfs stop" before suspending), and more consistant with 
the other things apmd does.

Comment 8 Toralf 2001-11-16 10:54:41 UTC
Created attachment 37744 [details]
Introduce ypbind restart in apmscript

Comment 9 Bernhard Rosenkraenzer 2001-11-16 10:59:05 UTC
Use RESTORESERVICES (introduced in -35) to restart ypbind... special-casing it 
isn't needed.

Comment 10 Toralf 2001-11-16 11:09:30 UTC
Didn't notice your last change, there, until after I had attached another patch;
it will introduce similar restart support for "ypbind", but in the manner of my
first patch, not the updated logic.

Anyhow, your update sounds better; I guess it's not available for download just
yet so that I can test it. 

The only argument for my approach is that it might save the day if you issue
"netfs start" or similar by hand, then forget to stop the service, but the main
reason for updating the way I did was that implementing proper state handling
seemed like more work.

Comment 11 Toralf 2001-11-16 14:29:24 UTC
I'm looking at the apmscript in release 35 now... I rather like the way it's
structured, but can it actually work? It seems to me that e.g. "/sbin/service
netfs status" will return successfully even when the service has been stopped,
but perhaps I'm missing something obvious. (But I think it's really a
netfs/initscripts bug, not an apmd one, if I'm right.)

Note You need to log in before you can comment on or make changes to this bug.