Ant Media Server :: Service

Ant Media Server service daemon

License

License

Categories

Categories

Ant Build Tools
GroupId

GroupId

io.antmedia
ArtifactId

ArtifactId

ant-media-server-service
Last Version

Last Version

2.3.2
Release Date

Release Date

Type

Type

jar
Description

Description

Ant Media Server :: Service
Ant Media Server service daemon
Project Organization

Project Organization

Ant Media

Download ant-media-server-service

How to add to project

<!-- https://jarcasting.com/artifacts/io.antmedia/ant-media-server-service/ -->
<dependency>
    <groupId>io.antmedia</groupId>
    <artifactId>ant-media-server-service</artifactId>
    <version>2.3.2</version>
</dependency>
// https://jarcasting.com/artifacts/io.antmedia/ant-media-server-service/
implementation 'io.antmedia:ant-media-server-service:2.3.2'
// https://jarcasting.com/artifacts/io.antmedia/ant-media-server-service/
implementation ("io.antmedia:ant-media-server-service:2.3.2")
'io.antmedia:ant-media-server-service:jar:2.3.2'
<dependency org="io.antmedia" name="ant-media-server-service" rev="2.3.2">
  <artifact name="ant-media-server-service" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.antmedia', module='ant-media-server-service', version='2.3.2')
)
libraryDependencies += "io.antmedia" % "ant-media-server-service" % "2.3.2"
[io.antmedia/ant-media-server-service "2.3.2"]

Dependencies

compile (3)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.28
ch.qos.logback : logback-core jar 1.1.9
commons-daemon : commons-daemon jar 1.0.15

test (1)

Group / Artifact Type Version
junit : junit jar 4.13.1

Project Modules

There are no modules declared in this project.

This project is merged with Ant Media Server to make fast and easy development

Ant Media Server Service

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

Daemon Details

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).

Shutdown

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.

Setup

Linux

Linux daemon uses jsvc and the init.d script red5.

  1. Set / export RED5_HOME environmental variable
  2. Edit the variables in the init.d script to match your server
  3. Install jsvc
  • Debian sudo apt-get install jsvc
  • CentOS sudo yum ??
  1. Copy the red5 script to your init.d directory, ex. /etc/init.d/
  2. This step is for Systemd enabled operating systems only such as CentOS 7. Copy the red5.service file into the /etc/systemd/system/ directory. Modify the file as needed, ensure the ExecStart path is correctly pointing to the init script.
  3. Install the init.d script
  • Debian
sudo update-rc.d red5 defaults
sudo update-rc.d red5 enable
  • CentOS
systemctl daemon-reload
systemctl enable red5.service
  1. Start the service
  • Debian service red5 start
  • CentOS systemctl start red5.service
  1. Stop the service
  • Debian service red5 stop
  • CentOs systemctl stop red5.service

Windows

Windows daemon uses procrun (whose executable is named prunsrv.exe).

Install

  1. Set the RED5_HOME environmental variable (see below Managing Windows Environment Variables for more detail)
  2. Edit the variables in the install-service.bat script to match your server, ONLY if you have special requirements
  3. Download the windows binaries
  • The most current daemon archive (since 2013) to use is named: commons-daemon-1.0.15-bin-windows.zip
  1. Unzip the daemon archive into your red5 directory
  2. Ensure prunsrv.exe is in your red5 home directory alongside red5-service.jar
  3. Execute install-service.bat to install the service (See Install Errors below for resolutions, if you encounter an error)
  4. Open the windows services panel services.msc
  5. Scroll down to Red5 Media Server
  6. Start the service by clicking the start button in the UI
  7. 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.

Uninstall

  1. To uninstall the service execute uninstall-service.bat

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.

System Variables

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:

  • Right-click My Computer, and then click Properties.
  • If no My Computer exists (Windows 10), Right-click windows logo (Start button) and select System
  • Click the Advanced tab or Advanced system settings option
  • Click Environment variables.
  • 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.
io.antmedia

Ant Media

Media Server, Clients and SDKs

Versions

Version
2.3.2
2.3.1
2.3.0
2.2.1
2.2.0
2.1.0
2.0.0
1.9.1
1.9.0
1.8.1
1.8.0
1.7.2
1.7.1
1.7.0
1.6.2
1.6.1
1.2.3
1.2.2
1.2.1
1.2.0