udiskie icon indicating copy to clipboard operation
udiskie copied to clipboard

Tray doesn't work as a service

Open coldfix opened this issue 8 years ago • 5 comments
trafficstars

From #129, @mindstormer12:

I'm finding that smart tray doesn't seem to work with the posted service file and the the corrected argument. On my config.yml, I also have tray: auto. No tray is displayed with my USB plugged in.

Tray only appears if I start another instance using udiskie --smart-tray on the terminal, after udiskie is already running via service.

coldfix avatar Jan 13 '17 20:01 coldfix

@coldfix Was this reproducible on your machine?

mindstormer12 avatar Jan 17 '17 00:01 mindstormer12

I hope to have time to check this evening. I believe to have experienced similar issue in the past when starting via service files (irrespectively of the auto/smart flag). It could be related to X not being started up when udiskie is creating the Gtk.StatusIcon instance. In this case the most straight forward fix would be to start the icon with your window manager (.xinitrc or autostart applications). (You could start the icon without automounting --no-automount plus background daemon with no tray --no-tray via service file, if you need automounting without X login)

BTW: I do currently not recommend starting udiskie as service.

coldfix avatar Jan 17 '17 10:01 coldfix

I'm also having this problem--any updates?

And might as well ask questions: Is --eject option useful at all for hard disk drives or flash drives? Is unmount "safe" without also using --detach or is --detach recommended after an unmount in all cases?

rieje avatar Feb 14 '17 23:02 rieje

My recommendation for now is: do not use udiskie tray/notifications as a systemd service.

GUI service components should be started with the window manager, i.e. in .xinitrc or in your window manager's autostart feature.

If you sometimes log in without window manager but still want udiskie running, you can start an udiskie instance without notifications/tray via systemd. In this case you would start an additional udiskie instance with notifications/tray but without automount with the window manager as described above.

I'm pretty short on time right now, and this is not my top priority, since there is a workaround.

coldfix avatar Feb 15 '17 08:02 coldfix

About your other questions:

  • --eject should be useful only for CD drives, where it physically ejects the CD. It is sometimes also available for other media. In that case, it somehow disables them but does not power down. Not recommended.
  • If you wait for completion, unmount ensures that the disc will be synced and the drive is not left in an inconsistent state. I'm not an expert on hardware and cannot say about potential damage to the disc due to voltage peaks during removal without having powered down first or something, but I think, unmount should be safe without detach in most cases. If you want a more funded estimation, you should better ask someone else. If you get information on this, please notify me:)

Personally, I usually go for detach when I know I'm gonna remove the drive physically.

coldfix avatar Feb 15 '17 08:02 coldfix