Page 1 of 1

Executing User command 0 and 1

Posted: 06 Nov 2013 03:17
by oldiemotors
I have Plex Media Server installed inside a Jail (TheBrig) running on NAS4Free. In the NAS4Free web GUI under 'Extensions' 'TheBrig' I use the section 'User command 0' to automatically start PMS when the jail is started. This works fine, but I also have PlexConnect installed and I am trying to use 'User Command 1' to automatically start the PlexConnect daemon. Here are the two commands:

User command 0: /usr/local/etc/rc.d/plexmediaserver start
User command 1: /bin/sh /PlexConnect-master/PlexConnect_daemon.bash start

So, my PMS starts fine with user command 0, but I cannot get PlexConnect to start automagically with user command 1. If I execute the command from an SSH connection PlexConnect starts.

Anyone have a suggestion why this does not work or where I might look for a Jail log file that might provide a clue why this command is not working?

Thanks,
D

Re: Executing User command 0 and 1

Posted: 06 Nov 2013 08:30
by b0ssman
redirect stdout and stderr to a file and see what the error message is

Re: Executing User command 0 and 1

Posted: 06 Nov 2013 12:26
by raulfg3
I suspect a time problem ( you try to start second at same time that first), better if you write both lines in a sh script, and wait some time before to start second command.

eg:

Code: Select all

/usr/local/etc/rc.d/plexmediaserver start
wait 10
/bin/sh /PlexConnect-master/PlexConnect_daemon.bash start
or something simmilar, so you only need to save as mystart.sh and launch as command 0

Re: Executing User command 0 and 1

Posted: 06 Nov 2013 16:48
by oldiemotors
Thanks for the replies. Turned out that the bash script could not find the Python script that it calls. When I entered the command from SSH I guess I was always in the PlexConnect-master folder. In the bash script I changed my INSTALL_DIR variable from "." to "/PlexConnect-master" and now it starts fine.

Thanks b0ssman and raulfg3 for your replies.