* SSHFSのインストール [#fefd5fe8]
** 前提 [#g6930467]
まずFUSEをインストールする。
** ソース [#t3c0763b]
ここから。http://fuse.sourceforge.net/sshfs.html
** SPECファイル [#z19f60f5]
Summary: sshfs
Name: sshfs-fuse
Version: 2.2
Release: 1
Source0: %{name}-%{version}.tar.gz
Group: System Environment/Base
License: GPL
BuildRoot: %{_builddir}/%{name}-root
%description
SSHFS http://fuse.sourceforge.net/sshfs.html
%define prefix /usr/local
%prep
%setup -q
%build
./configure --prefix=%{prefix}
make
%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%{prefix}/bin/sshfs
%{prefix}/lib/sshnodelay.so
%{prefix}/share/man/man1/sshfs.1
** 起動時にマウント [#q6d13cab]
/etc/fstabでオートマウントすることも出来るが、使い勝手が悪いので(http://linux.mini13i.gotdns.org/filesystem%2Fsshfs.htmlを参考の事)、ランコンスクリプトでマウントするようにする。
以下が/etc/rc.d/init.d/sshfsの内容。
#!/bin/bash
# chkconfig: 345 99 01
# description: mount/umount sshfs filesyttem
PATH=/usr/local/bin:$PATH
case "$1" in
start)
su -l taro -c "sshfs 192.168.0.1:/home/taro /home/taro/mnt"
;;
stop)
su -l taro -c "fusermount -u /home/taro/mnt"
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
** 一般ユーザでパーミッションがない場合 [#w10cd451]
chmod +x /bin/fusermount