Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Replace SysV init script by a Systemd service file. #12

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ Build-Depends: debhelper (>= 9),
libglibmm-2.4-dev,
libgstreamer-plugins-base1.5-dev,
libsigc++-2.0-dev,
libwebsocketpp-dev
libwebsocketpp-dev,
dh-systemd
Standards-Version: 4.0.0
Vcs-Git: https://github.com/Kurento/kurento-media-server.git
Vcs-Browser: https://github.com/Kurento/kurento-media-server
Expand Down
122 changes: 19 additions & 103 deletions debian/kurento-media-server.default
Original file line number Diff line number Diff line change
@@ -1,109 +1,25 @@
#!/bin/dash
# File checked with ShellCheck: https://www.shellcheck.net/
# shellcheck disable=SC2034 # Ignore unused variables
# ############ BEGIN Settings for Kurento Media Server ############

# This file is loaded by "/etc/init.d/kurento-media-server", the system service
# init script that is run by the command `service kurento-media-server start`.
#
# Settings found in this file won't be loaded if Kurento Media Server is started
# manually, for example by directly executing `/usr/bin/kurento-media-server`.
# Logging level.
# See http://doc-kurento.readthedocs.io/en/latest/features/logging.html
GST_DEBUG_LEVEL="3"
GST_DEBUG="Kurento*:4,kms*:4,sdp*:4,webrtc*:4,*rtpendpoint:4,rtp*handler:4,rtpsynchronizer:4,agnosticbin:4"
GST_DEBUG_NO_COLOR=1

# Path where rotating log files will be stored.
# If this option is unset, logging will be disabled.
# Default: Unset
LOGS_PATH="/var/log/kurento-media-server"

# Maximum file size for log files, in MB.
# Default: 100
LOG_FILE_SIZE=100

# Service init script settings
# ============================
# Maximum number of log files to keep.
# Default: 10
NUMBER_LOG_FILES=10

# If not "true", the service will refuse to start
START_DAEMON="true"
# Extra options
EXTRA_OPTS=""

# Arguments that will get passed directly to the KMS executable
DAEMON_ARGS=""

# Linux user that will be owner of KMS process and generated files
DAEMON_USER="kurento"

# Path where to store log files
DAEMON_LOG_DIR="/var/log/kurento-media-server"

## System-wide destination of Kernel core dump files. See:
## https://www.kernel.org/doc/Documentation/sysctl/kernel.txt
##
## Note that in Ubuntu with Apport the default pattern is:
## |/usr/share/apport/apport %p %s %c %d %P
## and it only creates a one-time Crash Report in "/var/crash/". See:
## https://doc-kurento.readthedocs.io/en/latest/user/troubleshooting.html#media-server-crashes
##
## Uncomment this to override Apport and/or set a custom core dump destination
## into the file "/proc/sys/kernel/core_pattern":
# DAEMON_CORE_PATTERN="/tmp/core_%e_%p_%u_%t"

## Per-process max open file descriptors (set to half of system-wide max)
## Only touch this if you are a sysadmin and/or you know what you are doing!
DAEMON_MAX_FILES="$(( $(cat /proc/sys/fs/file-max) / 2 ))"

## Per-user max threads (set to Kernel hard limit)
## Only touch this if you are a sysadmin and/or you know what you are doing!
## Note: This is '-u' in Bash and '-p' in POSIX shell (like Dash)
# DAEMON_MAX_THREADS="$(ulimit -Hp)"



# Debug & logging settings
# ========================

## Default recommended logging levels
export GST_DEBUG="3,Kurento*:4,kms*:4,sdp*:4,webrtc*:4,*rtpendpoint:4,rtp*handler:4,rtpsynchronizer:4,agnosticbin:4"

## Extended logging
##
## To investigate issues in some parts of KMS, you'll want to enable additional
## logs. Check out KMS docs to see some of the **suggested levels**:
## https://doc-kurento.readthedocs.io/en/latest/features/logging.html
##
## For convenience, some of the suggested levels are provided here:
##
## Extended logging: MediaFlow{In,Out} event state changes
# export GST_DEBUG="${GST_DEBUG:-3},KurentoMediaElementImpl:5"
##
## Extended logging: WebRTC ICE candidate gathering
# export GST_DEBUG="${GST_DEBUG:-3},kmsiceniceagent:5,kmswebrtcsession:5,webrtcendpoint:4"
##
## Extended logging: Transcoding of media
# export GST_DEBUG="${GST_DEBUG:-3},Kurento*:5,agnosticbin*:5"

## Disable colored output, so logs don't contain extraneous characters
export GST_DEBUG_NO_COLOR=1

## Output path for GStreamer debug graphs (uncomment to enable graphs)
# export GST_DEBUG_DUMP_DOT_DIR="/tmp"

## Path for rotating log files (comment to disable logs)
export KURENTO_LOGS_PATH="$DAEMON_LOG_DIR"

## Maximum file size for rotating log files, in MB (default: 100 MB)
# export KURENTO_LOG_FILE_SIZE=100

## Maximum number of rotating log files to keep (default: 10 files)
# export KURENTO_NUMBER_LOG_FILES=10

## Abort the server when underlying libs print a Warning or Critical message,
## for example "GStreamer-WARNING" or "GStreamer-CRITICAL". This can be used to
## obtain a Kernel core dump or a GDB backtrace, needed to solve the issue. See:
## https://doc-kurento.readthedocs.io/en/latest/user/troubleshooting.html#gstreamer-critical-messages-in-the-log
# export G_DEBUG="fatal-warnings"



# Server settings
# ===============

unset GST_PLUGIN_PATH

## Path to the main configuration file for Kurento Media Server
# export KURENTO_CONF_FILE="/etc/kurento/kurento.conf.json"

## Path to the directory where Kurento modules can be found
# export KURENTO_MODULES_PATH="/usr/lib"

## Path to the directory where config files can be found for Kurento modules
# export KURENTO_MODULES_CONFIG_PATH="/etc/kurento/modules"
# ############ END Settings for Kurento Media Server ############
218 changes: 0 additions & 218 deletions debian/kurento-media-server.init

This file was deleted.

16 changes: 16 additions & 0 deletions debian/kurento-media-server.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=Kurento Media Server daemon
After=network.target

[Service]
Type=simple
EnvironmentFile=/etc/default/kurento-media-server
User=kurento
Group=kurento
LimitCORE=infinity
LimitNOFILE=100000
ExecStart=/usr/bin/kurento-media-server --gst-debug-level=${GST_DEBUG_LEVEL} --gst-debug=${GST_DEBUG} --logs-path=${LOGS_PATH} --log-file-size=${LOG_FILE_SIZE} --number-log-files=${NUMBER_LOG_FILES} ${EXTRA_OPTS}
Restart=always

[Install]
WantedBy=multi-user.target
2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#export DH_VERBOSE=1

%:
dh $@ --parallel
dh $@ --parallel --with=systemd

override_dh_auto_configure:
export FINAL_INSTALL_DIR=/usr
Expand Down
Loading