SeattleTestbed / dist

ARCHIVAL: SeattleTestbed's old installer build tool and files
MIT License
0 stars 3 forks source link

Seattle installer installation check failed when building OpenWrt image. #155

Open XuefengHuang opened 9 years ago

XuefengHuang commented 9 years ago

In order to install and start seattle automatically when installing our OpenWrt image, we need to create an init.d script manually and call both the seattleinstaller and the usual start_seattle script from init.d. This is an example:

#!/bin/sh /etc/rc.common

START=99  
USE_PROCD=1

start_service() {
    export PATH=$PATH:/opt/usr/bin:/opt/usr/sbin
    export LD_LIBRARY_PATH=/opt/lib:/opt/usr/lib
    PYTHONDONTWRITEBYTECODE=TRUE
    export PYTHONDONTWRITEBYTECODE
    sh /root/seattle/install.sh --percent 40
    sh /root/seattle/start_seattle.sh 
}

However, currently seattle installer checks if seattle is installed by init.d script or crontab( https://github.com/SeattleTestbed/installer-packaging/blob/master/all-platforms/seattleinstaller.py#L1981-L2058). So although seattle is not installed, it also will show seattle has been installed because init.d script has existed on OpenWrt.

In order to let seattle works on OpenWrt, it'd be better to check node.cfg instead, just like start_seattle.sh( https://github.com/SeattleTestbed/dist/blob/master/linux/scripts/start_seattle.sh#L7). We can skip the procedure of testing if seattle is installed in the seattleinstaller.py and check node.cfg in the install.sh when detecting seattle is installing on OpenWrt devices.