Hello All:
we create a init script to launch all our product service.
in this script, the appman will launch our QT app, but it failed as "
XDG_RUNTIME_DIR not set in the environment."
and we copy some environment variable from weston script, then we got another error as
"Failed to create display (No such file or directory)"
Question
how we can properly start my daemon service when all the system envrionment is ready
Thanks
#! /bin/sh
superman=/opt/ecarx/apps/appman/appman
apps_params=
LOGFILE=/tmp/system.log
ifconfig eth0 192.168.8.10
cd /opt/vision_sdk
source /opt/vision_sdk/vision_sdk_load.sh
cd /opt/ecarx/apps/appman
test -x "$superman" || exit 0
# This is all a nasty hack
if test -z "$XDG_RUNTIME_DIR"; then
export XDG_RUNTIME_DIR=/run/user/root
fi
if [ ! -d "$XDG_RUNTIME_DIR" ] ; then
mkdir --parents $XDG_RUNTIME_DIR
chmod 0700 $XDG_RUNTIME_DIR
fi
case "$1" in
start)
echo -n "Starting superman daemon"
start-stop-daemon --start --exec $superman >> $LOGFILE 2>&1
echo "."
;;
stop)
echo -n "Stopping superman daemon"
start-stop-daemon --stop --quiet
echo "."
;;
*)
echo "Usage: /etc/init.d/ecarxinit {start|stop}"
exit 1
esac
exit 0

