ghenry22 / subsonic-synology

Subsonic setup to run on Synology NAS
94 stars 18 forks source link

DSM 6 does not retain /etc/passwd edits #1

Closed dnabb closed 7 years ago

dnabb commented 8 years ago

Hello,

Apparently, for security reasons, DSM 6 no longer keeps the edits made to the /etc/passwd file after a reboot, which causes the installation procedure to fail. See topic https://forum.synology.com/enu/viewtopic.php?t=117722

I tried editing /etc/passwd assigning to the subsonic user a UID of less than 1000: this way, the edit is retained even after a reboot, but for some reason I don't quite get, the start script fails with /bin/sh: /var/subsonic/start-stop-status: Permission denied

I guess the best way to go would be to create a "package account" like the ones that are created by the different packages installed (as example Audiostation), but I'm not sure how to proceed.

Anyone able to help?

ghenry22 commented 8 years ago

Thanks for reporting, I will take a look at it.

I am looking at packaging subsonic as a standard spk file which would remove all the manual steps as well. Will see how it goes.

dnabb commented 8 years ago

Creating a .spk file would definitely be the best way to go... Meanwhile, I made things work somehow with a script that edits the /etc/passwd file:

#!/bin/bash

# Change the login shell and home folder for the user "subsonic"
/usr/bin/awk -i inplace -F: 'BEGIN{OFS=":"}/^subsonic\:/{gsub(/.*/,"/bin/sh",$7)}1' /etc/passwd
/usr/bin/awk -i inplace -F: 'BEGIN{OFS=":"}/^subsonic\:/{gsub(/.*/,"/var/subsonic",$6)}1' /etc/passwd

The script can be launched by the task scheduler right before launching subsonic.

Not a pretty solution, but it works.

ghenry22 commented 7 years ago

new package available as installable spk for DSM6.0, so I'll close this