Multi-user on the same PC

I’m running linux mint with syncthing. I have 2 users on the same PC, the reason being I want to keep work and play separate, with each situation requiring different folders to sync.

What I thought so far was that as long as I properly shut down syncthing before changing users, and made sure to never log on to multiple users at once, I wouldn’t have problems with multiple syncthing instances running.

I’m unsure how syncthing handles multiple users, but from my set up, I had 2 separate syncthing sign-ins, and two different device names, one per login. My phone, for example, had two entries for the PC, with specific folders being synced with each user on the PC. But recently, I’ve had syncthing from user 2 somehow log in on user 1, and now the sync files are getting messed up somewhat.

Am I doing something wrong? Or would it be better to just fully delete syncthing first, then set it up that there’s only one login details/user with all the files in it?

Hello @FreSch !

It seems to me that you have the config etc for both Syncthing instances in a place which is easily available for both users and that type manually start and stop Syncthing. Those are the problems, in my opinion.

I suggest you instead use for example Systemd to start Syncthing as a user service, meaning that Systemd automatically starts and stops Syncthing when you log on and off. See Starting Syncthing Automatically — Syncthing documentation .

I checked, apparently the “startup apps” application on mint runs the apps as a user service already. It might be a one-off, seeing user 2’s syncthing instance while user 1 is logged in, might have to monitor it. Unfortunately I lack information and testing, so it’s probably gonna be hard to figure out what was the cause.

Yeah, it might be hard.

I would start from scratch if I were you. Make sure that both users have their own Syncthing config and that when you login, the correct Syncthing insurance is started automatically. One way to know that to you have completely separate instances is to make sure they each have their own unique ID.

they currently do have their own unique ID, I checked.

The most likely cause I see here is that one instance wasn’t actually stopped when that user logged out. The other instance then tried to start, but may have ended up on a different GUI port. The first instance was still running in the background and still hogging the port where you expected the second.

For diagnosis, if this happens again:

ps axu | grep syncthing

You’ll see two processes per instance normally.

If you want a workaround: Configure the GUI listen address differently for the two instances, then you’ll always reach the same one on each port and there is no chance for one to sidestep to another port.

Systemd user units staying active after logout is easily possible if you enabled “lingering” for the user account via loginctl. Check that to make sure you have the right expectations.

Thanks for the command, I’ll keep that in mind for when that happens again. What you said was my theory, that the old instance didn’t fully shut down, causing the mismatch.

I’ll have to look into this “lingering” setting, I never touched anything really, since I rely on mint’s GUI as I’m not a power user.