mkcephfs: clean up temp files, honor $TEMPDIR

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all:

commit 09c38e8edadb3a5bf470ff9b0409172e0c61e012
About introducing the new tmp directory.

TDIR=`mktemp -d -t mkcephfs.XXXXXXXXXX` || exit 1
trap "rm -rf ${TDIR}; exit" INT TERM EXIT

I think this works if running all on the same nodes.
but other nodes don't know this directory name as they don't yet have
this newly (and randomly) created directory.

e.g., while mkcephfs output
=== osd.0 ===
scp: /tmp/mkcephfs.BIvhX1RQOG/osdmap.4176: No such file or directory
scp: /tmp/mkcephfs.BIvhX1RQOG/monmap.4176: No such file or directory
...
so it will fail. A quick fix is to create the directory before scping to osds.

diff mkcephfs /usr/local/sbin/mkcephfs

193,194c193,194
< 	scp -q $osdmap $host:$osdmap
< 	scp -q $monmap $host:$monmap
---
> 	ssh $host mkdir -p $TDIR; scp -q $osdmap $host:$osdmap
> 	ssh $host mkdir -p $TDIR; scp -q $monmap $host:$monmap

I initially thought that the below statement further down the line
if [ "$type" = "osd" ]; then
... scp $TDIR/keyring.osd.$id $user@$host:$keyring ...

caused the $TDIR to be missing, but the missing tmp directory was
alerted back in the line 193.
(It seems the script is able to be started on any nodes, but I'm a bit confused)

Also, in the line 193, scp -q $conf $host:$conf
I don't think we check whether nodes have config directory, e.g., for
-c /etc/ceph/ceph.conf, we don't check /etc/ceph directory?
and so the other custom directory would also fail, too I think.

Thanks
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux