Bug 54041 - network/netfs restart should be conditional
network/netfs restart should be conditional
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: apmd (Show other bugs)
7.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
Aaron Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-09-26 10:16 EDT by Toralf
Modified: 2007-04-18 12:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-11-16 05:46:11 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
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 05:37 EST, Toralf
no flags Details | Diff
Introduce ypbind restart in apmscript (1.56 KB, patch)
2001-11-16 05:54 EST, Toralf
no flags Details | Diff

  None (edit)
Description Toralf 2001-09-26 10:16:07 EDT
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):
3.0final-29
Comment 1 Bernhard Rosenkraenzer 2001-09-27 08:24:19 EDT
It already is. Use the NETFS_RESTART parameter in /etc/sysconfig/apmd.
Comment 2 Toralf 2001-09-27 08:35:53 EDT
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 08:44:01 EDT
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 05:35:13 EST
No change after upgrade to Red Hat Linux 7.2.
Comment 5 Toralf 2001-11-16 05:37:08 EST
Created attachment 37743 [details]
Proposed update
Comment 6 Toralf 2001-11-16 05:46:05 EST
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
suspended.
Comment 7 Bernhard Rosenkraenzer 2001-11-16 05:49:16 EST
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 05:54:41 EST
Created attachment 37744 [details]
Introduce ypbind restart in apmscript
Comment 9 Bernhard Rosenkraenzer 2001-11-16 05:59:05 EST
Use RESTORESERVICES (introduced in -35) to restart ypbind... special-casing it 
isn't needed.
Comment 10 Toralf 2001-11-16 06:09:30 EST
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 09:29:24 EST
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.