On a Debian server I created the user named UserDB, with its credentials.
In its Home Folder (/srv/dev-disk/Home/UserDB) I installed Dropbox as in the official guide.
I also saved the dropbox.py file in the ~/Dropbox folder.
Now, if I connect via SSH with this user, I enter in the ~/Dropbox folder and launch dropbox.py I can start Dropbox, stop it, see its status, add folders to exclude, ...
So everything looks OK.
I then created the file: /etc/systemd/system/dropbox.service with:
[Unit]
Description=Dropbox Daemon
After=network.target
[Service]
Type=simple
User=UserDB
ExecStart=/srv/dev-disk/Home/UserDB/.dropbox-dist/dropboxd
ExecStop=/bin/kill -HUP $MAINPID
Restart=always
[Install]
WantedBy=multi-user.target
Now, if I connect via SSH as UserDB and run systemctl status dropobox.service I see the service as active and if I run dropbox.py I see that Dropbox is running and is synchronizing.
If instead I connect as root and run systemctl status dropbox.service, I still see the service active, but with dropbox.py status I see the message: Dropbox isn't running!
If write ./dropbox.py start I see:
Starting Dropbox...
The Dropbox daemon is not installed!
Run "dropbox start -i" to install the daemon
Where am I doing wrong?