2017-07-17 35 views
1

我在虛擬機上運行Ubuntu桌面16.04,我試圖使用標準的安裝說明來運行Volttron,但我一直在下列步驟後得到一個錯誤:Volttron - 拒絕以root身份運行,以防止潛在的損害

sudo apt-get update 
sudo apt-get install build-essential python-dev openssl libssl-dev libevent-dev git 
git clone https://github.com/VOLTTRON/volttron 
cd volttron 
python bootstrap.py 

我的問題是最後一步python bootstrap.py。一旦我到達這一步,我會從終端窗口收到錯誤bootstrap.py: error: refusing to run as root to prevent potential damage.

有其他人遇到過這個問題嗎?思考?

回答

0

這來自this part of bootstrap.py(和this commit

# Refuse to run as root 
if not getattr(os, 'getuid', lambda: -1)(): 
    sys.stderr.write('%s: error: refusing to run as root to prevent ' 
        'potential damage.\n' % os.path.basename(argv[0])) 
    sys.exit(77) 

因此,檢查,如果你有一個os.getuid(當前進程的實際用戶ID),因爲getattr提到:

如果指定的屬性不不存在,如果提供,則返回默認值,否則引發AttributeError

請參閱「What is difference between os.getuid() and os.geteuid()?」。
也許你的終端窗口是以root身份啓動的。 (檢查id -a輸出)

0

我有類似的問題,因爲volttron沒有權限設置虛擬ENV所以我打這樣的:

sudo chmod -R 777 /path_of_volttron_location 
相關問題