On my ubuntu server I have an application
MyApp which runs as a daemon with its own user
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
What is te best way to solve this problem?