Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 85436 - When resuming, services are restarted before network
When resuming, services are restarted before network
Product: Red Hat Linux
Classification: Retired
Component: apmd (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Jay Turner
Depends On:
  Show dependency treegraph
Reported: 2003-03-02 14:20 EST by Pekka Pessi
Modified: 2015-01-07 19:04 EST (History)
2 users (show)

See Also:
Fixed In Version: 3.0.2-19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-05-19 16:37:33 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Pekka Pessi 2003-03-02 14:20:14 EST
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): 

How reproducible:

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 ] &&
 	# 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
 				/sbin/service $i stop &>/dev/null
@@ -181,6 +186,8 @@
+	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 16:37:33 EDT
Fixed differently in 3.0.2-19.

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