NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support macOS v
1 2 3 4 Next »
How to run NextPVR as a process (without the terminal)

 
  • 0 Vote(s) - 0 Average
How to run NextPVR as a process (without the terminal)
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 55,109
Threads: 983
Joined: May 2006
#21
2025-01-31, 10:40 PM
I followed your instructions and if you didn't say to do it, I didn't do it but I checked and no I don't have anything for dotnet or most applications there.

Martin
Allan
Offline

Member

Canada
Posts: 125
Threads: 12
Joined: Dec 2024
#22
2025-02-02, 11:42 PM (This post was last modified: 2025-02-02, 11:51 PM by Allan.)
I would expect it to be under "microsoft", which is how I understand system settings sees dotnet on your machine. Stuff shows up by itself (but the OS either prompts you to permit access - in the case of full disk access, for instance - or tells you something is running in the background - in the case of background items).
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 55,109
Threads: 983
Joined: May 2006
#23
2025-02-03, 12:05 AM
I got prompted which added that first background access screen but nothing is in Files & Folder

Martin


Attached Files Thumbnail(s)
   
Allan
Offline

Member

Canada
Posts: 125
Threads: 12
Joined: Dec 2024
#24
2025-02-03, 11:42 PM
Still hitting a wall on running as root. Weirder - I can put the plist into launchdaemons and use the launchctl load command without sudo (running as my user) and it runs fine (although it barks that this should not be in the launchagents folder). If I try sudo launchctl load, however - with everything else the same - I get "exited due to SIGABRT | sent by dotnet[1429], ran for 167ms".

I am baffled.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 55,109
Threads: 983
Joined: May 2006
#25
2025-02-04, 04:02 PM
Just on a wild hunch after a problem today what do you have with

sudo ls -lt /var/root/.aspnet/
sudo ls -lt /var/root/.aspnet/DataProtection-Keys

Maybe the file wasn't created fory you.

In user mode you will see them in ~/.aspnet

Martin
Allan
Offline

Member

Canada
Posts: 125
Threads: 12
Joined: Dec 2024
#26
2025-02-04, 09:34 PM (This post was last modified: 2025-02-04, 10:01 PM by Allan.)
Not such a wild hunch!
Quote:ls ~/.aspnet
DataProtection-Keys       dev-certs

Whereas:
Quote:ls -lt /var/root/.aspnet/
s: /var/root/.aspnet/: No such file or directory

However, copying the contents of ~/.aspnet to /var/root/.aspnet/ did nothing (still "exited due to SIGABRT"). 
Quote:drwxr-xr-x  4 root  wheel  128  4 Feb 16:11 .
drwxr-x---  14 root  wheel  448  4 Feb 16:28 ..
drwxr-xr-x  3 root  wheel  96  4 Feb 16:11 DataProtection-Keys
drwxr-xr-x  3 root  wheel  96  4 Feb 16:11 dev-certs

permissions of the key in the DataProtection-Keys directory is set to 600

I'm hoping that copying is not the way to fix this and there was some other thing I'm supposed to do.

BTW, I also have an invisible dotnet folder in my user directory. No such directory in /var/root
Allan
Offline

Member

Canada
Posts: 125
Threads: 12
Joined: Dec 2024
#27
2025-02-25, 10:48 PM (This post was last modified: 2025-02-25, 10:53 PM by Allan.)
Solved! I now have nextpvr launching and running when my computer boots up, without logging into a user account.

The launchdaemon works if I add a username key with my user name. When this worked, I deleted the .aspnet and .dotnet folders from /var/root/ with no negative effect - not surprising, mind you, because nextpvr is now accessing my home folder for settings, etc. and should not be looking in the root user directory for anything.

I'm going to experiment with it for a bit and will then post new, detailed instructions to replace the instructions for a launchagent in the first message.

In the interim, if anyone is trying to run it using a launchdaemon, and is using an external drive for their recordings, please note that external drives do not, by default, mount until you log in to a user account. For the easy fix to change that default behaviour, see this post https://gist.github.com/jabenninghoff/f1...73f5d15819
Allan
Offline

Member

Canada
Posts: 125
Threads: 12
Joined: Dec 2024
#28
2026-03-09, 10:21 PM (This post was last modified: Yesterday, 11:15 PM by Allan.)
My backend has been running reliably for over a year using a launchdaemon. NPVR launches when my computer boots up, without logging into a user account. NPVR restarts if dotnet crashes. Key points:
  • Download from http://nextpvr.com/stable/mac/NPVR.zip
  • I have it installed in /opt/nextpvr/system/ - in my view, this is a better location than the home folder.
  • For easy installation, copy the NPVR.zip file into /opt/nextpvr/system/ and use this ditto command (rather than unzip, which chokes on the international characters in many of the tuning files):
    PHP Code:
    sudo ditto -V -x -k  /opt/nextpvr/system/NPVR.zip  /opt/nextpvr/system/ 
     
  • ASP.NET Core Runtime currently has no installer. It is easier (and works) to run the appropriate SDK installer at https://dotnet.microsoft.com/en-us/download/dotnet/8.0 (same download page as ASP.NET Core Runtime) and after installation, if you want, delete everything except ASP.NET Core Runtime.
  • My battle tested launchdaemon is attached. Before using, you need to edit it to replace two placeholders with the name of your home folder and the IP address of the backend. This file goes into /library/launchdaemons. When in place, chown and chmod to match -rw-r--r--  1 root  wheel 
  • if you are recording to an external drive, please note that external drives do not, by default, mount until you log in to a user account. For the easy fix to change that default behaviour, see this post https://gist.github.com/jabenninghoff/f1...73f5d15819 Also, if you are recording to an external drive, you will have to authorize dotnet to access removable volumes in system settings:privacy and security:files and folders.
  • If you are recording to a network share, I think you will have to authorize dotnet as well in system settings:privacy and security. Not sure what setting. 
  • launch with this command: sudo launchctl load -w  /Library/LaunchDaemons/org.nextpvr.backend.plist
  • shutdown with this command: sudo launchctl unload -w  /Library/LaunchDaemons/org.nextpvr.backend.plist
  • With my launchdaemon, both of the above commands are persistent, and will remain in effect through reboots.
  • With the above setup, your settings and other data with be in an invisible folder named .NPVR-data in your home folder.
  • NB - because of Apple's ever expanding security features, the first time you launch, you will get a series of warnings that invite you to trash parts of what you just installed. Don't trash them. In system settings:privacy and security, scroll to the bottom and click the button that allows the would-be trashed items to launch. You will get more warnings the first time you try to watch a recording.

I hope that's everything.


Attached Files
.zip   org.nextpvr.backend.plist.zip (Size: 1.02 KB / Downloads: 1)
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 55,109
Threads: 983
Joined: May 2006
#29
Yesterday, 08:15 PM
Thanks for writing that up. I was doing some nextpvr development on macOS and didn't remember how to stop or start the server to do an update so it was very handy.

Note with plist I use it just like Linux with the files in /var/opt/nextpvr so no invisible .NPVR folder. I created a special nextpvr user too.

You made a note about external drives and maybe just add that if you want a network drive you need to give extra security to dotnet in privacy and security.

Martin
Allan
Offline

Member

Canada
Posts: 125
Threads: 12
Joined: Dec 2024
#30
Yesterday, 11:19 PM (This post was last modified: Yesterday, 11:21 PM by Allan.)
(Yesterday, 08:15 PM)mvallevand Wrote: …
Note with plist I use it just like Linux with the files in /var/opt/nextpvr so no invisible .NPVR folder.  I created a special nextpvr user too.
Did you just create that user in users and groups or did you use dscl? Did you configure the user to use /opt/nextpvr as home folder?

I have updated instructions re: network share.
« Next Oldest | Next Newest »

Users browsing this thread: 2 Guest(s)

Pages (4): « Previous 1 2 3 4 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  NextPVR is being shut down/shutting itself down Allan 32 6,986 2025-01-16, 04:29 PM
Last Post: mvallevand
  Finding Multiple NextPVR's GlowTube 1 1,577 2024-11-06, 11:12 PM
Last Post: mvallevand
  Is there a "start" command that can be used in the Terminal app? Luisy44 2 1,916 2024-10-08, 07:56 PM
Last Post: Luisy44
  "NextPVR UI" App from Apple App Store a_yank_for_yes 3 3,141 2023-01-26, 07:25 PM
Last Post: sub
  NextPVR on M1 Mac? timbo3344 36 18,380 2022-10-17, 03:36 AM
Last Post: sub
  NextPVR SSD filling up cookrd1 2 2,480 2020-11-12, 03:05 PM
Last Post: cookrd1
  NextPVR install on a iMac running Catalina Edford 5 6,291 2020-07-31, 10:49 PM
Last Post: Edford
  Terminal Window jchhenderson 8 5,106 2019-12-04, 06:41 PM
Last Post: mvallevand

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode