Actions
Bug #791
closedForeman starts itself unexpectedly as a service even when you use passenger
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
}
Updated by Anonymous almost 15 years ago
- Status changed from New to Ready For Testing
- % Done changed from 0 to 100
Applied in changeset 07f17d0c24c0e15caeee3846401d10e22bd77a89.
Updated by Ohad Levy almost 15 years ago
- Status changed from Ready For Testing to Closed
Actions