From 7ac60147cdba1af0b066e0e3cb3ca83f9bbf4101 Mon Sep 17 00:00:00 2001 From: Ethan Jackson Date: Wed, 15 Sep 2010 01:51:15 -0700 Subject: [PATCH] debian: Init script should put core dumps in an appropriate place Before this commit the init script did not change the cwd of openvswitch processes it started. Thus, core files were created in root directory. This patch changes the cwd of openvswitch to a more reasonable location. --- AUTHORS | 1 + debian/openvswitch-switch.init | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index a5d042fb..75a6de5c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -6,6 +6,7 @@ Ben Pfaff blp@nicira.com Bryan Phillippe bp@toroki.com Dan Wendlandt dan@nicira.com David Erickson derickso@stanford.edu +Ethan Jackson ethan@nicira.com Glen Gibb grg@stanford.edu Ian Campbell Ian.Campbell@citrix.com Jean Tourrilhes jt@hpl.hp.com diff --git a/debian/openvswitch-switch.init b/debian/openvswitch-switch.init index a933a21a..d8606303 100755 --- a/debian/openvswitch-switch.init +++ b/debian/openvswitch-switch.init @@ -230,12 +230,16 @@ case "$1" in install -d -m 755 -o root -g root /var/log/openvswitch fi + if [ ! -d /var/log/openvswitch/cores ]; then + install -d -m 755 -o root -g root /var/log/openvswitch/cores + fi + # Start ovsdb-server. set -- set -- "$@" /etc/openvswitch/conf.db set -- "$@" --verbose=ANY:console:emer --verbose=ANY:syslog:err set -- "$@" --log-file=/var/log/openvswitch/ovsdb-server.log - set -- "$@" --detach --pidfile $monitor_opt + set -- "$@" --detach --no-chdir --pidfile $monitor_opt set -- "$@" --remote punix:/var/run/openvswitch/db.sock set -- "$@" --remote db:Open_vSwitch,managers set -- "$@" --private-key=db:SSL,private_key @@ -245,6 +249,7 @@ case "$1" in echo -n "Starting ovsdb-server: " start-stop-daemon --start --quiet \ --pidfile /var/run/openvswitch/ovsdb-server.pid \ + --chdir /var/log/openvswitch/cores \ --exec $ovsdb_server -- "$@" if running ovsdb-server; then echo "ovsdb-server." @@ -258,12 +263,13 @@ case "$1" in set -- set -- "$@" --verbose=ANY:console:emer --verbose=ANY:syslog:err set -- "$@" --log-file=/var/log/openvswitch/ovs-vswitchd.log - set -- "$@" --detach --pidfile $monitor_opt + set -- "$@" --detach --no-chdir --pidfile $monitor_opt set -- "$@" unix:/var/run/openvswitch/db.sock set -- "$@" $OVS_VSWITCHD_OPTS echo -n "Starting ovs-vswitchd: " start-stop-daemon --start --quiet \ --pidfile /var/run/openvswitch/ovs-vswitchd.pid \ + --chdir /var/log/openvswitch/cores \ --exec $ovs_vswitchd -- "$@" if running ovs-vswitchd; then echo "ovs-vswitchd." @@ -275,12 +281,14 @@ case "$1" in echo -n "Stopping ovs-vswitchd: " start-stop-daemon --stop --quiet --oknodo --retry 5 \ --pidfile /var/run/openvswitch/ovs-vswitchd.pid \ + --chdir /var/log/openvswitch/cores \ --exec $ovs_vswitchd echo "ovs-vswitchd." echo -n "Stopping ovsdb-server: " start-stop-daemon --stop --quiet --oknodo --retry 5 \ --pidfile /var/run/openvswitch/ovsdb-server.pid \ + --chdir /var/log/openvswitch/cores \ --exec $ovsdb_server echo "ovsdb-server." ;; -- 2.30.2