Skip to content

Commit

Permalink
Merge pull request ceph#57 from dalgaaf/wip-da-mkcephfs-init-2
Browse files Browse the repository at this point in the history
Fix some init/mkcephfs related issues

Reviewed-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas committed Feb 14, 2013
2 parents ffbc085 + d029b93 commit e259f3c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/ceph_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ do_cmd() {
sudo su $user -c "$1" || { [ -z "$3" ] && echo "failed: '$1'" && exit 1; }
fi
else
[ $verbose -eq 1 ] && echo "--- $ssh $2 \"cd $sshdir ; ulimit -c unlimited ; $1\""
$ssh $2 "cd $sshdir ; ulimit -c unlimited ; $1" || { [ -z "$3" ] && echo "failed: '$ssh $1'" && exit 1; }
[ $verbose -eq 1 ] && echo "--- $ssh $2 \"if [ ! -d $sshdir ]; then mkdir -p $sshdir; fi; cd $sshdir ; ulimit -c unlimited ; $1\""
$ssh $2 "if [ ! -d $sshdir ]; then mkdir -p $sshdir; fi; cd $sshdir ; ulimit -c unlimited ; $1" || { [ -z "$3" ] && echo "failed: '$ssh $1'" && exit 1; }
fi
}

Expand All @@ -105,8 +105,8 @@ do_root_cmd() {
sudo bash -c "$1" || { echo "failed: '$1'" ; exit 1; }
fi
else
[ $verbose -eq 1 ] && echo "--- $rootssh $2 \"cd $sshdir ; ulimit -c unlimited ; $1\""
$rootssh $2 "cd $sshdir ; ulimit -c unlimited ; $1" || { echo "failed: '$rootssh $1'" ; exit 1; }
[ $verbose -eq 1 ] && echo "--- $rootssh $2 \"if [ ! -d $sshdir ]; then mkdir -p $sshdir; fi ; cd $sshdir ; ulimit -c unlimited ; $1\""
$rootssh $2 "if [ ! -d $sshdir ]; then mkdir -p $sshdir; fi ; cd $sshdir; ulimit -c unlimited ; $1" || { echo "failed: '$rootssh $1'" ; exit 1; }
fi
}

Expand Down
17 changes: 9 additions & 8 deletions src/init-ceph.in
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,16 @@ for name in $what; do
cmd="$binary -i $id"

get_conf pid_file "$RUN_DIR/$type.$id.pid" "pid file"
if [ -n "$pid_file" ]; then
do_cmd "mkdir -p "`dirname $pid_file`
cmd="$cmd --pid-file $pid_file"
fi

get_conf log_dir "" "log dir"
[ -n "$log_dir" ] && do_cmd "mkdir -p $log_dir"

if [ "$command" = "start" ]; then
if [ -n "$pid_file" ]; then
do_cmd "mkdir -p "`dirname $pid_file`
cmd="$cmd --pid-file $pid_file"
fi

get_conf log_dir "" "log dir"
[ -n "$log_dir" ] && do_cmd "mkdir -p $log_dir"

get_conf auto_start "" "auto start"
if [ "$auto_start" = "no" ] || [ "$auto_start" = "false" ] || [ "$auto_start" = "0" ]; then
if [ -z "$@" ]; then
Expand Down Expand Up @@ -333,7 +334,7 @@ for name in $what; do

status)
if daemon_is_running $name ceph-$type $id $pid_file; then
get_conf asok "/var/run/ceph/ceph-$type.$id.asok" "admin socket"
get_conf asok "$RUN_DIR/ceph/ceph-$type.$id.asok" "admin socket"
echo -n "$name: running "
do_cmd "$BINDIR/ceph --admin-daemon $asok version 2>/dev/null" || echo unknown
elif [ -e "$pid_file" ]; then
Expand Down

0 comments on commit e259f3c

Please sign in to comment.