Herein you will find the service / daemon portion of the project. We utilize the Apache Commons Daemon project for our service process on all supported platforms; currently Linux and Windows are supported.
Apache Daemon Windows binaries download
To hook-in to the daemon, one would get an instance of the
EngineLauncher class and call the
start() method to start the server process and
stop() to terminate it. The windows implementation using
procrun is only slightly different in that it calls
windowsService() for both start and stop (The string
start must be supplied via args with windows).
The Server / service shutdown is performed via socket connection and the shutdown token must be supplied via
args when making the request; if its not supplied, the
shutdown.token file will be opened, if it exists and is readable.
Linux daemon uses jsvc and the
- Set / export RED5_HOME environmental variable
- Edit the variables in the init.d script to match your server
- Install jsvc
sudo apt-get install jsvc
sudo yum ??
- Copy the
red5script to your init.d directory, ex.
- This step is for Systemd enabled operating systems only such as CentOS 7. Copy the
red5.servicefile into the
/etc/systemd/system/directory. Modify the file as needed, ensure the
ExecStartpath is correctly pointing to the init script.
- Install the init.d script
sudo update-rc.d red5 defaults sudo update-rc.d red5 enable
systemctl daemon-reload systemctl enable red5.service
- Start the service
service red5 start
systemctl start red5.service
- Stop the service
service red5 stop
systemctl stop red5.service
Windows daemon uses procrun (whose executable is named prunsrv.exe).
- Set the RED5_HOME environmental variable (see below Managing Windows Environment Variables for more detail)
- Edit the variables in the
install-service.batscript to match your server, ONLY if you have special requirements
- Download the windows binaries
- The most current daemon archive (since 2013) to use is named:
- Unzip the daemon archive into your red5 directory
prunsrv.exeis in your red5 home directory alongside
install-service.batto install the service (See Install Errors below for resolutions, if you encounter an error)
- Open the windows services panel
- Scroll down to
Red5 Media Server
- Start the service by clicking the start button in the UI
- Stop the service by clicking the stop button in the UI
Install Errors If you have a JRE installed and have pointed JAVA_HOME at its location, you will see this error:
C:\red5>install-service.bat Processor Architecture: "AMD64" Using Daemon: "C:\red5\\amd64\prunsrv.exe" The JAVA_HOME environment variable is not defined correctly This environment variable is needed to run this program NB: JAVA_HOME should point to a JDK not a JRE
To resolve this, remove the JAVA_HOME variable and create one for JRE_HOME. Now go back to step 6 and try again.
- To uninstall the service execute
Managing Windows Environment Variables
The RED5_HOME variable is used by Red5 and the service daemon; it is used to locate the Red5 installation. The variable must point to the Red5 install location, which may be
C:\Program Files\Red5 or something similar depending on how you installed it.
You must be an administrator to modify a system environment variable. System environment variables are defined by Windows and apply to all computer users. Changes to the system environment are written to the registry, and usually require a restart to become effective.
User Variables for User Name
Any user can add, modify, or remove a user environment variable. These variables are established by Windows Setup, by some programs, and by users. The changes are written to the registry, and are usually effective immediately. However, after a change to user environment variables is made, any open software programs should be restarted to force them to read the new registry values. The common reason to add variables is to provide data that is required for variables that you want to use in scripts.
To view or change environment variables:
My Computer, and then click
- If no
My Computerexists (Windows 10), Right-click windows logo (Start button) and select
- Click the
Advanced system settingsoption
- Click one the following options, for either a user or a system variable:
- Click New to add a new variable name and value.
- Click an existing variable, and then click Edit to change its name or value.