Linux
Linux Packages setup automatic lauch during installation.
So if you use them, you should not have to do anything yourself.
But you can read a text below to understand installation process.
Create special user to launch server and render processes. Lets name him render.
# useradd render
This command will create him. Next scripts use this user name.
Ensure that this user is not disabled by default on some systems.
There are some bash scripts in cgru/afanasy/init
directory.
They can help you to setup automatic server and render launch.
# ./initlinks.sh [options] afserver
# ./initlinks.sh [options] afrender
Launching this script with no arguments will outputs help.
You can specify dependences in depends_afrender_* and depends_afserver_* files for server and render.
This command creates a script in /etc/init.d directory to a Afanasy application.
Puts links in /etc/rc?.d directories to provide service starting and stopping.
See script file for details.
After this afanasy services will start on machine boot and stop on shutdown automatically. Or you can start and stop them manually by following commands:
# /etc/init.d/afserver start
# /etc/init.d/afserver stop
# /etc/init.d/afrender start
# /etc/init.d/afrender stop
If you starting scripts as root user, applications will be launched by render user.
You can customize 'non root' username in cgru/afanasy/nonrootuser file.
This starting scripts also provide log rotating. Logs and pid files are stored in /var/tmp/afanasy directory.