retronas / retronas

Use a Raspberry Pi, old computer or VM as network storage for different retro computers and consoles
https://github.com/retronas/retronas/wiki
MIT License
767 stars 45 forks source link

ps3netsrv write permissions are bad #48

Closed danmons closed 2 years ago

danmons commented 2 years ago

ps3netsrv's default write permissions appear strange. It writes a file with no read access and a sticky bit permission (when you rip a PS3 game from disc to ISO via tools like Multi-MAN).

The initial write is fine if it completes successfully, but then can't read back.

I've put in a chown/chmod command in "Global configuration" (changed it just today to include sticky-bit removal), however that's kind of annoying to have to remember to do every time the user rips a game.

ps3netsrv itself runs as the RetroNAS user via the systemd startup service, so I'm not sure if running as root changes anything.

I'll need to check upstream with the ps3netsrv developers too I think.

I'll try to do another rip later in the week and record the exact permissions that land on-disk.

danmons commented 2 years ago

Reports from Twitter suggest the "permission fix" tool works, but I still want to bring this up with the devs to try and fix it at the source.

sairuk commented 2 years ago

a systemd path unit could potentially monitor the required path for changes and handle this transparently for the user in the meantime

sairuk commented 2 years ago

Ran into an issue where due to limitations with recursion support in systemd.path files they will not be suitable for the GAMES folder, I have backed out the perm monitor instances and just cleaned up the yaml

sairuk commented 2 years ago

What is our way forward here? close this off with an upstream ticket and/or implement a workaround?

We can dump in a cronjob or systemd timer to just apply perms continuously to the ps3netsrv folders which is kinda crappy but seems necessary for ease of use, systemd timers are more flexible in their intervals than cron iirc

danmons commented 2 years ago

I'll submit a ticket with ps3netsrv upstream. I need to re-dump another ISO to check the settings again and report as I've completely forgotten what they were.

SammyC65 commented 2 years ago

I have made a couple of ISO with my own Ps3 games they rip ok to PS3 folder on Retronas Folders but can't seem to play the games Error seem to get is 1: ISO Type: 32 2: ISO Path (i) [/net_host0/PS3ISO/My Game ISO 3: ISO Path (0) 4: ISO Segs: 1 5: Error: 80010002 (Einval)

danmons commented 2 years ago

I have made a couple of ISO with my own Ps3 games they rip ok to PS3 folder on Retronas Folders but can't seem to play the games Error seem to get is 1: ISO Type: 32 2: ISO Path (i) [/net_host0/PS3ISO/My Game ISO 3: ISO Path (0) 4: ISO Segs: 1 5: Error: 80010002 (Einval)

Have you run the "fix permissions" tool in the "Global configuration" section?

SammyC65 commented 2 years ago

I have made a couple of ISO with my own Ps3 games they rip ok to PS3 folder on Retronas Folders but can't seem to play the games Error seem to get is 1: ISO Type: 32 2: ISO Path (i) [/net_host0/PS3ISO/My Game ISO 3: ISO Path (0) 4: ISO Segs: 1 5: Error: 80010002 (Einval)

Have you run the "fix permissions" tool in the "Global configuration" section?

Yes I have makes no difference still comes up with same issue

sairuk commented 2 years ago

can you provide the output of ls -la /data/retronas/ps3/ps3netsrv/PS3ISO/ or if you've moved your top level directory substitute as applicable, you can scrub the filenames from the output if you like we just need to see the permissions.

SammyC65 commented 2 years ago

can you provide the output of ls -la /data/retronas/ps3/ps3netsrv/PS3ISO/ or if you've moved your top level directory substitute as applicable, you can scrub the filenames from the output if you like we just need to see the permissions.

Where do I search for those on my Retronas

sairuk commented 2 years ago
  1. Install Cockpit
  2. Log in as you're RetroNAS user
  3. On the left hand side of the screen at the bottom of the menu you will see a Terminal entry, click this
  4. Paste/Type the line ls -la /data/retronas/ps3/ps3netsrv/PS3ISO/ in the terminal and press enter.
  5. Copy and paste the output into this issue
SammyC65 commented 2 years ago
  • Install Cockpit
  • Log in as you're RetroNAS user
  • On the left hand side of the screen at the bottom of the menu you will see a Terminal entry, click this
  • Paste/Type the line ls -la /data/retronas/ps3/ps3netsrv/PS3ISO/ in the terminal and press enter.
  • Copy and paste the output into this issue

root@retronas:~# ls -la /data/retronas/ps3/ps3netsrv/PS3ISO/ total 8 drwxrwxr-x 2 pi pi 4096 Feb 23 09:30 . drwxrwxr-x 4 pi pi 4096 Feb 23 09:30 ..

sairuk commented 2 years ago

Thanks that is the kind of output we were after although we need to see the permissions on some dumped files to see if/what the problem you are experiencing might be, please dump one of your games and show us the same output with a dumped game in the folder output

SammyC65 commented 2 years ago

Last ISO Rip 1: Kind:ISO Disk Image 2: Size:10,103,291,904 bytes (10.1 GB on disk) 3: Where: /Volumes/retronas/ps3/ps3netsrv/PS3ISO 4: Server:smb://my IP address/retronas/ps3/ps3netsrv/PS3ISO/FIFA 13.ISO

Thats Info I got right clicked Fifa 13 ISO in PS3 Folder in Retronas

root@retronas:~# ls -la /data/retronas/ps3/ps3netsrv/PS3ISO/ total 8 drwxrwxr-x 2 pi pi 4096 Feb 23 09:30 . drwxrwxr-x 4 pi pi 4096 Feb 23 09:30 ..

SammyC65 commented 2 years ago

Latest Rip still not able to boot from my PS3

root@raspberrypi:~# ls -la /data/retronas/ps3/ps3netsrv/PS3ISO/ total 9866616 drwxrwxr-x 2 pi pi 4096 Feb 26 17:10 . drwxrwxr-x 4 pi pi 4096 Feb 26 15:14 .. ---------- 1 pi pi 0 Feb 26 15:37 'FIFA 13.dkey' ---x-----t 1 pi pi 10103291904 Feb 26 17:10 'FIFA 13.ISO' ---x-----t 1 pi pi 107303 Feb 26 17:10 'FIFA 13.png'

sairuk commented 2 years ago

thanks that is exactly the info we needed to look into this further

sairuk commented 2 years ago

I have committed a workaround for RetroNAS, this problem needs to be taken up with the upstream ps3netsrv project to get fixed properly

Please reinstall ps3netsrv from the menu and try another rip, we now have a process that should fix the permissions to make the files readable that runs approximately every 30s

SammyC65 commented 2 years ago

I have committed a workaround for RetroNAS, this problem needs to be taken up with the upstream ps3netsrv project to get fixed properly

Please reinstall ps3netsrv from the menu and try another rip, we now have a process that should fix the permissions to make the files readable that runs approximately every 30s

Cool will give it a shot in the Morning and keep ya posted

SammyC65 commented 2 years ago

Still not working re loaded PS3 on retronas and fix permissions before doing another ISO Rip again the same old issue I've been getting not sure what to do reinstall HEN Webman or MMCM

sairuk commented 2 years ago

Can you obtain the same information again so we can ensure the permissions were changed properly on your install

SammyC65 commented 2 years ago

root@retronas:~# ls -la /data/retronas/ps3/ps3netsrv/PS3ISO/ total 4693304 drwxrwxr-x 2 pi pi 4096 Feb 27 19:26 . drwxrwxr-x 4 pi pi 4096 Feb 27 17:27 .. -rw-rw-r-- 1 pi pi 0 Feb 27 18:45 'Virtua Tennis 3.dkey' ---x-----t 1 pi pi 4805885952 Feb 27 19:26 'Virtua Tennis 3.ISO' ---x-----t 1 pi pi 42218 Feb 27 19:26 'Virtua Tennis 3.png'

sairuk commented 2 years ago

yes ok, that is certainly not the expected results.

Please do a systemctl status ps3netsrv-perms.service at the command line and paste the results

Unfortunately I don't have a functional ps3 to test here, I did however make some fake files in the appropriate folders when testing with bad perms and they were reset OK during testing.

SammyC65 commented 2 years ago

root@retronas:~# systemctl status ps3netsrv-perms.service ● ps3netsrv-perms.service - ps3netsrv for PlayStation3 permissions fix Loaded: loaded (/lib/systemd/system/ps3netsrv-perms.service; static) Active: inactive (dead) TriggeredBy: ● ps3netsrv-perms.timer

sairuk commented 2 years ago

OK thanks, i'll need the below commands run in sequence with the output

show the active timers on your system before service start systemctl list-timers

lets try this to see if it can at least repair the perms as intended systemctl start ps3netsrv-perms.service

show the active timers after service start systemctl list-timers

and then check the permissions on the files again

SammyC65 commented 2 years ago
root@retronas:~# systemctl list-timers
NEXT                         LEFT          LAST                         PASSED             UNIT                         ACTIVATES
Mon 2022-02-28 00:00:00 AEDT 2h 59min left n/a                          n/a                exim4-base.timer             exim4-base.service
Mon 2022-02-28 00:00:00 AEDT 2h 59min left Sun 2022-02-27 16:36:05 AEDT 4h 24min ago       logrotate.timer              logrotate.service
Mon 2022-02-28 00:00:00 AEDT 2h 59min left Sun 2022-02-27 16:36:05 AEDT 4h 24min ago       man-db.timer                 man-db.service
Mon 2022-02-28 01:18:16 AEDT 4h 17min left Sun 2022-02-27 18:31:35 AEDT 2h 28min ago       fstrim.timer                 fstrim.service
Mon 2022-02-28 03:15:57 AEDT 6h left       Fri 2022-01-28 12:30:23 AEDT 4 weeks 2 days ago apt-daily.timer              apt-daily.service
Mon 2022-02-28 06:51:50 AEDT 9h left       Sun 2022-02-27 16:44:39 AEDT 4h 15min ago       apt-daily-upgrade.timer      apt-daily-upgrade.service
Mon 2022-02-28 18:55:22 AEDT 21h left      Sun 2022-02-27 18:55:22 AEDT 2h 5min ago        systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
Sun 2022-03-06 03:10:42 AEDT 6 days left   Sun 2022-02-27 16:36:51 AEDT 4h 23min ago       e2scrub_all.timer            e2scrub_all.service
n/a                          n/a           Sun 2022-02-27 18:07:39 AEDT 2h 52min ago       ps3netsrv-perms.timer        ps3netsrv-perms.service

9 timers listed.
Pass --all to see loaded but inactive timers, too
sairuk commented 2 years ago

I needed the output of all 3 commands to understand whats going on, not just the first (i assume)

SammyC65 commented 2 years ago
root@retronas:~# systemctl list-timers
Mon 2022-02-28 17:46:21 AEDT 6min left     n/a                          n/a                 systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
Mon 2022-02-28 17:55:02 AEDT 15min left    Sun 2022-02-27 16:44:39 AEDT 24h ago             apt-daily-upgrade.timer      apt-daily-upgrade.service
Mon 2022-02-28 18:58:06 AEDT 1h 18min left Sun 2022-02-27 18:31:35 AEDT 23h ago             fstrim.timer                 fstrim.service
Tue 2022-03-01 00:00:00 AEDT 6h left       Mon 2022-02-28 17:31:41 AEDT 8min ago            exim4-base.timer             exim4-base.service
Tue 2022-03-01 00:00:00 AEDT 6h left       Mon 2022-02-28 17:31:41 AEDT 8min ago            logrotate.timer              logrotate.service
Tue 2022-03-01 00:00:00 AEDT 6h left       Mon 2022-02-28 17:31:41 AEDT 8min ago            man-db.timer                 man-db.service
Tue 2022-03-01 04:35:23 AEDT 10h left      Fri 2022-01-28 12:30:23 AEDT 1 months 0 days ago apt-daily.timer              apt-daily.service
Sun 2022-03-06 03:10:38 AEDT 5 days left   Sun 2022-02-27 16:36:51 AEDT 1 day 1h ago        e2scrub_all.timer            e2scrub_all.service
n/a                          n/a           Sun 2022-02-27 18:07:39 AEDT 23h ago             ps3netsrv-perms.timer        ps3netsrv-perms.service
9 timers listed.
Pass --all to see loaded but inactive timers, too.
SammyC65 commented 2 years ago
root@retronas:~# systemctl start ps3netsrv-perms.service
root@retronas:~# systemctl list-timers
NEXT                         LEFT          LAST                         PASSED              UNIT                         ACTIVATES
Mon 2022-02-28 17:44:32 AEDT 2s left       Mon 2022-02-28 17:44:06 AEDT 23s ago             ps3netsrv-perms.timer        ps3netsrv-perms.service
Mon 2022-02-28 17:46:21 AEDT 1min 51s left n/a                          n/a                 systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
Mon 2022-02-28 17:55:02 AEDT 10min left    Sun 2022-02-27 16:44:39 AEDT 24h ago             apt-daily-upgrade.timer      apt-daily-upgrade.service
Mon 2022-02-28 18:58:06 AEDT 1h 13min left Sun 2022-02-27 18:31:35 AEDT 23h ago             fstrim.timer                 fstrim.service
Tue 2022-03-01 00:00:00 AEDT 6h left       Mon 2022-02-28 17:31:41 AEDT 12min ago           exim4-base.timer             exim4-base.service
Tue 2022-03-01 00:00:00 AEDT 6h left       Mon 2022-02-28 17:31:41 AEDT 12min ago           logrotate.timer              logrotate.service
Tue 2022-03-01 00:00:00 AEDT 6h left       Mon 2022-02-28 17:31:41 AEDT 12min ago           man-db.timer                 man-db.service
Tue 2022-03-01 04:35:23 AEDT 10h left      Fri 2022-01-28 12:30:23 AEDT 1 months 0 days ago apt-daily.timer              apt-daily.service
Sun 2022-03-06 03:10:38 AEDT 5 days left   Sun 2022-02-27 16:36:51 AEDT 1 day 1h ago        e2scrub_all.timer            e2scrub_all.service

9 timers listed.
Pass --all to see loaded but inactive timers, too.
sairuk commented 2 years ago

So the service didn't start as expected to kick the timer into gear, now if you look at the NEXT column for ps3netsrv-perms.timer you will see it has a date it will run again, and note it now runs every ~30s. Every time the timer elapses it starts a service file that should be resetting the permissions on the ps3 folders and files which for all intents an purposes should be fixing the odd permissions you showed above.

You can check the files again to confirm permissions have changed and you can run a systemctl status ps3netsrv-perms.service to ensure the service is running successfully, if it says it failed please post the output.

It's curious, I did a fresh install here and it started the timer fine, I can make a change in the code to force the perms service to be started at least once anyway.

SammyC65 commented 2 years ago

Well Today I uninstalled and reinstalled Hen and stiil have the same issue from 6 days ago so I might have to give PS3 games a miss on RetroNAS for the moment Its doing my head in trying to work out where the issue lies

sairuk commented 2 years ago

I have just purchased a ps3, providing it can be modded and remains working (I have 3 dead ones), I can get this setup and I'll be able to test further.

the0remora commented 2 years ago

They can all be modded now. If its a fat model it can be modded and not have to run HEN. Most of the Slims also can be modded without HEN but all the Super Slims need it. If anyone needs one I have a fat model that is running the current CFW, I am willing to donate it if someone will cover the shipping costs but the BD-Drive is dead.

sairuk commented 2 years ago

i've modded this ps3 now and ripped a disc to iso with the permissions fix in place, Webman was able to mount the iso and run fine and the permissions were as expected

I have problems with HEN/multiman but from what i've read this is not uncommon

I'm going to close this issue off since we've worked around it the best we can with these weird write permissions but i've opened a discussion thread here