Autostart Seadrive CLI on Ubuntu 20.04

Good afternoon, thank you for this excellent software.

Please, what is the best way to make Seadrive CLI auto-start and mount in a user’s home directory on server start? I’m assuming a systemd unit, type=simple, but I am by no means very familiar with this. One issue would be I guess, that I need it to run after seafile and seahub units.

Thank you very much

Doug

@kingqueen Add on the crontab from your user (crontab -e) following example line, which works for me:

@reboot sudo seadrive -o allow_other -c /usr/local/etc/seadrive/seadrive.conf -f -d /home/johnsmith/.seadrive/data -l /usr/local/etc/seadrive/seadrive.log /home/johnsmith/SeaDrive > /dev/null 2>&1 &

or just add the alias seadrive to your .bash_aliases file:

alias seadrive='sudo seadrive -o allow_other -c /usr/local/etc/seadrive/seadrive.conf -f -d /home/johnsmith/.seadrive/data -l /usr/local/etc/seadrive/seadrive.log /home/johnsmith/SeaDrive > /dev/null 2>&1 &'

inisde /usr/local/etc/seadrive you have:
seadrive.conf seadrive.log

I mount seadrive not on the same server, that I run the Seafile application. If you came up yourself with a systemd service for seadrive let us know. Thank you.

Feature request
An option to enable/disable autostart in seadrive GUI like in MS Windows

Hi @jobenvil ,
I am returning to this old post because I recently faced the same question and found a solution, at least for me (I am using “SeaDrive-cli-x86_64-3.0.14.AppImage” on Ubuntu Noble 24.04.02 LTS).
This service file works for me:

[Unit]
Description=Seadrive
After=network.target seafile.service ## I am using seadrive-cli on the same machine with the seafile server; thus I need a running seafile service as requirement to start seadrive

[Service]
Type=simple
ExecStart=/home/seafile-user/seadrive_cli_client/./seadrive -c /home/seafile-user/seadrive_cli_client/seadrive.conf -f -d /home/seafile-user/seadrive_cli_client/data-directory -l /home/seafile-user/seadrive_cli_client/data-directory/logs/seadrive.log -o allow_other /media/seadrive
ExecStop=/usr/bin/pkill seadrive
User=seafile-user
Group=seafile-user

[Install]
WantedBy=multi-user.target

1 Like

Thank you so much @hermes73 for taking the time to come back to this old post and share your solution!

Your systemd service file is exactly what I needed. I really appreciate that you included the specific details of your setup (SeaDrive CLI 3.0.14 on Ubuntu Noble 24.04) and the seafile service dependency.

Thanks for documenting a working solution for the community.