i am using nodejs --version
v0.10.25 and npm --version 5.6.0 i also installed all the required things
like node, npm ,also installed cli of react native ,android sdk, also add Android sdk into PATH, using virtual device and set device ID to udev rules.
And my file structure is :
drwxrwxr-x 5 aspl aspl 4096 Feb 16 15:17 android
-rw-rw-r-- 1 aspl aspl 1184 Feb 16 15:17 App.js
-rw-rw-r-- 1 aspl aspl 43 Feb 16 15:17 app.json
-rw-rw-r-- 1 aspl aspl 119 Feb 16 15:17 index.android.js
drwxrwxr-x 622 aspl aspl 20480 Feb 16 15:17 node_modules
-rw-rw-r-- 1 aspl aspl 448 Feb 16 15:17 package.json
-rw-rw-r-- 1 aspl aspl 266340 Feb 16 15:17 package-lock.json
drwxrwxr-x 2 aspl aspl 4096 Feb 16 15:17 tests
still i got the error:
Exception in thread "main" javax.net.ssl.SSLException: java.security.ProviderException: java.security.InvalidKeyException: EC parameters error
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
The issue is due to not setting up JAVA_HOME. Set it with steps from this link .
export JAVA_HOME="/usr/lib/jvm/java-8-openjdk"
export PATH=$JAVA_HOME/bin:$PATH
save above code to your save that to your .bashrc file and run again
~/tests > uname -a
Linux ghopper-K52F 4.10.0-40-generic #44-Ubuntu SMP Thu Nov 9 14:49:09 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
~/tests > ls -al
total 37404
drwxrwxr-x 2 ghopper ghopper 4096 ноя 23 22:05 .
drwxr-xr-x 33 ghopper ghopper 4096 ноя 24 10:53 ..
-rwxr-xr-x 1 ghopper ghopper 8799120 ноя 23 10:51 chromedriver
-rwxrwxr-x 1 ghopper ghopper 7194178 окт 31 22:15 geckodriver
-rw-rw-r-- 1 ghopper ghopper 22234765 ноя 23 10:52 selenium-server-standalone-3.7.1.jar
~/tests > apt list --installed | grep openjdk
openjdk-9-jre-headless/zesty,now 9~b161-1 amd64 [installed]
I want to start the server with chromedriver
~/tests > java -jar -Dwebdriver.chrome.driver=chromedriver selenium-server-standalone-3.7.1.jar
2017-11-24 11:12:16.560:INFO::main: Logging initialized #3822ms to org.seleniumhq.jetty9.util.log.StdErrLog
2017-11-24 11:12:18.501:INFO:osjs.Server:main: jetty-9.4.5.v20170502
2017-11-24 11:12:18.577:WARN:osjs.SecurityHandler:main: ServletContext#o.s.j.s.ServletContextHandler#58a9760d{/,null,STARTING} has uncovered http methods for path: /
2017-11-24 11:12:18.587:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler#58a9760d{/,null,AVAILABLE}
2017-11-24 11:12:18.662:INFO:osjs.AbstractConnector:main: Started ServerConnector#66a17408{HTTP/1.1,[http/1.1]}{0.0.0.0:4444}
2017-11-24 11:12:18.663:INFO:osjs.Server:main: Started #5924ms
As we can see, there is not any mention about the webdriver.
All my tests were failed and the browser didn't run at all. I got the log snippet in the server's console:
Starting ChromeDriver 2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8) on port 8315
Only local connections are allowed.
And the test's issue:
./vendor/bin/phpunit -v -c tests/phpunit.xml tests/src/Selenium/LoginTest.php
PHPUnit 4.8.36 by Sebastian Bergmann and contributors.
Runtime: PHP 7.0.22-0ubuntu0.17.04.1
Configuration: /home/ghopper/work/***/tests/phpunit.xml
ESSSS
Time: 12.19 seconds, Memory: 6.00MB
There was 1 error:
1) Package\Test\Selenium\LoginTest::testUnauthorizedRandomPage
PHPUnit_Extensions_Selenium2TestCase_WebDriverException:
/home/ghopper/work/***/vendor/phpunit/phpunit selenium/PHPUnit/Extensions/Selenium2TestCase/Driver.php:165
/home/ghopper/work/***/vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/Selenium2TestCase/Driver.php:71
/home/ghopper/work/***/vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/Selenium2TestCase/SessionStrategy/Isolated.php:67
/home/ghopper/work/***/vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/Selenium2TestCase/SessionStrategy/Shared.php:79
/home/ghopper/work/***/vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/Selenium2TestCase.php:246
/home/ghopper/work/***/vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/Selenium2TestCase.php:287
/home/ghopper/work/***/vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/Selenium2TestCase.php:264
--
There were 4 skipped tests:
...
The questions:
Why Selenium runs without the webdriver.
How to debug the server? Where is the error and its cause?
How to check java and its environment?
P.S. I do the same things on an another PC and all works fine for me. I think the problem is in environment, not in the server's config.
~/tests > sudo apt-get purge openjdk-9-jre-headless
~/tests > sudo apt install openjdk-8-jre-headless
~/tests > java -jar -Dwebdriver.chrome.driver=chromedriver selenium-server-standalone-3.7.1.jar
12:48:44.839 INFO - Selenium build info: version: '3.7.1', revision: '8a0099a'
12:48:44.841 INFO - Launching a standalone Selenium Server
2017-11-24 12:48:44.885:INFO::main: Logging initialized #534ms to org.seleniumhq.jetty9.util.log.StdErrLog
12:48:45.006 INFO - Driver class not found: com.opera.core.systems.OperaDriver
12:48:45.099 INFO - Driver provider class org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
registration capabilities Capabilities {browserName: internet explorer, ensureCleanSession: true, platform: WINDOWS, version: }
does not match the current platform LINUX
12:48:45.099 INFO - Driver provider class org.openqa.selenium.edge.EdgeDriver registration is skipped:
registration capabilities Capabilities {browserName: MicrosoftEdge, platform: WINDOWS, version: }
does not match the current platform LINUX
12:48:45.100 INFO - Driver provider class org.openqa.selenium.safari.SafariDriver registration is skipped:
registration capabilities Capabilities {browserName: safari, platform: MAC, version: } does not match the current platform LINUX
12:48:45.226 INFO - Using the passthrough mode handler
2017-11-24 12:48:45.280:INFO:osjs.Server:main: jetty-9.4.5.v20170502
2017-11-24 12:48:45.347:WARN:osjs.SecurityHandler:main: ServletContext#o.s.j.s.ServletContextHandler#30a3107a{/,null,STARTING} has uncovered http methods for path: /
2017-11-24 12:48:45.365:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler#30a3107a{/,null,AVAILABLE}
2017-11-24 12:48:45.414:INFO:osjs.AbstractConnector:main: Started ServerConnector#56c57463{HTTP/1.1,[http/1.1]}{0.0.0.0:4444}
2017-11-24 12:48:45.414:INFO:osjs.Server:main: Started #1063ms
12:48:45.414 INFO - Selenium Server is up and running
Now everything works fine! Thank you )
Creating and erasing buckets (containers) in my OpenStack Swift version 2.14.0 installation works well. It is a Swift only installation. No further OpenStack services like Keystone have been deployed.
$ swift stat
Account: AUTH_test
Containers: 2
Objects: 0
Bytes: 0
Containers in policy "policy-0": 2
Objects in policy "policy-0": 0
Bytes in policy "policy-0": 0
Connection: keep-alive
...
$ swift post s3perf
$ swift list -A http://10.0.0.253:8080/auth/v1.0 -U test:tester -K testing
bucket
s3perf
These are the (positive) messages regarding bucket creation inside the file storage1.error.
$ tail -f /var/log/swift/storage1.error
...
May 9 13:58:50 raspberrypi container-server: STDERR: (1114) accepted
('127.0.0.1', 38118)
May 9 13:58:50 raspberrypi container-server: STDERR: 127.0.0.1 - -
[09/May/2017 11:58:50] "POST /d1/122/AUTH_test/s3perf HTTP/1.1" 204 142
0.021630 (txn: tx982eb25d83624b37bd290-005911aefa)
But any attempt to upload a file causes just an error message [Errno 13] Permission denied.
$ swift upload s3perf s3perf-testfile1.txt
Object PUT failed: http://10.0.0.253:8080/v1/AUTH_test/s3perf/s3perf-testfile1.txt
503 Service Unavailable [first 60 chars of response] <html><h1>Service
Unavailable</h1><p>The server is currently
$ tail -f /var/log/swift/storage1.error
...
May 18 20:55:44 raspberrypi object-server: STDERR: (927) accepted
('127.0.0.1', 45684)
May 18 20:55:44 raspberrypi object-server: ERROR __call__ error with PUT
/d1/40/AUTH_test/s3perf/testfile : #012Traceback (most recent call
last):#012 File "/home/pi/swift/swift/obj/server.py", line 1105, in
__call__#012 res = getattr(self, req.method)(req)#012 File
"/home/pi/swift/swift/common/utils.py", line 1626, in _timing_stats#012
resp = func(ctrl, *args, **kwargs)#012 File
"/home/pi/swift/swift/obj/server.py", line 814, in PUT#012
writer.put(metadata)#012 File "/home/pi/swift/swift/obj/diskfile.py",
line 2561, in put#012 super(DiskFileWriter, self)._put(metadata,
True)#012 File "/home/pi/swift/swift/obj/diskfile.py", line 1566, in
_put#012 tpool_reraise(self._finalize_put, metadata, target_path,
cleanup)#012 File "/home/pi/swift/swift/common/utils.py", line 3536, in
tpool_reraise#012 raise resp#012IOError: [Errno 13] Permission denied
(txn: txfbf08bffde6d4657a72a5-00591dee30)
May 18 20:55:44 raspberrypi object-server: STDERR: 127.0.0.1 - -
[18/May/2017 18:55:44] "PUT /d1/40/AUTH_test/s3perf/testfile HTTP/1.1"
500 875 0.015646 (txn: txfbf08bffde6d4657a72a5-00591dee30)
Also the proxy.error file contains an error message ERROR 500 Expect: 100-continue From Object Server.
May 18 20:55:44 raspberrypi proxy-server: ERROR 500 Expect: 100-continue
From Object Server 127.0.0.1:6010/d1 (txn: txfbf08bffde6d4657a72a5-
00591dee30) (client_ip: 10.0.0.220)
I have started Swift as user pi and assigned these folders to this user:
$ sudo chown pi:pi /etc/swift
$ sudo chown -R pi:pi /mnt/sdb1/*
$ sudo chown -R pi:pi /var/cache/swift
$ sudo chown -R pi:pi /var/run/swift
sdb1 is a loopback device with XFS file system.
$ mount | grep sdb1
/srv/swift-disk on /mnt/sdb1 type xfs (rw,noatime,nodiratime,attr2,nobarrier,inode64,logbufs=8,noquota)
$ ls -ld /mnt/sdb1/1/
drwxr-xr-x 3 pi pi 17 May 12 13:14 /mnt/sdb1/1/
I deployed Swift this way.
I wonder why creating buckets (conrainers) works but the upload of a file fails because of Permission denied.
Update 1:
$ sudo swift-ring-builder /etc/swift/account.builder
/etc/swift/account.builder, build version 2
256 partitions, 1.000000 replicas, 1 regions, 1 zones, 1 devices, 0.00 balance, 0.00 dispersion
The minimum number of hours before a partition can be reassigned is 0 (0:00:00 remaining)
The overload factor is 0.00% (0.000000)
Ring file /etc/swift/account.ring.gz is up-to-date
Devices: id region zone ip address:port replication ip:port name weight partitions balance flags meta
0 1 1 127.0.0.1:6012 127.0.0.1:6012 d1 1.00 256 0.00
$ sudo swift-ring-builder /etc/swift/container.builder
/etc/swift/container.builder, build version 2
256 partitions, 1.000000 replicas, 1 regions, 1 zones, 1 devices, 0.00 balance, 0.00 dispersion
The minimum number of hours before a partition can be reassigned is 0 (0:00:00 remaining)
The overload factor is 0.00% (0.000000)
Ring file /etc/swift/container.ring.gz is up-to-date
Devices: id region zone ip address:port replication ip:port name weight partitions balance flags meta
0 1 1 127.0.0.1:6011 127.0.0.1:6011 d1 1.00 256 0.00
$ sudo swift-ring-builder /etc/swift/object.builder
/etc/swift/object.builder, build version 2
256 partitions, 1.000000 replicas, 1 regions, 1 zones, 1 devices, 0.00 balance, 0.00 dispersion
The minimum number of hours before a partition can be reassigned is 0 (0:00:00 remaining)
The overload factor is 0.00% (0.000000)
Ring file /etc/swift/object.ring.gz is up-to-date
Devices: id region zone ip address:port replication ip:port name weight partitions balance flags meta
0 1 1 127.0.0.1:6010 127.0.0.1:6010 d1 1.00 256 0.00
Update 2
The required ports are open.
$ nmap localhost -p 6010,6011,6012,8080,22
...
PORT STATE SERVICE
22/tcp open ssh
6010/tcp open x11
6011/tcp open unknown
6012/tcp open unknown
8080/tcp open http-proxy
Update 3
I can write as user pi inside the folder where Swift should store the objects.
$ whoami
pi
$ touch /srv/1/node/d1/objects/test
$ ls -l /srv/1/node/d1/objects/test
-rw-r--r-- 1 pi pi 0 May 13 22:59 /srv/1/node/d1/objects/test
Update 4
All swift processes belong to user pi.
$ ps aux | grep swift
pi 944 3.2 2.0 24644 20100 ? Ss May12 65:14 /usr/bin/python /usr/local/bin/swift-proxy-server /etc/swift/proxy-server.conf
pi 945 3.1 2.0 25372 20228 ? Ss May12 64:30 /usr/bin/python /usr/local/bin/swift-container-server /etc/swift/container-server.conf
pi 946 3.1 1.9 24512 19416 ? Ss May12 64:03 /usr/bin/python /usr/local/bin/swift-account-server /etc/swift/account-server.conf
pi 947 3.1 1.9 23688 19320 ? Ss May12 64:04 /usr/bin/python /usr/local/bin/swift-object-server /etc/swift/object-server.conf
pi 1000 0.0 1.7 195656 17844 ? Sl May12 0:01 /usr/bin/python /usr/local/bin/swift-object-server /etc/swift/object-server.conf
pi 1001 0.0 1.8 195656 18056 ? Sl May12 0:01 /usr/bin/python /usr/local/bin/swift-object-server /etc/swift/object-server.conf
pi 1002 0.0 1.6 23880 16772 ? S May12 0:01 /usr/bin/python /usr/local/bin/swift-object-server /etc/swift/object-server.conf
pi 1003 0.0 1.7 195656 17848 ? Sl May12 0:01 /usr/bin/python /usr/local/bin/swift-object-server /etc/swift/object-server.conf
pi 1004 0.0 1.7 24924 17504 ? S May12 0:01 /usr/bin/python /usr/local/bin/swift-account-server /etc/swift/account-server.conf
pi 1005 0.0 1.6 24924 16912 ? S May12 0:01 /usr/bin/python /usr/local/bin/swift-account-server /etc/swift/account-server.conf
pi 1006 0.0 1.8 24924 18368 ? S May12 0:01 /usr/bin/python /usr/local/bin/swift-account-server /etc/swift/account-server.conf
pi 1007 0.0 1.8 24924 18208 ? S May12 0:01 /usr/bin/python /usr/local/bin/swift-account-server /etc/swift/account-server.conf
pi 1008 0.0 1.8 25864 18824 ? S May12 0:01 /usr/bin/python /usr/local/bin/swift-container-server /etc/swift/container-server.conf
pi 1009 0.0 1.8 25864 18652 ? S May12 0:01 /usr/bin/python /usr/local/bin/swift-container-server /etc/swift/container-server.conf
pi 1010 0.0 1.7 25864 17340 ? S May12 0:01 /usr/bin/python /usr/local/bin/swift-container-server /etc/swift/container-server.conf
pi 1011 0.0 1.8 25864 18772 ? S May12 0:01 /usr/bin/python /usr/local/bin/swift-container-server /etc/swift/container-server.conf
pi 1012 0.0 1.8 24644 18276 ? S May12 0:03 /usr/bin/python /usr/local/bin/swift-proxy-server /etc/swift/proxy-server.conf
pi 1013 0.0 1.8 24900 18588 ? S May12 0:03 /usr/bin/python /usr/local/bin/swift-proxy-server /etc/swift/proxy-server.conf
pi 1014 0.0 1.8 24900 18588 ? S May12 0:03 /usr/bin/python /usr/local/bin/swift-proxy-server /etc/swift/proxy-server.conf
pi 1015 0.0 1.8 24900 18568 ? S May12 0:03 /usr/bin/python /usr/local/bin/swift-proxy-server /etc/swift/proxy-server.conf
Update 5
When I create a bucket, the Swift service creates a folder like this one:
/mnt/sdb1/1/node/d1/containers/122/9d5/7a23d9409f11da3062432c6faa75f9d5/
and this folder contains a db-file like 7a23d9409f11da3062432c6faa75f9d5.db. I think this is the correct behavior.
But when I try to upload a file inside a bucket, Swift creates just an empty folder like this one.
/mnt/sdb1/1/node/d1/objects/139/eca/8b17958f984943fc97b6b937061d2eca
I can create files inside these empty folders via touch or echo as user pi but for an unknown reason, Swift does not store files inside these folders.
Update 6
In order to investigate this issue further, I installed Swift according to the SAIO - Swift All In One instructions one time inside a VMware ESXi virtual machine with Ubuntu 14.04 LTS and another time inside Raspbian on a Raspberry Pi 3. The result is, that inside the Ubuntu 14.04 VM, Swift works perfectly, but when running ontop of the Rasberry Pi, uploading files does not work.
Object PUT failed: http://10.0.0.253:8080/v1/AUTH_test/s3perf-testbucket/testfiles/s3perf-testfile1.txt
503 Service Unavailable [first 60 chars of response]
<html><h1>Service Unavailable</h1><p>The server is currently
The storage1.error log file still says:
May 24 13:15:15 raspberrypi object-server: ERROR __call__ error with PUT
/sdb1/484/AUTH_test/s3perf-testbucket/testfiles/s3perf-testfile1.txt :
#012Traceback (most recent call last):#012 File
"/home/pi/swift/swift/obj/server.py", line 1105, in __call__#012 res =
getattr(self, req.method)(req)#012 File
"/home/pi/swift/swift/common/utils.py", line 1626, in _timing_stats#012
resp = func(ctrl, *args, **kwargs)#012 File
"/home/pi/swift/swift/obj/server.py", line 814, in PUT#012
writer.put(metadata)#012 File "/home/pi/swift/swift/obj/diskfile.py",
line 2561, in put#012 super(DiskFileWriter, self)._put(metadata,
True)#012 File "/home/pi/swift/swift/obj/diskfile.py", line 1566, in
_put#012 tpool_reraise(self._finalize_put, metadata, target_path,
cleanup)#012 File "/home/pi/swift/swift/common/utils.py", line 3536, in
tpool_reraise#012 raise resp#012IOError: [Errno 13] Permission denied
(txn: txdfe3c7f704be4af8817b3-0059256b43)
Update 7
The issue is still not fixed, but I have now a working Swift service on the Raspberry Pi. I installed the (quite outdated) Swift revision 2.2.0, which is shipped with Raspbian and it works well. The steps I did are explained here.
Based on the information that you provided, the errors occur during writing Metadata.
The operations for writing Metadata falls into two categories: manipulating inode and manipulating extended attributes. So there are two possible sources for your errors.
First, it is an inode related error. This error may occur due to setting the inode64 parameter while mounting the device. According to the XFS man page:
If applications are in use which do not handle inode numbers bigger than 32 bits, the inode32 option should be specified.
Second, it is an extended attributes related error. You can use the xattr package of python to write extended attributes, and check whether exception happens.
We have this strange problem with assets for our Rails 4.2.0 app. The CSS is fine in development and live compilation on production (config.assets.compile = true). But there is no CSS after assets precompile on production server:
RAILS_ENV=production bundle exec rake assets:clean assets:precompile RAILS_RELATIVE_URL_ROOT=/mysuburi
There is no error in precompile and here are the files under public/assets:
-rw-rw-r-- 1 ubuntu ubuntu 385054 Jun 22 00:25 application-2baaa11c334b4d3babfdf9ef2805de93.js
-rw-rw-r-- 1 ubuntu ubuntu 108205 Jun 22 00:25 application-2baaa11c334b4d3babfdf9ef2805de93.js.gz
-rw-rw-r-- 1 ubuntu ubuntu 3622 Jun 13 01:26 application-d5ed8ccf82d536a6438fc4d9ec872407.css
-rw-rw-r-- 1 ubuntu ubuntu 996 Jun 13 01:26 application-d5ed8ccf82d536a6438fc4d9ec872407.css.gz
drwxrwxr-x 2 ubuntu ubuntu 4096 Jun 22 22:33 authentify
drwxrwxr-x 2 ubuntu ubuntu 4096 Jun 22 22:33 banquet_coursex
drwxrwxr-x 2 ubuntu ubuntu 4096 Jun 22 22:33 banquetx
drwxrwxr-x 2 ubuntu ubuntu 4096 Jun 22 22:33 biz_workflowx
drwxrwxr-x 2 ubuntu ubuntu 4096 Jun 22 22:33 commonx
-rw-rw-r-- 1 ubuntu ubuntu 23320 Jun 13 01:26 glyphicons-halflings-regular-3348022530037ee257256d4a9f1deac5.woff
-rw-rw-r-- 1 ubuntu ubuntu 20335 Jun 13 01:26 glyphicons-halflings-regular-5cc7f3b91ad7b47947e11514eae4b44e.eot
-rw-rw-r-- 1 ubuntu ubuntu 41280 Jun 13 01:26 glyphicons-halflings-regular-63fc0d7eea1f7cf2b6e8696ffb7bc83e.ttf
-rw-rw-r-- 1 ubuntu ubuntu 62926 Jun 13 01:26 glyphicons-halflings-regular-ff3e6d7867d7162f8531ba867cf354f9.svg
drwxrwxr-x 2 ubuntu ubuntu 4096 Jun 22 22:33 jquery-ui
-rw-rw-r-- 1 ubuntu ubuntu 12346 Jun 22 22:33 manifest-04f60cb489f7e161973b51f026287385.json
drwxrwxr-x 2 ubuntu ubuntu 4096 Jun 22 22:33 searchx
drwxrwxr-x 2 ubuntu ubuntu 4096 Jun 22 22:33 state_machine_logx
drwxrwxr-x 2 ubuntu ubuntu 4096 Jun 22 22:33 user_manualx
application-xxx.css and manifest-xxx.json are there. In Gemfile, the version of sprockets and tilt are set to:
gem 'sprockets', '2.12.3'
gem 'tilt', '~>1.4.1'
Here is the production.rb:
config.cache_classes = true
config.eager_load = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_files = false #ENV['RAILS_SERVE_STATIC_FILES'].present?
config.assets.compress = true
config.assets.js_compressor = :uglifier
config.assets.compile = false
config.assets.digest = true
config.log_level = :debug
config.i18n.fallbacks = true
config.active_support.deprecation = :notify
config.log_formatter = ::Logger::Formatter.new
config.active_record.dump_schema_after_migration = false
We tried clean cache with assets:clean a few times with no avail. There are only a few values we can change for the assets. We have rolled back the version of sprockets to fix the problem in assets precompile. We have the default setup about assets location (public/assets) and application-xxx.csss file is there. What else could be wrong with CSS?
When a process is attached by gdb, the stat of the process is "T", like:
root 6507 0.0 0.0 67896 952 ? Ss 12:01 0:00 /mytest
root 6508 0.0 0.0 156472 7120 ? Sl 12:01 0:00 /mytest
root 26994 0.0 0.0 67896 956 ? Ss 19:59 0:00 /mytest
root 26995 0.0 0.0 156460 7116 ? Tl 19:59 0:00 /mytest
root 27833 0.0 0.0 97972 24564 pts/2 S+ 20:00 0:00 gdb /mytest
From the above, 26995 may be debuging. How can I know 26995 is debug or not? Or can I know which process is attached by gdb(27833)
pstree -p 27833 --- show gdb(27833)
Another question: How to know a process(stat: T) is attached by which gdb(PID)?
In most siduation, I am not the peoson who is debuging the process.
The T in ps output stands for "being ptrace()d". So that process (26995) is being traced by something. That something is most often either GDB, or strace.
So yes, if you know that you are only running GDB and not strace, and if you see a single process in T state, then you know that you are debugging that process.
You could also ask GDB which process(es) it is debugging:
(gdb) info process
(gdb) info inferior
Update
As Matthew Slattery correctly noted, T just means the process is stopped, and not that it is being ptrace()d.
So a better solution is to do this:
grep '^TracerPid:' /proc/*/status | grep -v ':.0'
/proc/7657/status:TracerPid: 31069
From above output you can tell that process 7657 is being traced by process 31069. This answers both "which process is being debugger" and "which debugger is debugging what".
/proc file system is a telent design of Linux. Many process real-time information can be found from /proc/{PID}/.
Another question: How to know a process(stat: T) is attached by which
gdb(PID)? In most siduation, I am not the peoson who is debuging the
process.
For this question, we can check /proc/{PID}/status file to get the answer.
root 14616 0.0 0.0 36152 908 ? Ss Jun28 0:00 /mytest
root 14617 0.5 0.0 106192 7648 ? Sl Jun28 112:45 /mytest
tachyon 2683 0.0 0.0 36132 1008 ? Ss 11:22 0:00 /mytest
tachyon 4276 0.0 0.0 76152 20728 pts/42 S+ 11:22 0:00 gdb /mytest
tachyon 2684 0.0 0.0 106136 7140 ? Tl 11:22 0:00 /mytest
host1-8>cat /proc/2684/status
Name: mytest
State: T (tracing stop)
SleepAVG: 88%
Tgid: 2684
Pid: 2684
PPid: 2683
TracerPid: 4276
.......
Thus we know 2684 is debug by process 4276.
You can find out this info from ps axf output.
1357 ? Ss 0:00 /usr/sbin/sshd
1935 ? Ss 0:00 \_ sshd: root#pts/0
1994 pts/0 Ss 0:00 \_ -bash
2237 pts/0 T 0:00 \_ gdb /bin/ls
2242 pts/0 T 0:00 | \_ /bin/ls
2243 pts/0 R+ 0:00 \_ ps axf
Here process 2242 is being debuged by gdb process 2237.