I am wondering if anyone can offer advice on how to overcome this problem. An application has a start/stop/status script which can be called directly and may also be called from a web based console which is not running as root. Provided you use one of the two possible methods the status will reflect whether you started/stopped the application.
However if you also want to make sure the app starts when the system reboots, and possibly after a failure, it seems logical to introdce a forking service into the systemd space. Now, if you start/stop the service using systemctl, the script and console correctly reflect the state of the service BUT if you stop and then start the application without using systemctl, the application is OK but systemctl status thinks the application has failed.
One possible solution that I've considered is creating a specific piece of code, with limited capability, that has setuid set with an owner of root, which would then invoke the systemctl action, which would then, in turn, run the main script. However, even with limited capability any code which uses setuid needs approval.
Is there any way of starting/stopping an application that is listed as service and telling systemd that it really is running OK/not failed.
However if you also want to make sure the app starts when the system reboots, and possibly after a failure, it seems logical to introdce a forking service into the systemd space. Now, if you start/stop the service using systemctl, the script and console correctly reflect the state of the service BUT if you stop and then start the application without using systemctl, the application is OK but systemctl status thinks the application has failed.
One possible solution that I've considered is creating a specific piece of code, with limited capability, that has setuid set with an owner of root, which would then invoke the systemctl action, which would then, in turn, run the main script. However, even with limited capability any code which uses setuid needs approval.
Is there any way of starting/stopping an application that is listed as service and telling systemd that it really is running OK/not failed.