Bug 967216 - Device is offline if adb started via systemd
Summary: Device is offline if adb started via systemd
Alias: None
Product: Fedora
Classification: Fedora
Component: android-tools
Version: 20
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Ivan Afonichev
QA Contact: Fedora Extras Quality Assurance
Depends On:
Blocks: 1248836
TreeView+ depends on / blocked
Reported: 2013-05-25 15:24 UTC by Richard Körber
Modified: 2015-07-30 23:49 UTC (History)
2 users (show)

Fixed In Version: android-tools-20141219git8393e50-2.fc21
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1248836 (view as bug list)
Last Closed: 2015-02-15 03:20:29 UTC
Type: Bug

Attachments (Terms of Use)

Description Richard Körber 2013-05-25 15:24:11 UTC
Description of problem:
When starting adb via systemctl, the connected Android device is always "offline". However, when starting adb directly, the device is reachable.

Version-Release number of selected component (if applicable):

How reproducible:
Always. Tried on two different systems with FC18 installed.

Steps to Reproduce:
1. USB connect an Android device with Android 4.2.2 and USB debugging enabled
2. sudo systemctl start adb
3. adb devices --> will show that the device is attached, but offline
4. sudo systemctl stop adb
5. sudo adb start-server
6. adb devices --> will show that the device is attached and available

Actual results:
Device is always offline when adb was started via systemctl, but available when adb start-server was invoked as root.

Expected results:
Device should be available on both ways.

Additional info:
On both cases, ps shows a process "adb -P 5037 fork-server server" which is owned by root. I cannot find a reason why it shouldn't work with systemctl.

Comment 1 Ivan Afonichev 2013-05-25 17:34:36 UTC
It seems adb needs $HOME dir to create .android/ dir and generate public keys here.

What is your opinion where adb should place this data? Should it be /root/ or something else?

Temporary workaround for this bug:
Create /etc/systemd/system/adb.service with contents like here:

[root@van-ssd ~]# cat /etc/systemd/system/adb.service 
.include /lib/systemd/system/adb.service 

Comment 2 Richard Körber 2013-05-26 12:46:09 UTC
Thanks for the workaround.

I don't think system services should use /root for storing data. I created /var/lib/adb/ and let the Environment=HOME point there. Now the adb service works fine.

However, as I don't know too much about Linux internas, maybe there is a better location for the adb home directory...

Comment 3 Fedora End Of Life 2013-12-21 13:43:38 UTC
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '18'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior to Fedora 18's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Thomas Moschny 2014-09-16 13:21:33 UTC
Ping, any news here?

Comment 5 Fedora Update System 2015-01-18 22:09:48 UTC
android-tools-20141219git8393e50-2.fc21 has been submitted as an update for Fedora 21.

Comment 6 Fedora Update System 2015-01-20 21:05:12 UTC
Package android-tools-20141219git8393e50-2.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing android-tools-20141219git8393e50-2.fc21'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2015-02-15 03:20:29 UTC
android-tools-20141219git8393e50-2.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.