proper way to auto-start seafile client (i.e. via CLI)?

1,475 views
Skip to first unread message

Alex Page

unread,
Jan 25, 2013, 6:23:56 AM1/25/13
to sea...@googlegroups.com
Hi,
I have a couple of linux machines that I'd like to run the seafile client on, but I can't run the applet/web interface because of the nature of the machines... one of them is a headless server containing the home directory for my desktop; the desktop may or may not be logged in / powered on, so I'd like to run seafile directly on the server.  The other is a HTPC which boots directly into an XBMC session; this computer doubles as a security camera so I'd like to sync snapshots from the camera onto a seafile server.  On both of these computers, I can run seafile-applet and set everything up, and it all works properly with my seafile server.  After that initial setup, though, I want to just put a line in rc.local to launch the seafile daemon when the computers boot up.  It should not be necessary for anyone to log in to launch it.

There don't appear to be any man pages or other documentation explaining the CLI options.  Could I simply launch:

seaf-daemon -c <.ccnet path> -d <seafile-data path> -w <seafile path>

in rc.local?  It looks like that's all the applet launches.  And incidentally, what is the -w switch doing in that command?  The path it selects is empty for me.

Thank you!

seafi...@gmail.com

unread,
Jan 25, 2013, 9:43:15 AM1/25/13
to sea...@googlegroups.com
We will publish an CLI client in next version. But we can provide a python cli for you tomorrow. 

-w <seafile path> is used to select the default path when downloading a library from the server.

Currently, without the web interface, there is no method to download a library from the server, even if you can start Seafile from command line.

seafi...@gmail.com

unread,
Jan 25, 2013, 9:52:12 AM1/25/13
to sea...@googlegroups.com
I had missed your first part.

To run Seafile from command line, first

   ccnet -c /home/<yourname>/.ccnet

Second

    seaf-daemon -c /home/plt/.ccnet -d /data/seafile-data -w /data/seafile

This works for me. But you maybe need to

    nohup ccnet -c /home/<yourname>/.ccnet  &
    sleep 2
    nohup seaf-daemon -c /home/plt/.ccnet -d /data/seafile-data -w /data/seafile &

to run them in background.

Ccnet manages networking, seaf-daemon manages files. You should make sure ccnet is started befor seaf-daemon.


 

On Friday, January 25, 2013 7:23:56 PM UTC+8, Alex Page wrote:

Alex Page

unread,
Jan 25, 2013, 9:56:03 AM1/25/13
to sea...@googlegroups.com
Great, thanks!  I am able to run the web interface to get everything set up, I just don't want to deal with it after the initial configuration.  Actually, for my situation, I wouldn't even mind running the applet/web interface occasionally to add new libraries.  My only requirement is that the daemon should run all the time, without a user needing to log in or start it manually.  And I can imagine that some other people will want to do everything via CLI, so it's good that you guys are working on that.

I guess the <seafile path> was empty for me because I've been using existing directories when I download libraries.

Alex Page

unread,
Jan 25, 2013, 9:58:12 AM1/25/13
to sea...@googlegroups.com
Thanks, I'll try it.

Alex Page

unread,
Feb 2, 2013, 12:09:36 AM2/2/13
to sea...@googlegroups.com
The

    nohup ccnet -c /home/<yourname>/.ccnet  &
    sleep 2
    nohup seaf-daemon -c /home/plt/.ccnet -d /data/seafile-data -w /data/seafile &

method works fine for me, thank you.  Obviously "sleep 2" is not ideal, but I expect that you will do something more proper when you release your CLI client.

To stop them, I simply

    killall seaf-daemon && killall ccnet

Is that OK, or is there a more graceful way to stop them than sending SIGTERM?

Thanks again.

seafi...@gmail.com

unread,
Feb 2, 2013, 12:18:34 AM2/2/13
to sea...@googlegroups.com
Yeah, "sleep 2" will be removed in CLI client.

Just "killall ccnet", seaf-daemon will stop itself when it disconnected from ccnet.

"killall seaf-daemon && killall ccnet" is also OK.
Reply all
Reply to author
Forward
0 new messages