Preface: I am new to Ubuntu and Linux in general so bear with me.
I have created a systemd system unit to run a program as a service. For added security, the service runs under its own group and user with no login capability. In order for the service to run, it requires access to several disks. To give the service access to the disks, I am using bindfs
to remount the the disks mounted by my logged in user account with permissions allowing the service's user to access the mounted disks as well.
The service runs successfully; however, I can see issues with this approach because if I reboot, and the service starts before I have logged in, it will fail I presume because I have not logged in yet, my user account will not have mounted the disks, bindfs
will have nothing to remount, and the service will not have access to the disks.
So what is the best way to run the service and give its user access to these disks? Is there a way for the unit to mount the disks in a way that they will be accessible to the service and my user account? Is the only solution to run the daemon under my user account? Or am I am approaching this from an entirely wrong angle?
Any help will be greatly appreciated.