0

I have an embedded device running a linux image built with Yocto. Also I have an application running on this system. I want to make daemon script for this application, so that it should start at boot, and could be started/ stopped like services in ubuntu (service app [start|stop|restart|status]).

What I have done until now:

[Unit]
Description=application

[Service]
ExecStart=/usr/bin/applicationstart
ExecStop=/usr/bin/application stopType=simple
User=root
Group=root

[Install]
WantedBy=multi-user.target

start() {
  exec blah-blah pwrOFF etc
}

stop() {
  exec blah-blah pwrON etc
}

case $1 in
  start|stop) "$1" ;;
esac

I don't know how to complete the functions start and stop, and also I don't know how to check the status. How this script should look like?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.