You are not logged in.
Pages: 1
Can not properly configure the autostart of dropbox. I have arch + awesome, wifi via netcfg and dropbox 2.0.0-1 from AUR.
1) On dropbox preferences checked "start dropbox on system start" (has ~/.config/autostart/dropbox.desktop)
2) Dropbox start as service via systemctl. After boot
[gena@x230 ~]$ systemctl status dropbox\@gena
dropbox@gena.service - Dropbox
Loaded: loaded (/usr/lib/systemd/system/dropbox@.service; enabled)
Active: active (running) since Fri 2013-03-15 21:41:20 MSK; 10min ago
Main PID: 624 (dropbox)
CGroup: name=systemd:/system/dropbox@.service/gena
└─624 /opt/dropbox/dropbox
3) htop says that dropbox work
4) I add to /etc/systemd/system/multi-user.target.wants/@dropbox@gena.service (symlink to /usr/lib/systemd/system/dropbox@.service) in service section
Environment=DISPLAY=:0
https://bbs.archlinux.org/viewtopic.php?id=157629
My files don't synchronized (i.e. dropbox don't work), icon on awesome tray is not displayed.
I tried to customize the interface (/etc/network.d/interfaces/wlp3s0)
POST_UP="su -c 'DISPLAY=:0 /usr/bin/dropboxd &' gena"
PRE_DOWN="killall dropbox"
but it did not help.
If i do after boot
sudo systemctl stop dropbox\@gena
sudo systemctl start dropbox\@gena
than dropbox work correctly. Where i am wrong?
Last edited by aragorn22 (2013-03-18 05:02:30)
Offline
if you're using awesome, why not just add
dropboxd &
to .xinitrc? Is there some advantage to starting it via systemd?
Offline
if you're using awesome, why not just add
dropboxd &
to .xinitrc? Is there some advantage to starting it via systemd?
It doesn't try to start another instance when you restart X...
Offline
I'm sorry, I did not say that I sometimes do not run X (for example, when I turn laptop to send data via ftp). So I would like to work with dropbox with and without awesome.
Last edited by aragorn22 (2013-03-18 06:42:04)
Offline
From what I remember dropbox will fail if it is started before you have a WiFi signal.
This was my solution.
~.xinitrc# Start dropbox sleep 45 && dropboxd &
He said he wants to use dropbox even in tty, so that solution isn't valid.
Offline
Is something like the 'sleep 45' suggestion possible for the systemd service the op has set up? I ask because I'm not that familiar with creating/modifying systemd services.
I laugh, yet the joke is on me
Offline
From what I remember dropbox will fail if it is started before you have a WiFi signal.
After=network.target
- https://bbs.archlinux.org/viewtopic.php?id=158722
Last edited by gridcol (2013-03-18 15:56:55)
Offline
xacobe97 wrote:He said he wants to use dropbox even in tty, so that solution isn't valid.
Apologies. That's what I get for posting at 6am.
Don't worry man, i'm not a human being before 1 pm. That's why i fail at school. Also sorry, i think my previous answer sounded unfriendly.
Last edited by xacobe97 (2013-03-18 20:00:39)
Offline
Ok, thanks to all.
My service file:
[Unit]
Description=Dropbox
After=local-fs.target network.target
[Service]
Environment=DISPLAY=:0
Type=simple
ExecStart=/usr/bin/dropboxd
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=always
User=%I
[Install]
WantedBy=multi-user.target
If I understand, I need to enable the service NetworkManager-wait-online?
But when I do it, I get
[gena@x230 ~]$ sudo systemctl enable NetworkManager-wait-online.service
[sudo] password for root:
Failed to issue method call: No such file or directory
Offline
I use a standard servcice file, but this hack on the dropbox page:
https://wiki.archlinux.org/index.php/Dropbox#Connecting...
with a slightly different network test; that way it only starts once I have an established network connection:
#!/bin/sh
# Copyright 2008 Evenflow, Inc., 2010 Dropbox
#
# Environment script for the dropbox executable.
start_dropbox() {
PAR=$(dirname $(readlink -f $0))
OLD_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
LD_LIBRARY_PATH=$PAR:$LD_LIBRARY_PATH
TMP1=$(ps -C dropbox -opid=)
if [ -n "$TMP1" ]; then
kill -9 "$TMP1" >/dev/null 2>&1
fi
exec $PAR/dropbox $@ &
}
do_dropbox() {
start_dropbox >/dev/null 2>&1
while [ 1 ]; do
sleep 5
ERROR="$(net_test)"
if [ -n "$ERROR" ]; then
LAST_ERROR=1
else
if [ -n "$LAST_ERROR" ]; then
# Connection seems to be up but last cycle was down
LAST_ERROR=""
start_dropbox >/dev/null 2>&1
fi
fi
done
}
net_test() {
netup="$(ping -qc 3 google.com 2>/dev/null)"
[ -z "$netup" ] && echo "error"
}
do_dropbox
Offline
I use netctl's (formally netcfg) ExecUpPost to run a script which sets up my proxy settings and runs wget to obtain my external IP address and save it into /home/conf/my_ip
I also run an inotifywait on /home/conf/my_ip which starts dropbox (and offlineimap) when my_ip contains a value and kills them when my_ip is blank (its cleared by netctl as well).
Sounds like something I could handle with systemd, now that I think about it, but its worked well for me for years.
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline
I change /opt/dropbox/dropboxd content as jasonwryan variant. Now when I start awesome dropbox work. But when I restart awesome sometimes (or maybe always) dropbox can not work and icon always not displayed.
Last edited by aragorn22 (2013-03-19 14:19:07)
Offline
Pages: 1