为什么 gcsfuse 安装后不返回命令提示符?

为什么 gcsfuse 安装后不返回命令提示符?

我已经成功安装通用函数集线器。当我运行它时,它会打印File system has been successfully mounted但我没有回到 shell 提示符。(参见下面的记录。)我做错了什么?

确认存储桶存在:

ybaruy_gmail_com@test-fuse:~$ gsutil ls

Updates are available for some Cloud SDK components.  To install
them, please run:
 $ gcloud components update

gs://daniella/
gs://test-daniella-nearline/
gs://test-yakov/
gs://yossi-fuse-bucket/

安装先决条件:

ybaruy_gmail_com@test-fuse:~$ sudo apt-get install wget fuse
Reading package lists... Done
Building dependency tree
Reading state information... Done
wget is already the newest version.
The following NEW packages will be installed:
  fuse
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 74.2 kB of archives.
After this operation, 179 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://security.debian.org/ wheezy/updates/main fuse amd64 2.9.0-2+deb7u2 [74.2 kB]
Fetched 74.2 kB in 0s (1,953 kB/s)
Selecting previously unselected package fuse.
(Reading database ... 20074 files and directories currently installed.)
Unpacking fuse (from .../fuse_2.9.0-2+deb7u2_amd64.deb) ...
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-3.16.0-0.bpo.4-amd64
/var/tmp/mkinitramfs_4WmsnD/scripts/local-premount/gce-disable-growroot: 7: .: Can't open /scripts/functions
Processing triggers for man-db ...
Setting up fuse (2.9.0-2+deb7u2) ...
Creating fuse group...
Adding group `fuse' (GID 105) ...
Done.
udev active, skipping device node creation.
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-3.16.0-0.bpo.4-amd64
/var/tmp/mkinitramfs_PqrQoB/scripts/local-premount/gce-disable-growroot: 7: .: Can't open /scripts/functions
ybaruy_gmail_com@test-fuse:~$ sudo adduser $USER fuse
Adding user `ybaruy_gmail_com' to group `fuse' ...
Adding user ybaruy_gmail_com to group fuse
Done.

按照说明安装 gcsfuse这里

ybaruy_gmail_com@test-fuse:~$ wget https://github.com/GoogleCloudPlatform/gcsfuse/releases/download/v0.6.0/gcsfuse_v0.6.0_linux_amd64.tar.gz
--2015-08-04 05:50:34--  https://github.com/GoogleCloudPlatform/gcsfuse/releases/download/v0.6.0/gcsfuse_v0.6.0_linux_amd64.tar.gz
Resolving github.com (github.com)... 192.30.252.129
Connecting to github.com (github.com)|192.30.252.129|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://s3.amazonaws.com/github-cloud/releases/30325550/e406280c-3aab-11e5-92fd-72a098ee49be.gz?response-content-disposition=attachment%3B%20filename%3Dgcsfuse_v0.6.0_linux_amd64.tar.gz&response-content-type=application/octet-stream&AWSAccessKeyId=AKIAISTNZFOVBIJMK3TQ&Expires=1438667495&Signature=D4Dq3DdtDIuhmhz4MYCfbIWqvbg%3D [following]
--2015-08-04 05:50:35--  https://s3.amazonaws.com/github-cloud/releases/30325550/e406280c-3aab-11e5-92fd-72a098ee49be.gz?response-content-disposition=attachment%3B%20filename%3Dgcsfuse_v0.6.0_linux_amd64.tar.gz&response-content-type=application/octet-stream&AWSAccessKeyId=AKIAISTNZFOVBIJMK3TQ&Expires=1438667495&Signature=D4Dq3DdtDIuhmhz4MYCfbIWqvbg%3D
Resolving s3.amazonaws.com (s3.amazonaws.com)... 54.231.2.40
Connecting to s3.amazonaws.com (s3.amazonaws.com)|54.231.2.40|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4002177 (3.8M) [application/octet-stream]
Saving to: `gcsfuse_v0.6.0_linux_amd64.tar.gz'

100%[========================================================================================>] 4,002,177   1.09M/s   in 4.2s

2015-08-04 05:50:40 (939 KB/s) - `gcsfuse_v0.6.0_linux_amd64.tar.gz' saved [4002177/4002177]

ybaruy_gmail_com@test-fuse:~$ sudo tar -C /usr/local/bin -zxf gcsfuse_v0.6.0_linux_amd64.tar.gz
ybaruy_gmail_com@test-fuse:~$ sudo chmod g+rw /dev/fuse
ybaruy_gmail_com@test-fuse:~$ sudo chgrp fuse /dev/fuse
ybaruy_gmail_com@test-fuse:~$ mkdir mount-point
ybaruy_gmail_com@test-fuse:~$ logout
Connection to 146.148.112.111 closed.

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Session stopped
    - Press <return> to exit tab
    - Press r to restart session
    - Press s to save terminal output to file





RECONNECTING, PLEASE WAIT...




X11 forwarding request failed on channel 0
Linux test-fuse 3.16.0-0.bpo.4-amd64 #1 SMP Debian 3.16.7-ckt11-1~bpo70+1 (2015-06-08) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Aug  4 05:45:22 2015 from pavel.iucc.ac.il

运行 gcsfuse:

ybaruy_gmail_com@test-fuse:~$ gcsfuse yossi-fuse-bucket mount-point
2015/08/04 05:51:44.524655 Warning: low file rlimit of 1024 will cause cached content to be frequently evicted. Consider raising with `ulimit -n`.
2015/08/04 05:51:44.954706 File system has been successfully mounted.

答案1

预计该gcsfuse命令不会返回到 shell — 它会在前台运行,直到文件系统被卸载(使用fusermount -u)或它收到SIGINT,通常是通过您按 Ctrl-C。请参阅文档更多细节。

如果您想在文件系统在前台运行时与其交互,则需要打开另一个 SSH 会话并在那里执行此操作。或者,您可以使用类似daemon将 gcsfuse 变成在后台运行的守护进程,甚至在你的 中设置它fstab。请参阅名为“作为守护进程运行”有关详细信息,请参阅文档。

相关内容