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

[debian-users:35297] How to use /etc/auto.net ?



ã™ãŒã®ã§ã™ã€‚

NFS共有ã®ãƒœãƒªãƒ¥ãƒ¼ãƒ (ã¨è¨€ã†ã‚“ã§ã—ょã†ã‹?)ã‚’autofsã§ãƒžã‚¦ãƒ³ãƒˆã—よã†ã¨ã—ã¦
ã¾ã™ã€‚
debianã®autofsパッケージã«ã¯/etc/auto.netã¨ã„ã†ã‚·ã‚§ãƒ«ã‚¹ã‚¯ãƒªãƒ—トãŒã‚ã‚‹
ã®ã§ã™ãŒã€ã“ã‚Œã®ä½¿ã„æ–¹ãŒã„ã¾ã„ã¡ã‚ˆãã‚ã‹ã‚Šã¾ã›ã‚“。

JPã®MLã€æœ¬å®¶ã®MLã€googleã¨æ¤œç´¢ã—ã¦ã¿ã¾ã—ãŸãŒã€auto.netスクリプトã«é–¢ã™
る情報ãŒã¾ã‚‹ã§è¦‹ä»˜ã‹ã‚Šã¾ã›ã‚“ã§ã—ãŸã€‚
BTSã®#16332ã«showmountã®ã‚ªãƒ—ションã«é–¢ã™ã‚‹å ±å‘ŠãŒã‚ã‚Šã¾ã—ãŸãŒã€ã“れも関
ä¿‚ã‚るよã†ã«ã¯æ€ãˆã¾ã›ã‚“。

/etc/auto.masterã«ã¯

/var/autofs/misc        /etc/auto.misc
/var/autofs/net         /etc/auto.net

ã®ã‚ˆã†ã«æœ€åˆã‹ã‚‰è¨˜è¿°ã•ã‚Œã¦ã¾ã—ãŸã®ã§ã€ã“ã‚Œã¯ã“ã®ã¾ã¾ã§ã„ã„ã®ã§ã—ょã†ã€‚
ã“れ㧠/var/autofs/net/hoge を見ã«è¡Œãã¨ã€hogeã¨ã„ã†hostを見ã«è¡Œãã¾ã™ã€‚
syslogã«ã“ã†è¨˜ã•ã‚Œã¦ã¾ã™ã€‚

Nov 12 17:21:59 ore automount[6654]: lookup(program): looking up hoge

ãªã®ã§ã€/var/autofs/net/hostname/directory ã¨ã„ã†ã‚¢ã‚¯ã‚»ã‚¹ã§
automountã•ã‚Œã‚‹ã®ã‹ã¨æ€ã£ãŸã®ã§ã™ãŒã€å®Ÿéš›ã«ã€

$ ls /var/autofs/net/hoge/fuga/moge

ã¨ã€ã‚¢ã‚¯ã‚»ã‚¹ã—ã¦ã¿ã‚‹ã¨ã€syslogã«ã¯ã€

Nov 12 17:31:45 ore automount[6694]: parse(sun): dequote("/fuga/moge") -> /fuga/moge
Nov 12 17:31:45 ore automount[6694]: parse(sun): dequote("hoge:/fuga/moge") -> hoge:/fuga/moge
Nov 12 17:31:45 ore automount[6694]: parse(sun): multimount: hoge:/fuga/moge on /fuga/moge with options fstype=nfs,nonstrict,hard,intr,nodev,nosuid
Nov 12 17:31:45 ore automount[6694]: parse(sun): mounting root /var/autofs/net, mountpoint hoge/fuga/moge, what hoge:/fuga/moge, fstype nfs, options hard,intr,nodev,nosuid
Nov 12 17:31:45 ore automount[6694]: mount(nfs):  root=/var/autofs/net name=hoge/fuga/moge what=hoge:/fuga/moge, fstype=nfs, options=hard,intr,nodev,nosuid
Nov 12 17:31:45 ore automount[6694]: mount(nfs): nfs options="hard,intr,nodev,nosuid", nosymlink=0
Nov 12 17:31:45 ore automount[6694]: mount(nfs): calling mkdir_path /var/autofs/net/hoge/fuga/moge
Nov 12 17:31:45 ore automount[6694]: mount(nfs): mkdir_path hoge/fuga/moge failed: Operation not permitted
Nov 12 17:31:45 ore automount[6694]: ignoring failure of non-strict
mount

ã¨ã„ã†ã‚ˆã†ã«ãƒ­ã‚°ãŒæ®‹ã‚Šã¾ã™ã€‚autofs内ã«ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’掘るã®ã«å¤±æ•—ã—ã¦ã‚‹
よã†ã«è¦‹å—ã‘られるã®ã§ã™ãŒã€

$ ps aux | grep autofs
root      6220  0.0  0.1  1332  608 pts/6    S    16:49   0:00 /usr/sbin/automount --pid-file=/var/run/autofs/_:var_:autofs_:misc.pid --timeout=300 /var/autofs/misc file /etc/auto.misc
root      6244  0.0  0.1  1332  612 pts/6    S    16:49   0:00 /usr/sbin/automount --pid-file=/var/run/autofs/_:var_:autofs_:net.pid --timeout=300 /var/autofs/net program /etc/auto.net

ã¨ã€ã“ã®ã‚ˆã†ã«root権é™ã§å®Ÿè¡Œã•ã‚Œã¦ã„るよã†ã§ã™ã—ã€

$ ls -l /var/autofs/
åˆè¨ˆ 0
drwxr-xr-x    3 root     root            0 2002-11-12 16:49 misc
drwxr-xr-x    4 root     root            0 2002-11-12 16:49 net

ã¨ã€ãƒ‘ーミッションã«ç‰¹ã«å•é¡ŒãŒã‚ã‚‹ã¨ã¯æ€ãˆã¾ã›ã‚“。
試ã—ã« chmod 777 /var/autofs/net ã—ã¦ã¿ã¾ã—ãŸãŒã€ã‚„ã¯ã‚Šå¤‰ã‚ã‚Šã¾ã›ã‚“ã§
ã—ãŸã€‚
root(/)直下ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªä»¥å¤–ã¯ã†ã¾ãã„ã‹ãªã„ã¨ã„ã†æƒ…報もã‚ã£ãŸã®ã§ã€
host hogeã§/homeã‚’exportã—ã¦ã¿ã¾ã—ãŸãŒã€ã“れもåŒã˜ã§ã—ãŸã€‚

ã¨ã‚Šã‚ãˆãšå¿…è¦ãªã‚‚ã®ã¯auto.miscã«æ›¸ã„ã¦ã—ã¾ã£ã¦ã€ä¸€å¿œã®è§£æ±ºã¯ã—ãŸã‚“ã§
ã™ãŒã€auto.netã¯ã©ã†ã‚‚便利ãªã‚‚ã®ã®ã‚ˆã†ã§ã™ã—ã€æ­£ã—ã„使ã„方を知りãŸã„ã®
ã§ã™ã€‚
ã©ãªãŸã‹ã”存知ã®æ–¹ã¯ã„らã£ã—ゃã„ã¾ã›ã‚“ã‹?

ã“ã¡ã‚‰ã®ç’°å¢ƒã¯ã€autofsãŒå‹•ã„ã¦ã‚‹ã»ã†ãŒsidã€å…±æœ‰ã‚’exportã—ã¦ã‚‹ã»ã†ãŒ
woodyã§ã™ã€‚
関連ã—ãã†ãªãƒ‘ッケージã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã¯ä»¥ä¸‹ã®é€šã‚Šã§ã™ã€‚

autofsãŒå‹•ã„ã¦ã‚‹ãƒ›ã‚¹ãƒˆï¼š
$ dpkg -l | grep nfs
ii  nfs-common     1.0.2-1        NFS support files common to client and serve
ii  nfs-kernel-ser 1.0.2-1        Kernel NFS server support
$ dpkg -l | grep portmap
ii  portmap        5-2            The RPC portmapper
$ dpkg -l | grep autofs
ii  autofs         3.9.99-4.0.0pr A kernel-based automounter for Linux.

共有をexportã—ã¦ã‚‹ãƒ›ã‚¹ãƒˆ
$ dpkg -l | grep nfs
ii  nfs-common     1.0-2          NFS support files common to client and serve
ii  nfs-kernel-ser 1.0-2          Kernel NFS server support
$ dpkg -l | grep portmap
ii  portmap        5-2            The RPC portmapper

共有をexportã—ã¦ã‚‹ãƒ›ã‚¹ãƒˆã¯å®Ÿã¯Linux/98 2.4.19カーãƒãƒ«ã§å‹•ã„ã¦ãŸã‚Šã™ã‚‹
ã‚“ã§ã™ãŒã€æ™®é€šã«ãƒžã‚¦ãƒ³ãƒˆã§ãã‚‹ã®ã ã‹ã‚‰é–¢ä¿‚ãªã„ã§ã™ã‚ˆã­ã€‚


-- 
ç‹å¿—庵
Sugano Yoshihisa(E) <mailto:koshian@xxxxxxxxxxx>
<http://www.misao.gr.jp/~koshian/>