0
我有,如果它沒有運行啓動乘客實例的shell腳本:shell腳本啓動乘客
#!/bin/bash
/usr/sbin/lsof -i :82 > /home/var/www/site-owner/data/www/site.com/currenttest
if [ ! -s /home/var/www/site-owner/data/www/site.com/currenttest ];
then
cd /home/var/www/site-owner/data/www/site.com/current/
passenger start -p 82 -d -e production --user site-owner
fi
,如果我從根SSH環境中啓動它的作品非常好。 我試圖從crontab啓動它,它沒有以錯誤開始:「passenger_loader.sh:line 12:passenger:command not found」。
經過多個小時的谷歌搜索,我發現從root用戶和根控制檯用戶有crontab有不同的環境,但無論如何,我不明白如何使一個crontab root用戶運行腳本根控制檯用戶腳本。我開始添加
source ~/.bash_profile
source ~/.bashrc
一個腳本,但它沒有改變任何東西。
嘗試使用絕對路徑'passenger' – nameless
無名,我試過這個 - 錯誤更改爲「/ usr/bin/env:ruby_noexec_wrapper:沒有這樣的文件或目錄」 –