Mac OS X Server 10.6.8
LTO 5 磁碟機:IBM System Storage TS2250 磁帶機
HBA:ATTO 的 ExpressSAS H680
我已將 HBA 和 LTO 安裝到我的 Mac 中,並且能夠格式化和安裝磁帶媒體。我希望在系統啟動時安裝磁帶媒體。我創建了一個 LaunchAgent:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.pilotware.ltfs_mount</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/ltfs</string>
<string>/mnt/ltfs</string>
<string>-o</string>
<string>devname=0</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
但是,每當我重新啟動電腦時,磁帶媒體都不會安裝,儘管系統日誌顯示它已安裝:
9/19/12 3:15:32 PM com.pilotware.ltfs_mount[321] LTFS9015W Setting the locale to 'en_US.UTF-8'. If this is wrong, please set the LANG environment variable before starting ltfs.
9/19/12 3:15:32 PM com.pilotware.ltfs_mount[321] LTFS14000I LTFS starting, LTFS version 1.2.5 (201202290), log level 2
9/19/12 3:15:32 PM com.pilotware.ltfs_mount[321] LTFS14058I LTFS Format Specification version 2.0.0
9/19/12 3:15:32 PM com.pilotware.ltfs_mount[321] LTFS14063I Sync type is "time", Sync time is 300 sec
9/19/12 3:15:32 PM com.pilotware.ltfs_mount[321] LTFS12158I Opening a device through iokit driver (0)
9/19/12 3:15:32 PM com.pilotware.ltfs_mount[321] LTFS12118I Drive identification is 'ULT3580-HH5 '
9/19/12 3:15:32 PM com.pilotware.ltfs_mount[321] LTFS12162I Vendor ID is IBM
9/19/12 3:15:32 PM com.pilotware.ltfs_mount[321] LTFS12159I Firmware revision is BBNF
9/19/12 3:15:32 PM com.pilotware.ltfs_mount[321] LTFS12160I Drive serial is 1068062747
9/19/12 3:15:32 PM com.pilotware.ltfs_mount[321] LTFS17160I Maximum device block size is 1048576
9/19/12 3:15:32 PM com.pilotware.ltfs_mount[321] LTFS11005I Mounting the volume
9/19/12 3:15:32 PM com.pilotware.ltfs_mount[321] LTFS12015I Attempting to load the medium
9/19/12 3:15:52 PM com.pilotware.ltfs_mount[321] LTFS11031I Volume mounted successfully
如果我運行“mount”,則不會列出該安裝。如果我手動執行指令 /usr/local/bin/ltfs /mnt/ltfs -o devname=0,則磁帶媒體會掛載,掛載:
ltfs on /mnt/ltfs (osxfusefs、nodev、nosuid、同步、透過pw掛載)
我嘗試將命令封裝到 bash 腳本中並讓 LaunchAgent 執行該腳本,但沒有成功。我甚至添加了更多選項, /usr/local/bin/ltfs /mnt/ltfs -o devname=0 -o gid=20 -o uid=501 -o work_directory=/tmp/ltfs
我不確定它是否是Mac OS X(我在launchd 執行時看到/private/etc/security/audit_control 和/etc/security/audit_class 打開,但當我手動執行時則沒有)、ltfs (1.2.5) 或FUSE(IBM 使用OSXFUSE 2.3.8) 。
諷刺的是,如果我將 bash 命令放入 Automator 應用程式中,並透過系統偏好設定將其作為使用者登入項目啟動,則磁帶媒體就會掛載。
LaunchAgent的權限是正確的,我嘗試過LaunchDaemons和User LaunchAgents。我甚至編輯了 /etc/security/audit_control,刪除了策略 argv 並刪除了 naflags。
我不明白。任何幫助表示讚賞。
答案1
必須添加:
<string>-f</string>
到 LaunchAgent for FUSE 中的 ProgramArguments 陣列以將操作放在前台並正確執行...