How to setup Insync to run as daemon on linux?

Hi,

I would like to have Insync running as a background service on an Ubuntu server (runs even after you log out of the system). Is there an easy scrip setup for that purpose? I would also like to select which local server the daemon will run as…

Thanks!

1 Like

@lpugoy, kindly address this, thanks :smile:

@Paul_Zukowski: Apologies for not replying sooner. For an Ubuntu server please install the insync-headless package. It is available at www.insynchq.com/downloads in the Installers section.

You can run Insync with insync-headless start. This would start Insync and put it in the background.

To start Insync automatically run insync-headless set_autostart yes. This will add an entry to the crontab of the user running Insync.

For more help using Insync commands you can run man insync-headless.

Sorry but I’m not sure what you mean with, “I would also like to select which local server the daemon will run as…”

1 Like

Thanks Ipugoy. The last question was a typo, I meant the local “user” running on the server. So, for example, can I have two insync-headless instaces running as two different users syncing with two different Google Drive accounts?

@Paul_Zukowski: I see. Yes that is possible. You can also add multiple accounts under one Insync process if you want.

Hi Ipugoy,

I tried doing what you suggest in your post (run insync-headless, even set the auto_start) but it doesn’t work: as soon as I log out of my account, insync stops synchronising and resumes only after I log in.

When I set auto_start to yes, nothing appears in my crontab.

In a sense, I understand that insync cannot run when I’m logged out since any command I launch is solely under my user account (not as a root). I tried launching insync as a root, but it does not synchronise my user account.

I guess the only option is to manually create a .conf file in /etc/init that launches insync under my user account (with a ‘su -s /bin/sh -c “/usr/bin/insync” <user_name>’)…

OK, partial success. I created an insync.conf file with (basically)

'su -s /bin/sh -c “/usr/bin/insync-headless start” ’

and insync now launches when the computer boots up (not just when I log in). It does synchronise even if I don’t log in (or if I log out). However, this process that runs in the background means that I don’t have access any longer to the GUI. In order to recover this access, I have to quit the headless process and launch insync in a console. But then, of course, it’s a process linked to my current session and, when the session ends (I log out), the process stops synchronising…

In order to make sure it keeps on synchronising after I log out, I have to quit the insync process I started to access the GUI and launch “service insync” to make sure the (session-independent) insync process of insync.conf is running.

So it’s a partial success. I thought that the “insync-headless set_autostart yes” would be the way to go, but it does not really launch the process “when the computer boots”, only when I log in…

Update on that. After installing Ubuntu 16.04, my workaround with the insync.conf file and running through “service” no longer works…