You are not logged in.
I have a bash script running as a systemd user service that I want to use to mount an sshfs share automatically whenever the network comes online. I was originally intending to use network-online.target to accomplish this, but that is a system target which can only be used to trigger system services (services running as root).
I was wondering if there is a way that I could create a system service that activates with network-online.target and sends any instances of the user service a signal telling them to mount.
The users running this service will not have root privileges, so on-demand mounting via the fstab isn't an option. Something like afuse isn't an option either, as I don't want to bring in any extra dependencies, especially ones that aren't in the repos.
Last edited by thePhysicist8 (2016-10-25 13:08:04)
Offline
A quick and dirty way would be to have the system service create a file (e.g. /tmp/networkonline) and the user instance has a .path unit for that file which activates the user mount service.
Offline
I tested ukhippo's suggestion and I think it will work for me. Thank you both for the responses.
Offline