ViolentVotan 0 Posted February 4, 2015 Posted February 4, 2015 Hello, Using the generic installation insctructions for MediaBrowserServer from the Download page, where is the PID file located? I couldnt find any mediabrowser.pid or MediaBrowserServer.pid. If none is created by default, what can I put in the /etc/opt/MediaBrowser/MediaBrowserServer/MediaBrowserServer.cfg as mine seems to be empty?
jose 73 Posted February 4, 2015 Posted February 4, 2015 I do create a pid file for the init.d centos 6.6 but for systemd service there is no pidfile
ViolentVotan 0 Posted February 5, 2015 Author Posted February 5, 2015 (edited) I do create a pid file for the init.d centos 6.6 but for systemd service there is no pidfile Aww Because I use monit to automatically keep an eye on all my services and restart them if necessary, then I have to use matching strings instead of a pid file. Edited February 5, 2015 by ViolentVotan
jose 73 Posted February 5, 2015 Posted February 5, 2015 From what i understand with systemd services you dont use pid unless you are forking or something like that. this is the first rpm package i have made so if you have any ideas on how to add one with systemd i will try and inplement it.
jose 73 Posted February 6, 2015 Posted February 6, 2015 (edited) As a quick fix edit start.sh, this should create a pid file on the data folder that the server has write rights #! /bin/sh umask 002 HOME="$(getent passwd $USER | awk -F ':' '{print $6}')" conf_file_path="MediaBrowser/MediaBrowserServer/MediaBrowserServer.cfg" program_data_path="/var/opt/MediaBrowser/MediaBrowserServer" program_path="/opt/MediaBrowser/MediaBrowserServer/bin" FFmpeg="/bin/ffmpeg" FFprobe="/bin/ffprobe" if [ -r /etc/opt/$conf_file_path ]; then echo "Reading system-wide config...." >&2 . /etc/opt/$conf_file_path fi if [ -r ~/.$conf_file_path ]; then echo "Reading user config...." >&2 . ~/.$conf_file_path fi cd "$program_path" . ../helpers/check_mono.sh cd "$program_path" ifFFmpeg="" if [[ -x $FFmpeg ]]; then ifFFmpeg="-ffmpeg $FFmpeg"; fi; ifFFprobe="" if [[ -x $FFprobe ]]; then ifFFprobe="-ffprobe $FFprobe"; fi; mkdir -p $program_data_path echo $$ > $program_data_path/MediaBrowserServer.pid exec $mono_path/bin/mono MediaBrowser.Server.Mono.exe -programdata "$program_data_path" $ifFFmpeg $ifFFprobe The only things is it wont delete the file, some code would need to be put on the service file to remove the pid on a normal stop. Edited February 6, 2015 by jose
Solution jose 73 Posted February 6, 2015 Solution Posted February 6, 2015 New packages being build should create a .pid file at $program_data_path/.MediaBrowserServer/MediaBrowserServer.pid 1
ViolentVotan 0 Posted February 9, 2015 Author Posted February 9, 2015 New packages being build should create a .pid file at $program_data_path/.MediaBrowserServer/MediaBrowserServer.pid Works, thank you!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now