Feature Request: Daemon for FreeBSD

Hello. Seeing in the new changelog there is a daemon for Linux and Mac OS, tried to see if it worked on my Nas4free(FreeBSD) box but it didnt work.

 

Would it be possible to have one for FreeBSD aswell? Think there a couple of us out there with either Freenas or Nas4free NAS running PMS and Plexconnect.

What error did you get and what shell are you using to try and launch it?





Sent from my iPad using Tapatalk - now Free

root@Plex:/PlexConnect-master # ls

.gitignore              Localize.py             Settings.cfg
ATVSettings.cfg         Localize.pyc            Settings.py
ATVSettings.py          PlexAPI.py              Settings.pyc
ATVSettings.pyc         PlexAPI.pyc             WebServer.py
DNSServer.py            PlexConnect.log         WebServer.pyc
DNSServer.pyc           PlexConnect.py          XMLConverter.py
Debug.py                PlexConnect_daemon.bash XMLConverter.pyc
Debug.pyc               PlexConnect_daemon.py   assets
License.txt             README.md
root@Plex:/PlexConnect-master # ./PlexConnect_daemon.bash start
./PlexConnect_daemon.bash: Command not found.
root@Plex:/PlexConnect-master #
 
Guess its the default Freebsd shell?
 
Hmm, Im not used to FreeBSD, looks like I got it working afterall.
 

root@Plex:/PlexConnect-master # /bin/sh ./PlexConnect_daemon.bash start

Starting PlexConnect ...
root@Plex:/PlexConnect-master # /bin/sh ./PlexConnect_daemon.bash status
PlexConnect is running
root@Plex:/PlexConnect-master #
 

:slight_smile:


For anyone else using FreeBSD itself you may want to read this about the default shell if you have issues:


http://www.freebsd.org/doc/en/articles/linux-users/shells.html

just use daemontools

just use daemontools

Have you succesfully used daemontools ? I manage to install it using pkg_add, but trying to read up on how to use it and Im stuck. could you write alittle guide?

If anyone still interested here is FreeBSD daemon (/usr/local/etc/rc.d/plexConnect_daemon):

 
#! /bin/sh
#
#
# PROVIDE: plexConnect_daemon
# REQUIRE: DAEMON
# KEYWORD: shutdown
. /etc/rc.subr
name="plexconnect"
rcvar=`set_rcvar`
 
command="/usr/local/bin/python"
pidfile="/var/run/${name}.pid"
plexconnect_flags="/usr/local/plexconnect/PlexConnect/PlexConnect_daemon.py --pidfile $pidfile"
eval ${name}_flags=\"${plexconnect_flags}\"
load_rc_config $name
run_rc_command "$1"

This is just what I was looking for!! Will give it a try right away... btw have you tested this one FreeNAS 9.2.0 ?

btw where do you put that code?

nvm!

i think this goes back to an earlier conversation about if we should have an OS detection command built into the startup script.

evem if we kept each OS specific command set in their own separate script, a common starting point might ease the way.

dave

Common starting point maybe 'universal' installer which will puts right script into right place... But in most cases documentation is enough 

There are now OS specific folders in /support for this kind of thing to run OS specific stuff if you want to create a pull request for FreeBSD :wink:

Just make sure you test it on a vanilla system first.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.