Hello
i have changed/replaced the default init scripts (in RPM) with systemd one
if anyone interested in here they are:
1. Cleanup /etc/sysconfig/PlexMediaServer (remove ulimit code)
# Plex Media Server Config file.
# Set home of Plex Media Server
PLEX_MEDIA_SERVER_HOME=/usr/lib/plexmediaserver
# Set home for Plex metadata
PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="$(echo ~plex)/Library/Application Support"
# the number of plugins that can run at the same time
PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
# where the mediaserver should store the transcodes
PLEX_MEDIA_SERVER_TMPDIR=/tmp
export LD_LIBRARY_PATH="${PLEX_MEDIA_SERVER_HOME}"
export PLEX_MEDIA_SERVER_USER=$PLEX_MEDIA_SERVER_USER
export TMPDIR="${PLEX_MEDIA_SERVER_TMPDIR}"
export PLEX_MEDIA_SERVER_HOME=$PLEX_MEDIA_SERVER_HOME
export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR
export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=$PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS
export PLEX_MEDIA_SERVER_TMPDIR=$PLEX_MEDIA_SERVER_TMPDIR
export LD_LIBRARY_PATH=$PLEX_MEDIA_SERVER_HOME
export LC_ALL="en_US.UTF-8"
export LANG="en_US.UTF-8"
2. Modify /lib/systemd/system/plex.service
[Unit] Description=Plex Media Server for Linux After=network.target [Service] EnvironmentFile=-/etc/sysconfig/PlexMediaServer ExecStart=/usr/lib/plexmediaserver/start.sh KillMode=process Type=forking User=plex [Install] WantedBy=multi-user.target
reload systemd after changes with: systemctl daemon-reload
3. Create "limit" file for plex user
vi /etc/security/limits.d/plex.conf
plex soft stack 10000 plex soft nofile 4096 plex hard memlock 3000 plex soft memlock 3000
4. Modify start.sh in plexmediaserver directory
vi /usr/lib/plexmediaserver/start.sh
#!/bin/sh # Source Plex Variables [ -r /etc/sysconfig/PlexMediaServer ] && . /etc/sysconfig/PlexMediaServer /usr/lib/plexmediaserver/Plex\ Media\ Server &
Now you have a clean configuration with systemd, you can remove the old init file in /etc/init.d/
Start:
service plex start ( or systemctl start plex.service )
Stop
service plex stop ( or systemctl stop plex.service )











