2017-10-16 2 views
0

나는 몇 달 동안 centos wiki (방법 5)의 스크립트를 사용하고 있습니다. 몇 주 전에 그것은 작동을 멈추었습니다. 로그를 살펴보면 변수 대체가 일어나지 않는 것으로 보입니다.변수 대체가 올바르게 수행되지 않습니다.

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 

: 자동 마운트해야 어딘가에을 ls'ing 때

[/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> 
다음



, 이것은 출력이 journalctl에있는 것입니다 :

다음은 스크립트를 알려줍니다 무엇을 할입니다

/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

답변