我正在編寫一個新的Python應用程序,我打算分發給幾個同事。這次我想擴大自己的視野,並嘗試按照預期(至少在某種程度上)利用Linux目錄結構,而不是像我那樣擁有一切自我包含的正常無憂無慮的態度。你能否閱讀下面的細節,如果不正確,請發表評論或者提出建議。Python應用程序目錄選擇
允許調用應用程序「土著人基金」
/usr/narf - Install location for the actual python file(s).
/usr/bin/narf - Either a softlink to the main python file above or use this location instead.
/etc/narf - Any configuration files for app narf.
/var/log/narf - Any log files for app narf.
/usr/lib - Any required libraries for app narf.
/run/narf - Any persistent (across reboot), but still temp files for app narf.
/tmp/narf - Very temp files for app narf that go away with reboot
我想我應該堅持使用的/ usr/X(例如在/ usr/bin中,而不是隻/箱),因爲我的應用程序是不是系統的關鍵,一個單純的插件。
我目前使用的是Ubuntu 16 LTS,但是其中的一部分目的是爲了嘗試將我的應用程序標準化爲任何流行的Linux發行版。
感謝您的幫助。
* UPDATE *
我想我看到了回答我的問題的至少一部分。查看/ usr,我現在看到它是一個相當不實用的目錄,幾乎與用戶級別的根目錄相似(即有bin,lib,local,sbin等,但幾乎全部都是這樣)。這使我相信我的應用程序絕對不應該存在於/ usr中,而只能存在於/ usr/bin中。