You are not logged in.

#1 2013-11-16 21:59:35

boogerlad
Member
Registered: 2013-04-20
Posts: 48

netctl-auto and dropbox

Hi, I've been reading the wiki. The only difference is my interface name is wlp2s0 instead of wlan0. So I went to /etc/netctl/interfaces and I created a new file called wlp2s0 with the contents

ExecUpPost="su -c 'DISPLAY=:0 /usr/bin/dropboxd &' root || true"
ExecDownPre="killall dropbox"

However, this doesn't seem to do anything. I've disabled the "Start Dropbox on system startup" option, but everytime I restart, there's no dropbox icon in the dock like there normally is. What am I doing wrong?

Internet roaming still seems to work, even after putting the computer to sleep.

Last edited by boogerlad (2013-11-16 22:01:34)

Offline

#2 2013-11-16 23:35:38

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: netctl-auto and dropbox

Instead of using this terrible hack, use the dropbox.service.  The wiki has information about how to modify the dropbox.service in order to get it to display the taskbar icon.


Edit: BTW, dropbox handles intermittent internet connectivity perfectly fine.  There is no reason to try to have it started and stopped on every connect and disconnect.

Last edited by WonderWoofy (2013-11-16 23:36:25)

Offline

#3 2013-11-18 01:09:34

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,358

Re: netctl-auto and dropbox

WonderWoofy wrote:

There is no reason to try to have it started and stopped on every connect and disconnect.

Unless you only want it run on certain wifi networks or only on ethernet due to high cost of a particular pay-per-use wireless connection.

My own hack for this behaviour is to use ExecUpPost and ExecDownPre to modify a file which I monitor in a userland script using inotifywait. If systemd user-mode ever gets 'official' blessings I'd use that instead, though.


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

#4 2013-11-18 01:53:02

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: netctl-auto and dropbox

That is a very interesting point ngoonee.  I didn't even think about such a situation.  The only place I would really need to worry about this is on my laptop, since the mobile application does not download the stuffs automatically.  Typically my laptop uses only wifi.  I guess sometimes I tether my laptop to my phone... but I also don't use dropbox very extensively either.


Edit: If it is just one network in particular that you use dropbox on, you could probably use systemd's native dependency resolution to have it come up or go down depending on the netctl@.service that is started.

Last edited by WonderWoofy (2013-11-18 01:55:07)

Offline

#5 2013-11-20 13:09:28

youngdm
Member
Registered: 2013-08-02
Posts: 20

Re: netctl-auto and dropbox

Wonderwoofy,
I'm having a similar problem with my dropbox@usr.service connecting at startup. It loads fine but stays on connecting....... . I can stop and restart it using

 # systemctl stop/start dropbox@dmy

and it works as expected. I can use the same method that boogerland describes in the first post and it works fine but I wanted to get it to work with systemd if possible. Any thoughts? Here's my dropbox@usr.service

[Unit]                                                                                                                                   
Description=Dropbox
After=local-fs.target network.target netctl-auto@wlan0 netctl-ifplugd@enp3s0
Wants=netctl-auto@wlan0 netctl-ifplugd@enp3s0

[Service]
Type=simple
Environment=DISPLAY=:0
ExecStart=/home/dmy/.dropbox-dist/dropboxd
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=always
User=%I
 
[Install]
WantedBy=multi-user.target

Offline

Board footer

Powered by FluxBB