Periodic chown possible / clever?

Questions about SNMP, Power, System, Logs, disk, & RAID.
Post Reply
licht77
Starting out
Posts: 11
Joined: Fri Feb 03, 2017 4:46 am

Periodic chown possible / clever?

Post by licht77 »

Hi folks!

I am pondering about a dirty workaround where I need some ideas...- and therefore I may describe the problem first:

- I am using syncthing to manage some users files. As this process is running under admin rights, all created folders and files within the users homedirs are owned by admin. Of course that causes problems :-)

So there seem to be 2 solutions: #1 is to spawn multiple instances what is not very efficient and #2 is to change umask (what may end up in a bigger mess).

Thats where I thought: HM, why not running a shellscript to chown the userdirs to their respective users periodically (or better: run it when the user logs in).

If noone has a better idea how to get this mess solved - what would be a clever way to hook in that shellscript?
User avatar
MrVideo
Experience counts
Posts: 4742
Joined: Fri May 03, 2013 2:26 pm

Re: Periodic chown possible / clever?

Post by MrVideo »

You do have a sticky wicket, don't you. Having a user running a SUID script is a security risk. So, it is up to you if you want to go that route. I have no clue as to what "syncthing" is, so I have no idea as to what it is doing.
QTS MANUALS
Submit QNAP Support Ticket - QNAP Tutorials, FAQs, Downloads, Wiki - Product Support Status - Moogle's QNAP FAQ help V2
Asking a question, include the following
(Thanks to Toxic17)
QNAP md_checker nasreport (release 20210309)
===============================
Model: TS-869L -- RAM: 3G -- FW: QTS 4.1.4 Build 20150522 (used for data storage)
WD60EFRX-68L0BN1(x1)/68MYMN1(x7) Red HDDs -- RAID6: 8x6TB -- Cold spare: 1x6TB
Entware
===============================
Model: TS-451A -- RAM: 2G -- FW: QTS 4.5.2 Build 20210202 (used as a video server)
WL3000GSA6472(x3) White label NAS HDDs -- RAID5: 3x3TB
Entware -- MyKodi 17.3 (default is Kodi 16)
===============================
My 2017 Total Solar Eclipse Photos | My 2019 N. Ireland Game of Thrones tour
licht77
Starting out
Posts: 11
Joined: Fri Feb 03, 2017 4:46 am

Re: Periodic chown possible / clever?

Post by licht77 »

Thanks for your helping post MrVideo.

Nevertheless for other users who may run into the same problem: Editing the startupscript in /etc/init.d/syncthing.sh and add "umask 0000" in the Start section will do the trick.
This allows remaining the userdirs untouched, but the synced files are accessable by the respective users. And only by them as long as you keep it within their homedirs.
Post Reply

Return to “System & Disk Volume Management”