Project

General

Profile

Bug #791

Foreman starts itself unexpectedly as a service even when you use passenger

Added by Marcello de Sousa about 8 years ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Packaging
Target version:
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

In an RPM foreman installation, logrotate will start foreman's /etc/init.d/foreman service script even when you don't want (when you run it with passenger for example).

The suggested solution is to add a "condrestart" to the startup script and modify logrotate.

Patches:
Startup script

--- a/etc/init.d/foreman        2011-03-25 14:05:24.000000000 +0100
+++ b/etc/init.d/foreman     2011-03-25 14:08:55.000000000 +0100
@@ -66,8 +66,15 @@
         stop
         start
     ;;
+    condrestart)
+        if [ -f ${FOREMAN_HOME}/tmp/pids/server.pid ]; then
+            stop
+            start
+            RETVAL=$?
+        fi
+        ;;
     *)
-        echo $"Usage: $prog {start|stop|restart}" 
+        echo $"Usage: $prog {start|stop|condrestart|restart}" 
         exit 1
 esac

Logrotate config

--- a/etc/logrotate.d/foreman    2011-03-25 14:32:28.000000000 +0100
+++ b/etc/logrotate.d/foreman    2011-03-25 14:33:26.000000000 +0100
@@ -7,6 +7,6 @@
   compress
        daily
   postrotate
-    [ -e /etc/init.d/foreman ] && /etc/init.d/foreman condrestart >/dev/null 2>&1 || true
+    [ -e /etc/init.d/foreman ] && /etc/init.d/foreman restart >/dev/null 2>&1 || true
   endscript
 }

Associated revisions

Revision 07f17d0c (diff)
Added by Marcello de Sousa about 8 years ago

Fixes #791 - Added a "condrestart" to the RPM init script and logrotate.

Signed-off-by: Marcello de Sousa <>

History

#1 Updated by Anonymous about 8 years ago

  • Status changed from New to Ready For Testing
  • % Done changed from 0 to 100

#2 Updated by Ohad Levy about 8 years ago

  • Status changed from Ready For Testing to Closed

#3 Updated by Tomer Brisker 7 months ago

  • Category changed from 21 to Packaging

Also available in: Atom PDF