As part of post-start of my app say "mydaemon", I want to launch a GUI app say "mygui". I am unable to do this.
I have verified user perm using xhost
, DISPLAY
variable is set correctly. conf file in /etc/init/
is given below
$ cat /etc/init/agentd.conf
description "my daemon"
author "me"
start on runlevel [2345]
stop on runlevel [016]
console output
kill timeout 60
respawn
respawn limit 3 15
# Allow some clean up time
post-stop script
env DISPLAY=:0.0
cd /home/me
./mygui
sleep 1
end script
script
cd /home/me
./myapp
end script
post-start script
env DISPLAY=:0.0
cd /home/me
./mygui
end script
Any suggestions?
xserver is up and running before this script is run. I explicitly started the service myapp after verifying lightdm. I also made the suggested changes to the script however the gui doesn't seen to come up. Any suggestions?