On my ubuntu server I have an application MyApp
which runs as a daemon with its own user myapp
.
Then I have a web application MyPortal
which runs in apace httpd as user www-data
. This application serves a web page with a Redeploy MyApp
button. When clicking this button I want to start the script redeploymyapp
. This script stops the MyApp deamon, upgrades the application and starts the daemon again.
The problem is, that the redeploymyapp
script needs to be executed by the user myapp
, while MyPortal is running as www-data
.
What is te best way to solve this problem?