Continua da questo argomento , Ho finito con:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.saltstack.minion</string>
<key>EnvironmentVariables</key>
<dict>
<key>HOME</key>
<string>/Users/quanta</string>
</dict>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/salt-minion</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
ma mi chiedo: esiste un modo per impostare la variabile HOME in modo dinamico? (invece di codice fisso - /Users/quanta
)
Ho provato ad aggiungere una chiave EnableGlobbing
al plist:
<key>EnableGlobbing</key>
<true/>
poi cambiato il valore della variabile HOME nella tilde:
<key>EnvironmentVariables</key>
<dict>
<key>HOME</key>
<string>~</string>
</dict>
e riavvia il salt-minion
. Ecco cosa ottengo:
MacBook-Pro.local:
- /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/pathname.rb:853:in 'expand_path': non-absolute home (ArgumentError)
- from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/pathname.rb:853:in 'expand_path'
- from /usr/local/Library/Homebrew/global.rb:25:in 'cache'
- from /usr/local/Library/Homebrew/global.rb:44
- from /usr/local/Library/brew.rb:17:in 'require'
- from /usr/local/Library/brew.rb:17
Sembra che l'espansione sia abilitata solo per le stringhe nelle chiavi Program
o ProgramArguments
.