创建FC挂载脚本/etc/init.d/new_service.sh,编辑内容如下:
#!/bin/bash
command content
BEGIN INIT INFO
Provides: bszhh.com
Required-Start: $local_fs $network
Required-Stop: $local_fs
Default-Start: 2 3 4 5
Default-Stop: 0 1 6
Short-Description: tomcat service
Description: tomcat service daemon
END INIT INFO
modprobe -r qla2xxx 卸载驱动命令
modprobe qla2xxx 装载驱动命令
sleep 50
mount /dev/sdb /infokist 普通存储配置将LUN挂载到infokist目录,根据实际情况编辑
#zpool import infokist 合成备份存储配置时注释#
service dbackup3-backupd restart
service dbackup3-storaged restart
service dbackup3-controller restart
service mysql restart
service vmware_server restart
service os_server restart
service se_server restart
service control_server restart
service commservice restart
service nfs-kernel-server restart
service dbackup3-nginx restart
exit 0
说明:
FC多路径配置重启后如果出现只有一条路径,需要在脚本命令modprobe -r qla2xxx前添加如下内容,重新手动执行脚本:
test=mount |grep infokist|wc -l
;
if [ “$test” = “1” ]; then
service dbackup3-nginx stop
service os_server stop
service vmware_server stop
service xen_server stop
service kvm_server stop
service hyperv_server stop
service citrix_server stop
service fusionsphere_server stop
service h3c_server stop
service openstack_server stop
service cnware_server stop
service fusioncloud_server stop
service rhev_server stop
service cdpcontrol_server stop
service cdpdata_server stop
service zstack_server stop
service smartx_server stop
service dbackup_haserver stop
service tstack_server stop
service control_server stop
service se_server stop
service dbackup3-controller stop
service dbackup3-storaged stop
service dbackup3-backupd stop
service nfs-kernel-server stop
service commservice stop
service mysql stop
umount /infokist
#zpool export infokist FC合成备份存储配置时注释#
multipath -F
else
#zpool export infokist FC合成备份存储配置时注释#
multipath -F
fi
设置脚本权限并添加到启动脚本内。
root@MACROSAN:/etc/init.d# sudo chmod 755 new_service.sh
root@MACROSAN:/etc/init.d# cd /etc/init.d/
root@MACROSAN:/etc/init.d# sudo update-rc.d new_service.sh defaults 90
i说明:
若是需要将该脚本从启动项移除,进入/etc/init.d/目录下,执行以下命令。
sudo update-rc.d -f new_service.sh remove
重启服务器后,如果未能识别到LUN,请手动执行脚本,然后通过lsblk确认识别到并成功挂载。
sh /etc/init.d/new_service.sh