RealtimeSync as a Linux Daemon

Get help for specific problems
Posts: 1
Joined: 27 Jan 2016

al373

Hello,

I am a user of FreeFileSync, and I want to use RealtimeSync as a Linux Daemon (service), because I have many folders to watch and I would like a automated synchronization. I have Ubuntu 14.04 64 bits, and many user accounts.

I tried to run RealtimeSync with a script when I logged in, but the RealtimeSync's process was duplicated when there were several users logged in. And if I checked if the RealtimeSync's process was running before starting it at each login, it was working unless I ended the first session logged in, because the RealtimeSync's process was dependent on it, attached on it. And there was no more automated synchronization if the other sessions were already opened.

The script started at each login:
#!/bin/bash
# RealtimeSync is started as root without password (sudoers)

pidof RealtimeSync >/dev/null
if [[ $? -ne 0 ]] ; then
gksudo "/usr/bin/RealtimeSync '/home/user/Applications/Synchronisation_PC_NAS/FreefileSync_batch/Gestion PC.ffs_batch'" &
gksudo "/usr/bin/RealtimeSync '/home/user/Applications/Synchronisation_PC_NAS/FreefileSync_batch/Messagerie.ffs_batch'"
fi

exit 0 ;
So, now, I want to use RealtimeSync as a deamon. However, it doesn't work. Indeed, RealtimeSync is a GUI application, and a Linux daemon doesn't allow any window or others. So, I have an GTK+ error when I start the daemon, it couldn't initialize a window (even if it is not shown).

My current daemon:
#!/bin/bash

/usr/bin/RealtimeSync '/home/user/Applications/Synchronisation_PC_NAS/FreefileSync_batch/Gestion PC.ffs_batch' &

/usr/bin/RealtimeSync '/home/user/Applications/Synchronisation_PC_NAS/FreefileSync_batch/Messagerie.ffs_batch'


exit 0 ;
What should I do ? What can I do ? Is there a command to detach a process from a session, or can we use RealtimeSync (or other tool) without any window (even if I choose not to show the window when I create the .ffs_batch) ? Or can I allow the daemon to have a GUI ?

Thanks for your help in advance,

al373.