aliyun / ossfs

Export s3fs for aliyun oss.
GNU General Public License v2.0
735 stars 152 forks source link

挂载失败时没有错误信息 #29

Closed rockuw closed 8 years ago

rockuw commented 8 years ago
root@iZ23qc6ioeeZ:~/ossfs# ./src/ossfs oss-dev-tianlong /tmp/ossfs -ourl=http://oss-dev-tianlong.oss-cn-hangzhou-internal.aliyuncs.com

root@iZ23qc6ioeeZ:~/ossfs# ./src/ossfs oss-dev-tianlong /tmp/ossfs -ourl=http://oss-dev-tianlong.oss-cn-hangzhou-internal.aliyuncs.com -f -d
[CRT] s3fs.cpp:set_s3fs_log_level(253): change debug level from [CRT] to [INF]
[INF]     s3fs.cpp:set_moutpoint_attribute(4113): PROC(uid=0, gid=0) - MountPoint(uid=0, gid=0, mode=40755)
[CRT] s3fs.cpp:s3fs_init(3323): init v1.79.6(commit:5314f18) with OpenSSL
[INF] s3fs.cpp:s3fs_check_service(3682): check services.
[INF]       curl.cpp:CheckBucket(2590): check a bucket.
[INF]       curl.cpp:prepare_url(4025): URL is http://oss-dev-tianlong.oss-cn-hangzhou-internal.aliyuncs.com/oss-dev-tianlong/
[INF]       curl.cpp:prepare_url(4057): URL changed is http://oss-dev-tianlong.oss-dev-tianlong.oss-cn-hangzhou-internal.aliyuncs.com/oss-dev-tianlong/.oss-cn-hangzhou-internal.aliyuncs.com/oss-dev-tianlong/
[INF]       curl.cpp:RequestPerform(1823): HTTP response code 400 was returned, returing EIO.
[ERR] curl.cpp:CheckBucket(2625): Check bucket failed, OSS response: <?xml version="1.0" encoding="UTF-8"?>
<Error>
  <Code>InvalidBucketName</Code>
  <Message>The specified bucket is not valid.</Message>
  <RequestId>574519588A5216A77C32A25D</RequestId>
  <HostId>oss-dev-tianlong.oss-dev-tianlong.oss-cn-hangzhou-internal.aliyuncs.com</HostId>
  <BucketName>oss-dev-tianlong.oss-dev-tianlong</BucketName>
</Error>
rockuw commented 8 years ago

目前很多初始化工作是放在fuse的init函数中,在这里面stdout和stderr都被重定向了。

解决的办法的是把初始化工作放在fuse的init之前,即ossfs的main()函数中。

不过还需要看一下标准的使用fuse的做法是什么样子。

rockuw commented 8 years ago

sshfs的init函数也是很简单的:

static void *sshfs_init(void)
#endif
{
#if FUSE_VERSION >= 26
    /* Readahead should be done by kernel or sshfs but not both */
    if (conn->async_read)
        sshfs.sync_read = 1;
#endif

    if (!sshfs.delay_connect)
        start_processing_thread();

    return NULL;
}