0
私は月間centos wiki(方法5)のスクリプトを使用しています。数週間前に、それは変数置換が行われていないように見えるログを見て、動作を停止しました。ここで変数置換が正しく行われていない
は、スクリプトが何を説明しますものです:
[/etc/auto.master] -- append
/mnt/smb /etc/auto.smb.top --timeout=600 --ghost
[/etc/auto.smb.top] -- new file
* -fstype=autofs,-Dhost=& file:/etc/auto.smb.sub
[/etc/auto.smb.sub] -- new file
* -fstype=cifs,rw,credentials=/root/mycreds.txt,uid=500,gid=100 ://${host}/&
[/root/mycreds.txt] -- new file
usenrame=username
password=<secret password>
自動マウントする必要があり、どこかをls'ingときに、これは出力がjournalctlにあるものである:
Oct 16 10:47:47 test.example.com automount[31764]: handle_packet: type = 3
Oct 16 10:47:47 test.example.com automount[31764]: handle_packet_missing_indirect: token 436, name 172.16.1.105, request pid 31794
Oct 16 10:47:47 test.example.com automount[31764]: attempting to mount entry /mnt/smb/172.16.1.105
Oct 16 10:47:47 test.example.com automount[31764]: lookup_mount: lookup(file): looking up 172.16.1.105
Oct 16 10:47:47 test.example.com automount[31764]: lookup_mount: lookup(file): 172.16.1.105 -> -fstype=autofs,-Dhost=& file:/etc/auto.smb.sub
Oct 16 10:47:47 test.example.com automount[31764]: parse_mount: parse(sun): expanded entry: -fstype=autofs,-Dhost=172.16.1.105 file:/etc/auto.smb.sub
Oct 16 10:47:47 test.example.com automount[31764]: parse_mount: parse(sun): gathered options: fstype=autofs,-Dhost=172.16.1.105
Oct 16 10:47:47 test.example.com automount[31764]: parse_mount: parse(sun): dequote("file:/etc/auto.smb.sub") -> file:/etc/auto.smb.sub
Oct 16 10:47:47 test.example.com automount[31764]: parse_mount: parse(sun): core of entry: options=fstype=autofs,-Dhost=172.16.1.105, loc=file:/etc/auto.smb.sub
Oct 16 10:47:47 test.example.com automount[31764]: sun_mount: parse(sun): mounting root /mnt/smb, mountpoint 172.16.1.105, what file:/etc/auto.smb.sub, fstype autofs, options -Dhost=172.16.1.105
Oct 16 10:47:47 test.example.com automount[31764]: do_mount: file:/etc/auto.smb.sub /mnt/smb/172.16.1.105 type autofs options -Dhost=172.16.1.105 using module autofs
Oct 16 10:47:47 test.example.com automount[31764]: mount_mount: mount(autofs): mountpoint=/mnt/smb/172.16.1.105 what=file:/etc/auto.smb.sub options=-Dhost=172.16.1.105
Oct 16 10:47:47 test.example.com automount[31764]: automount_path_to_fifo: fifo name /run/autofs.fifo-mnt-smb-172.16.1.105
Oct 16 10:47:47 test.example.com automount[31764]: lookup_nss_read_map: reading map file /etc/auto.smb.sub
Oct 16 10:47:47 test.example.com automount[31764]: do_init: parse(sun): init gathered global options: (null)
Oct 16 10:47:47 test.example.com automount[31764]: mounted indirect on /mnt/smb/172.16.1.105 with timeout 600, freq 150 seconds
Oct 16 10:47:47 test.example.com automount[31764]: st_ready: st_ready(): state = 0 path /mnt/smb/172.16.1.105
Oct 16 10:47:47 test.example.com automount[31764]: ghosting enabled
Oct 16 10:47:47 test.example.com automount[31764]: dev_ioctl_send_ready: token = 436
Oct 16 10:47:47 test.example.com automount[31764]: mounted /mnt/smb/172.16.1.105
Oct 16 10:47:47 test.example.com automount[31764]: handle_packet: type = 3
Oct 16 10:47:47 test.example.com automount[31764]: handle_packet_missing_indirect: token 437, name Super Secret Dir, request pid 31794
Oct 16 10:47:47 test.example.com automount[31764]: attempting to mount entry /mnt/smb/172.16.1.105/Super Secret Dir
Oct 16 10:47:47 test.example.com automount[31764]: lookup_mount: lookup(file): looking up Super Secret Dir
Oct 16 10:47:47 test.example.com automount[31764]: lookup_mount: lookup(file): Super Secret Dir -> -fstype=cifs,rw,credentials=/root/mycreds.txt,uid=500,gid=100 ://${host}/&
Oct 16 10:47:47 test.example.com automount[31764]: parse_mount: parse(sun): expanded entry: -fstype=cifs,rw,credentials=/root/mycreds.txt,uid=500,gid=100 ://test/Quickbooks\ Company\ Files
Oct 16 10:47:47 test.example.com automount[31764]: parse_mount: parse(sun): gathered options: fstype=cifs,rw,credentials=/root/mycreds.txt,uid=500,gid=100
Oct 16 10:47:47 test.example.com automount[31764]: parse_mount: parse(sun): dequote("://test/Quickbooks\ Company\ Files") -> ://test/Super Secret Dir
Oct 16 10:47:47 test.example.com automount[31764]: parse_mount: parse(sun): core of entry: options=fstype=cifs,rw,credentials=/root/mycreds.txt,uid=500,gid=100, loc=://test/Super Secret Dir
Oct 16 10:47:47 test.example.com automount[31764]: sun_mount: parse(sun): mounting root /mnt/smb/172.16.1.105, mountpoint Super Secret Dir, what //test/Super Secret Dir, fstype cifs, options rw,credentials=/root/mycreds.txt,uid=500,gid=100
Oct 16 10:47:47 test.example.com automount[31764]: do_mount: //test/Super Secret Dir /mnt/smb/172.16.1.105/Super Secret Dir type cifs options rw,credentials=/root/mycreds.txt,uid=500,gid=100 using module generic
Oct 16 10:47:47 test.example.com automount[31764]: mount_mount: mount(generic): calling mkdir_path /mnt/smb/172.16.1.105/Super Secret Dir
Oct 16 10:47:47 test.example.com automount[31764]: mount_mount: mount(generic): calling mount -t cifs -s -o rw,credentials=/root/mycreds.txt,uid=500,gid=100 //test/Super Secret Dir /mnt/smb/172.16.1.105/Super Secret Dir
Oct 16 10:47:47 test.example.com automount[31764]: spawn_mount: mtab link detected, passing -n to mount
Oct 16 10:47:47 test.example.com automount[31764]: >> Unable to find suitable address.
Oct 16 10:47:47 test.example.com automount[31764]: mount(generic): failed to mount //test/Super Secret Dir (type cifs) on /mnt/smb/172.16.1.105/Super Secret Dir
Oct 16 10:47:47 test.example.com automount[31764]: dev_ioctl_send_fail: token = 437
Oct 16 10:47:47 test.example.com automount[31764]: failed to mount /mnt/smb/172.16.1.105/Super Secret Dir
Oct 16 10:47:47 test.example.com automount[31764]: handle_packet: type = 3
Oct 16 10:47:47 test.example.com automount[31764]: handle_packet_missing_indirect: token 438, name Super Secret Dir, request pid 31794
Oct 16 10:47:47 test.example.com automount[31764]: dev_ioctl_send_fail: token = 438
/var/log/messageからのログ:
Oct 16 11:02:18 test automount[31764]: handle_packet: type = 3
Oct 16 11:02:18 test automount[31764]: handle_packet_missing_indirect: token 446, name Quickbooks Company Files, request pid 2035
Oct 16 11:02:18 test automount[31764]: attempting to mount entry /mnt/smb/172.16.1.105/Quickbooks Company Files
Oct 16 11:02:18 test automount[31764]: lookup_mount: lookup(file): looking up Quickbooks Company Files
Oct 16 11:02:18 test automount[31764]: lookup_mount: lookup(file): Quickbooks Company Files -> -fstype=cifs,rw,credentials=/root/mycreds.txt,uid=500,gid=100 ://${host}/&
Oct 16 11:02:18 test automount[31764]: parse_mount: parse(sun): expanded entry: -fstype=cifs,rw,credentials=/root/mycreds.txt,uid=500,gid=100 ://test/Quickbooks\ Company\ Files
Oct 16 11:02:18 test automount[31764]: parse_mount: parse(sun): gathered options: fstype=cifs,rw,credentials=/root/mycreds.txt,uid=500,gid=100
Oct 16 11:02:18 test automount[31764]: parse_mount: parse(sun): dequote("://test/Quickbooks\ Company\ Files") -> ://test/Quickbooks Company Files
Oct 16 11:02:18 test automount[31764]: parse_mount: parse(sun): core of entry: options=fstype=cifs,rw,credentials=/root/mycreds.txt,uid=500,gid=100, loc=://test/Quickbooks Company Files
Oct 16 11:02:18 test automount[31764]: sun_mount: parse(sun): mounting root /mnt/smb/172.16.1.105, mountpoint Quickbooks Company Files, what //test/Quickbooks Company Files, fstype cifs, options rw,credentials=/root/mycreds.txt,uid=500,gid=100
Oct 16 11:02:18 test automount[31764]: do_mount: //test/Quickbooks Company Files /mnt/smb/172.16.1.105/Quickbooks Company Files type cifs options rw,credentials=/root/mycreds.txt,uid=500,gid=100 using module generic
Oct 16 11:02:18 test automount[31764]: mount_mount: mount(generic): calling mkdir_path /mnt/smb/172.16.1.105/Quickbooks Company Files
Oct 16 11:02:18 test automount[31764]: mount_mount: mount(generic): calling mount -t cifs -s -o rw,credentials=/root/mycreds.txt,uid=500,gid=100 //test/Quickbooks Company Files /mnt/smb/172.16.1.105/Quickbooks Company Files
Oct 16 11:02:18 test automount[31764]: spawn_mount: mtab link detected, passing -n to mount
Oct 16 11:02:18 test automount[31764]: >> Unable to find suitable address.
Oct 16 11:02:18 test automount[31764]: mount(generic): failed to mount //test/Quickbooks Company Files (type cifs) on /mnt/smb/172.16.1.105/Quickbooks Company Files
Oct 16 11:02:18 test automount[31764]: dev_ioctl_send_fail: token = 446
Oct 16 11:02:18 test automount[31764]: failed to mount /mnt/smb/172.16.1.105/Quickbooks Company Files
Oct 16 11:02:18 test automount[31764]: handle_packet: type = 3
Oct 16 11:02:18 test automount[31764]: handle_packet_missing_indirect: token 447, name Quickbooks Company Files, request pid 2035
Oct 16 11:02:18 test automount[31764]: dev_ioctl_send_fail: token = 447
「奇妙な」最初のことは、ホストのサブドメインのみを使用していることです。しかし、この状況ではそれほど重要ではありません。
変数名をTARGETのように変更すると、置換は空白になります:/// Quickbooks \ Company \ Files