Page 1 of 3 123 LastLast
Results 1 to 10 of 28

Thread: continued discussion. ps3mediaserver as a daemon service

  1. #1
    Join Date
    Jan 2012
    Beans
    33

    continued discussion. ps3mediaserver as a daemon service

    I am starting this thread to continue a discussion from this thread in regards to running ps3mediaserver as a daemon service.

    EDIT: Ubuntu 12.04/ps3mediaserver still suffers from the "ps3mediaserver daemon needs to be restarted after boot" bug]
    EDIT again: 12.04 does not have this bug when the service is installed from the PPA repos using APT. See My last post, P.3]

    I have ubuntu 10.04 server running headless, on which I've installed ps3mediaserver from the script found here (by happy neko). It is not recommended to run ps3mediaserver as a daemon, but in my case I have to, as it's running on a server that will not always be logged into, it's a headless box that's there to do it's jobs without human intervention when need be.

    The install script worked fine, even ps3mediaserver as a service works fine, with one catch. It only works right (in my case) if it's restarted AFTER the boot process. Even when it did work at boot, the daemon would crash once accessed by other machines. The only way for it to work right, and work every boot, was to make sure the service is restarted after everything else booted. What specifically it's depending on to start right is still unknown by me. (If you want more details see the first thread here.)

    So currently I am using a small "restart service" script that's run by cron at boot. The script sleeps for eight seconds then restarts ps3mediaserver. eight seconds was the shortest tested time that was far enough into/after boot to restart ps3mediaserver with the desired results (i.e. it works right).
    Last edited by xclusive585; April 23rd, 2012 at 04:39 AM. Reason: updating

  2. #2
    Join Date
    Mar 2007
    Location
    Denver, CO
    Beans
    7,958
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: continued discussion. ps3mediaserver as a daemon service

    The references I used for upstart was here: http://upstart.ubuntu.com/cookbook/

    My bet is that it works with rc.local or after you manually restart the service because it depends on another running service. Usually files in rc.local are the last to run, so all services should theoretically be started by this time.

    If your daemon is dependent on a listening or active process, I'm not sure the best way to figure what the process should be. If you look at the various upstart scripts in /etc/init/ this will give you a pretty good idea of what other processes do.

    Possibly the best thing would be to start your daemon process at the command line but don't fork it to the background -- run it in the foreground with the -v or -verbose option (if available), to see if the running process gives any hints whats going on.

  3. #3
    Join Date
    Feb 2007
    Beans
    32

    Re: continued discussion. ps3mediaserver as a daemon service

    Thank you for the root cron idea!

    I have been dealing with this exact issue for months.

    I have scripts for auto downloading and auto converting to PS3 formats... the only thing missing was having to do the manual restart of the server part.

    i added:

    Code:
    @reboot sleep 8; service ps3MediaServer restart
    to the root cron, and it seems fine now.

    It is not a perfect, but it is 100% usable until the next reformat.

    Without the cron change, the PS3 would not see the server, however other devices (wdtv) would. But they would not play anything.
    Nothing in the logs was ever helpful.

    It is worth noting that it wasnt always like this. It used to work fine on boot without logging in or restarting. Something changed.

  4. #4
    Join Date
    Feb 2007
    Beans
    32

    Re: continued discussion. ps3mediaserver as a daemon service

    the debug.log that it outputs looks identical to a successful startup, even when it fails

  5. #5
    Join Date
    Jan 2012
    Beans
    33

    Re: continued discussion. ps3mediaserver as a daemon service

    Yea It never worked for me so I wasn't sure if it was PS3mediaserver itself or if it was something else. Even on my buntu12.04 test box the same rigged fix is needed.

    Glad to know that it used to work. But I wish we knew if it was something with upstart or if it was ps3mediaserver that broke it. I haven't had the time, or desire to look into this too deeply.

    If anyone figures out the cause let me know, I'll then pass it along to the proper people.

    -Dave

  6. #6
    Join Date
    Jan 2012
    Beans
    33

    Re: continued discussion. ps3mediaserver as a daemon service

    Quote Originally Posted by Jumbs View Post

    i added:

    Code:
    @reboot sleep 8; service ps3MediaServer restart
    to the root cron, and it seems fine now.

    It is not a perfect, but it is 100% usable until the next reformat.

    Without the cron change, the PS3 would not see the server, however other devices (wdtv) would. But they would not play anything.
    Nothing in the logs was ever helpful.
    This is the problem I had. Even if it did start on boot, it just won't run right, without the restart being issued.


    (side note, I never tried using the command directly in cron, I'm glad to see that works, I can alter my cron and ditch my script.)
    Last edited by xclusive585; April 6th, 2012 at 05:28 PM.

  7. #7
    Join Date
    Feb 2007
    Beans
    32

    Re: continued discussion. ps3mediaserver as a daemon service

    What init script are you using?

  8. #8
    Join Date
    Jan 2012
    Beans
    33

    Re: continued discussion. ps3mediaserver as a daemon service

    Quote Originally Posted by Jumbs View Post
    What init script are you using?
    I'm using the stock init.d script.

    For the cron, I had the cron job point to a script that restarted the service. your way is one less step. I didn't try putting the command directly in cron just in case crons environment didn't like doing a root command.

  9. #9
    Join Date
    Feb 2007
    Beans
    32

    Re: continued discussion. ps3mediaserver as a daemon service

    Quote Originally Posted by xclusive585 View Post
    I'm using the stock init.d script.

    For the cron, I had the cron job point to a script that restarted the service. your way is one less step. I didn't try putting the command directly in cron just in case crons environment didn't like doing a root command.
    Where did you find a stock one? I made one, but then found a better one on the ps3mediaserver forums?

    As long as you are running the ROOT cron and not your accounts, it will have no issue with su commands.

  10. #10
    Join Date
    Jan 2012
    Beans
    33

    Re: continued discussion. ps3mediaserver as a daemon service

    I installed ps3mediaserver using this script found here by happy necko.

    I like install scripts people make, they simplify my program installing life.

    I'll bet the init.d script you found on their forums is identical
    Last edited by xclusive585; April 7th, 2012 at 05:38 PM.

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •