Bug 85436 - When resuming, services are restarted before network
Summary: When resuming, services are restarted before network
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: apmd
Version: 8.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Jay Turner
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-03-02 19:20 UTC by Pekka Pessi
Modified: 2015-01-08 00:04 UTC (History)
2 users (show)

Fixed In Version: 3.0.2-19
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-05-19 20:37:33 UTC


Attachments (Terms of Use)

Description Pekka Pessi 2003-03-02 19:20:14 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020830

Description of problem:
The apmscript restarts services first, before restarting network.


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

How reproducible:
Always

Steps to Reproduce:
1. Start named on laptop. Set NET_RESTART="yes" and
   RESTORESERVICES="named" in /etc/sysconfig/apmd
2. Suspend.
3. Resume.
    

Actual Results:  Named (bind-9.2.1) tries to start, but fails because no
nw ifs (beside lo?) are available. 
    

Expected Results:  Named should be running normally. It should have been
restarted only after network is up and running.

Additional info: Here is my patch:
--- /etc/sysconfig/apm-scripts/apmscript.orig	2003-03-02 20:54:42.000000000 +0200
+++ /etc/sysconfig/apm-scripts/apmscript	2003-03-02 20:52:10.000000000 +0200
@@ -39,10 +39,15 @@
 	[ -f /etc/sysconfig/apm-scripts/apmcontinue-pre ] &&
/etc/sysconfig/apm-scripts/apmcontinue-pre
 	# Stop services that might break
 	echo "#!/bin/sh" >/var/run/apm-resume-post
+	post_services=""
+
 	if [ -n "$RESTORESERVICES" ]; then
 		for i in $RESTORESERVICES; do
 			if /sbin/service $i status &>/dev/null; then
-				echo "/sbin/service $i start" >>/var/run/apm-resume-post
+				# Make sure services are restarted in reverse order
+				# and after network has been restarted
+				post_services="/sbin/service $i start
+$post_services" 
 				/sbin/service $i stop &>/dev/null
 			fi
 		done
@@ -181,6 +186,8 @@
 	fi
 	sync
 
+	echo "$post_services" >> /var/run/apm-resume-post
+
 	[ -f /etc/sysconfig/apm-scripts/apmcontinue ] && .
/etc/sysconfig/apm-scripts/apmcontinue "$@"
 
 	[ -e /var/run/apm-resume-post ] && chmod 0755 /var/run/apm-resume-post

Comment 1 Bill Nottingham 2003-05-19 20:37:33 UTC
Fixed differently in 3.0.2-19.


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