I am using Arch Linux.I need to start my web application automatically should the server should restart. I need to run it as user 'www'. How can I do this?
How to start process as a specific user on boot
arch linux
You need to write an init script for your web application.  (Examples for Dropbox and RTorrent.  You can find more examples if you search the wiki for add_daemon.)Your script would use su to run the application as the appropriate user.  (Init scripts run as root, so they can su to any user.)The critical line would look something likesu www -c /path/of/app &Then you would add your new daemon to the DAEMONS list in /etc/rc.conf, so it will be started automatically after booting.