You are not logged in.
Hi everyone!
I'm using Arch + Awesome WM
I've installed dropbox from aur and it works fine when launched, both manually and from a startup script.
/usr/bin/dropboxd
Hovever, when I try to start dropbox service via systemctl no icon appears in the notification area (dropbox works, nevertheless). The same behaviour occurs enabling the service and rebooting (while a classic autostart launching dropboxd from a script shows the notification icon).
Any hint?
% sudo systemctl start dropbox@daniele.service
% sudo systemctl status dropbox@daniele.service
dropboxd@daniele.service - Dropbox
Loaded: loaded (/usr/lib/systemd/system/dropbox@.service; enabled)
Active: active (running) since Thu 2013-02-07 08:27:27 CET; 3s ago
Main PID: 1738 (dropbox)
CGroup: name=systemd:/system/dropbox@.service/daniele
└─1738 /opt/dropbox/dropbox
Feb 07 08:27:27 DanieleXPSA systemd[1]: Starting Dropbox...
Feb 07 08:27:27 DanieleXPSA systemd[1]: Started Dropbox.
Feb 07 08:27:27 DanieleXPSA dropboxd[1738]: /opt/dropbox
Feb 07 08:27:27 DanieleXPSA dropboxd[1738]: /opt/dropbox
EDIT:
The solution is:
Copy the .service file to /etc/systemd/system/ and add "Environment=DISPLAY=:0" to the [service] definition.
Then
# systemctl daemon-reload
and
# systemctl start dropbox@daniele
Last edited by Loth1 (2013-02-07 15:41:20)
Offline
Forget the *.service file... Start Dropbox with:
$ dropboxd &
Then right click the tray icon - Preferences - and check "Start Dropbox on system startup". It creates a "~/.config/autostart/dropbox.desktop" file which will start it automatically.
I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).
Offline
Maybe systemctl starts your dropbox service before the GUI is even up and running? Where should the poor thing put its icon?
You could try to read here about targets and dependencies: https://wiki.archlinux.org/index.php/Systemd.
Then again, the previous suggestion or some other autostart mechanism in Awesome will probably achieve exactly what you want anyhow.
;-)
Offline
Sorry, saying "notification area" I meant "System Tray" (wibox.widget.systray()).
I'm still using an autostart script launched by awesome, but since the .service exists I wanted to use it. The icon doesn't appear even doing a systemctl start from the terminal emulator, the process starts, dropbox works but there is no icon in the system tray.
Offline
Maybe systemctl starts dropboxd as the user root? Maybe dropboxd then has no access to you display as X would not allow it? Try "xhost +" and then start the service again. If it works then at least you know where to look...
Offline
The service runs outside of an X session, I presume it's there so that you can start dropbox as user X when the PC boots up, so that you can access your files remotely even when you haven't logged in to your machine? I don't use dropbox, so I have no idea how it works.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Thanks for your replies.
Maybe systemctl starts dropboxd as the user root? Maybe dropboxd then has no access to you display as X would not allow it? Try "xhost +" and then start the service again. If it works then at least you know where to look...
Unfortnately it didn't work. The service is launched as my user.
daniele 10933 78.6 2.0 1868980 120244 ? Ssl 13:37 1:19 /opt/dropbox/dropbox
The service runs outside of an X session, I presume it's there so that you can start dropbox as user X when the PC boots up, so that you can access your files remotely even when you haven't logged in to your machine? I don't use dropbox, so I have no idea how it works.
Dropbox is a deamon, accessible even via console using the dropbox-cli package from AUR. When it starts I suppose it tries to create a system tray icon (I have no idea how it's implemented) and for some reason, the client launched by systemctl can't complete this step.
Last edited by Loth1 (2013-02-07 12:53:01)
Offline
The service starting up - so that dropbox will sync once the network is available - and the icon in the panel are 2 separate events and need to be set up individually depending on your choice of panel ... unless i've been doing it wrong for X years
Offline
Copy the .service file to /etc/systemd/system/ and add "Environment=DISPLAY=:0" to the [service] definition.
Then
# systemctl daemon-reload
and
# systemctl start dropbox@daniele
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Copy the .service file to /etc/systemd/system/ and add "Environment=DISPLAY=:0" to the [service] definition.
Then
# systemctl daemon-reload
and
# systemctl start dropbox@daniele
Works like a charm, thanks!
Offline
Hey,
I can't get it to work...
I copied the service and added the "Environment=DISPLAY=:0" to the [service] definition. If I manually start the service with # systemctl start dropbox@developej
the service starts and there is the icon in the tray.
But if I do a # systemctl enable dropbox@developej (the output says it linked the dropbox@developej.service if it means anything), and I reboot, there is no icon!
$ systemctl status dropbox@developej says that it is running though...
Ideas?
Offline
I would bet that it is being started before the existence of a system tray.
Offline
What is the benefit of starting the system tray icon using systemd unless the system tray is also a service managed by systemd? That is, in that case, I could see the point because you could have systemd manage the dependency using After=SysTray or something but I don't really see the point otherwise. The daemon part needs the network so there's a reason to start that with systemd but the sys tray icon seems more like a regular application.
Am I missing something? Maybe with user sessions it makes sense?
I should say that I'm just curious because it seems that a little while ago, it was difficult to persuade anybody to do anything the systemd way - people wanted to know how to run their init scripts using systemd etc. But now people seem to want to do everything the systemd way even when there isn't a systemd way to do it . I can't figure out if this is just because people want to see what systemd can do at the limits (fine) or whether it is because they think systemd ought to be doing everything whatsoever to do with automation (which seems to rest on a mistake).
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
There is a systemd way to do it, but it is not yet implemented fully as of yet. That way is using systemd --user. By doing that, you can effectively order the dropbox service to start after your window manager and/or tray. But this requires actually implementing systemd --user manually in a not quite fully supported way.
Last edited by WonderWoofy (2013-07-23 02:48:57)
Offline
So what is the best practice for this kind of problems?
Offline
It depends on how you start X. But you need to *somehow* delay the start of the dropbox unit until after the tray is started. So unless you boot straight into X without a DM or anything, I see no clean reasonable solution for this w/o using "systemd --user".
Offline
cat .zprofile
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx
is how I start X.
Thanks, I'll see what will I end up with...
Offline
If you also have autologin to the tty, then as a dirty hack you could probably just use a systemd timer to wait a few seconds before starting the actual service file itself.
Offline
It depends on how you start X. But you need to *somehow* delay the start of the dropbox unit until after the tray is started. So unless you boot straight into X without a DM or anything, I see no clean reasonable solution for this w/o using "systemd --user".
Do you mean: no such systemd solution? Isn't it otherwise possible to just have it start as an autostart application in your DE or whatever? I'm not saying the systemd solution isn't a reasonable one - just that it is not the only one.
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
@cfr, I think that would be the much more sane idea in this case. But the question in this thread was specifically regarding using it as a systemd service.
Offline
@cfr, I think that would be the much more sane idea in this case. But the question in this thread was specifically regarding using it as a systemd service.
True enough but I wasn't clear whether developej had the same purpose as the OP, especially given the question about "best practice for this kind of problems" which sounded rather more open-ended than the original enquiry. I just thought it worth clarifying that there are other reasonable solutions if what you want is to solve the problem as opposed to solving it using a particular tool. But probably you are right and developej picked this thread due to a desire to use systemd for it.
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
Oh, you're totally right, developej is not the OP here. I just read his/her post, read the title and made some assumptions... whoops.
Sorry developej, if you're still around, there are better ways of doing this.
Offline
I am.
Give links, tell me what to read
Offline
Did you try the solution earlier in this thread at https://bbs.archlinux.org/viewtopic.php … 6#p1228386 ? I'm pretty sure that's how I did it and it works fine here.
If not, can you post .xinitrc so we can see exactly what you are using? If the earlier solution doesn't work, the best option is likely to depend on what else you are using e.g. DE or standalone WM or whatever as different options have different configurations.
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
Yes, I would just put it in your window manager's autostart script (for example, $HOME/.config/openbox/autostart for openbox). Otherwise, most desktop environments use the xdg autostart directory. That is, whatever *.desktop is in the given autostart directory is.... well, autostarted.
Offline