Hi there. My init service is as follows:
#!/bin/sh /etc/rc.common
SCRIPT_NAME="MyService"
SCRIPT_PATH="/project/main.py"
LOG_FILE="/project/service.log"
START=50
STOP=50
start(){
echo "Starting $SCRIPT_NAME"
$SCRIPT_PATH >> $LOG_FILE 2>&1 &
}
stop(){
echo "Stopping $SCRIPT_NAME"
killall `basename $SCRIPT_PATH`
}
This service runs main.py from project folder. But I want to run this same file from /tmp directory. Means I want to change the working directory. How to achieve this?