List accessed files by a process

January 15, 2015 Leave a comment

To list all files, sockets, ports accessed/used by a process you can use lsof. First find the pid of process.

[root@m ~]# ps -ax | grep httpd
 6360 ?        S      0:00 /usr/sbin/httpd -DFOREGROUND
 7129 pts/6    S+     0:00 grep --color=auto httpd
27003 ?        Ss     0:03 /usr/sbin/httpd -DFOREGROUND
30813 ?        S      0:04 /usr/sbin/httpd -DFOREGROUND
31015 ?        S      0:00 /usr/sbin/httpd -DFOREGROUND
31202 ?        S      0:08 /usr/sbin/httpd -DFOREGROUND
31221 ?        S      0:00 /usr/sbin/httpd -DFOREGROUND
31241 ?        S      0:03 /usr/sbin/httpd -DFOREGROUND
31291 ?        S      0:00 /usr/sbin/httpd -DFOREGROUND
31328 ?        S      0:03 /usr/sbin/httpd -DFOREGROUND
31588 ?        S      0:00 /usr/sbin/httpd -DFOREGROUND
32438 ?        S      0:00 /usr/sbin/httpd -DFOREGROUND

And use that pid to view details of process with lsof

[root@markorot ~]# lsof -np 6360
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
      Output information may be incomplete.
COMMAND  PID   USER   FD      TYPE             DEVICE SIZE/OFF      NODE NAME
httpd   6360 apache  cwd       DIR              253,1     4096       192 /
httpd   6360 apache  rtd       DIR              253,1     4096       192 /
httpd   6360 apache  txt       REG              253,1   502800   5635240 /usr/sbin/httpd
httpd   6360 apache  mem       REG              253,1    57952   2690900 /usr/lib64/libzip.so.2.1.0
httpd   6360 apache  mem       REG              253,1    58384 140404816 /usr/lib64/php/modules/zip.so
httpd   6360 apache  mem       REG              253,1    19384      1999 /usr/lib64/libgpg-error.so.0.10.0
httpd   6360 apache  mem       REG              253,1   513008      2045 /usr/lib64/libgcrypt.so.11.8.2
httpd   6360 apache  mem       REG              253,1   258344   1490893 /usr/lib64/libxslt.so.1.1.28
httpd   6360 apache  mem       REG              253,1    87368   1490891 /usr/lib64/libexslt.so.0.8.17
httpd   6360 apache  mem       REG              253,1    37104 140404827 /usr/lib64/php/modules/xsl.so
httpd   6360 apache  mem       REG              253,1    49152 140404826 /usr/lib64/php/modules/xmlwriter.so
httpd   6360 apache  mem       REG              253,1    32888 140404825 /usr/lib64/php/modules/xmlreader.so
httpd   6360 apache  mem       REG              253,1    36728 140404824 /usr/lib64/php/modules/wddx.so
httpd   6360 apache  mem       REG              253,1   397112   2690898 /usr/lib64/libtidy-0.99.so.0.0.0
httpd   6360 apache  mem       REG              253,1    53888 140404828 /usr/lib64/php/modules/tidy.so
httpd   6360 apache  mem       REG              253,1    15720 141039970 /usr/lib64/php/modules/sysvshm.so
httpd   6360 apache  mem       REG              253,1    11496 141039969 /usr/lib64/php/modules/sysvsem.so
httpd   6360 apache  mem       REG              253,1    19880 141039968 /usr/lib64/php/modules/sysvmsg.so
httpd   6360 apache  mem       REG              253,1    51336 140404848 /usr/lib64/php/modules/sqlite3.so
httpd   6360 apache  mem       REG              253,1   343776 141495481 /usr/lib64/php/modules/soap.so
httpd   6360 apache  mem       REG              253,1    32888 141039967 /usr/lib64/php/modules/posix.so
httpd   6360 apache  mem       REG              253,1   271960 140404815 /usr/lib64/php/modules/phar.so
httpd   6360 apache  mem       REG              253,1   753200      2047 /usr/lib64/libsqlite3.so.0.8.6
httpd   6360 apache  mem       REG              253,1    29168 140404847 /usr/lib64/php/modules/pdo_sqlite.so
httpd   6360 apache  mem       REG              253,1    33168 140404851 /usr/lib64/php/modules/pdo_mysql.so
httpd   6360 apache  mem       REG              253,1   116296 140404846 /usr/lib64/php/modules/pdo.so
httpd   6360 apache  mem       REG              253,1   146016 140404850 /usr/lib64/php/modules/mysqli.so
httpd   6360 apache  mem       REG              253,1   991744      1725 /usr/lib64/libstdc++.so.6.0.19
httpd   6360 apache  mem       REG              253,1  3133520 201462835 /usr/lib64/mysql/libmysqlclient.so.18.0.0
httpd   6360 apache  mem       REG              253,1    57912 140404849 /usr/lib64/php/modules/mysql.so
httpd   6360 apache  mem       REG              253,1   187952     42685 /usr/lib64/libmcrypt.so.4.4.8
httpd   6360 apache  mem       REG              253,1    48960 140404829 /usr/lib64/php/modules/mcrypt.so
httpd   6360 apache  mem       REG              253,1  1305696 140404817 /usr/lib64/php/modules/mbstring.so
httpd   6360 apache  mem       REG              253,1    44680 140404814 /usr/lib64/php/modules/json.so
httpd   6360 apache  mem       REG              253,1   114624      1825 /usr/lib64/libaudit.so.1.0.0
httpd   6360 apache  mem       REG              253,1    61648     58833 /usr/lib64/libpam.so.0.83.1
httpd   6360 apache  mem       REG              253,1  1122008   6070326 /usr/lib64/libc-client.so.2007
httpd   6360 apache  mem       REG              253,1   102776 141495426 /usr/lib64/php/modules/imap.so
httpd   6360 apache  mem       REG              253,1    51400   1850049 /usr/lib64/libjbig.so.2.0
httpd   6360 apache  mem       REG              253,1    88720    812344 /usr/lib64/libgcc_s-4.8.2-20140120.so.1
httpd   6360 apache  mem       REG              253,1    92864      2702 /usr/lib64/libgomp.so.1.0.0
httpd   6360 apache  mem       REG              253,1   100472    817654 /usr/lib64/libICE.so.6.3.0
httpd   6360 apache  mem       REG              253,1    32320    812749 /usr/lib64/libSM.so.6.0.1
httpd   6360 apache  mem       REG              253,1    41248   1490673 /usr/lib64/libltdl.so.7.3.0
httpd   6360 apache  mem       REG              253,1   424464   1169660 /usr/lib64/libXt.so.6.0.0
httpd   6360 apache  mem       REG              253,1    75856   1169631 /usr/lib64/libXext.so.6.4.0
httpd   6360 apache  mem       REG              253,1   251800   1169791 /usr/lib64/libfontconfig.so.1.7.0
httpd   6360 apache  mem       REG              253,1   475288   1850057 /usr/lib64/libtiff.so.5.2.0
httpd   6360 apache  mem       REG              253,1  2677064   2697510 /usr/lib64/libMagickCore.so.5.0.0
httpd   6360 apache  mem       REG              253,1  1140704   2697512 /usr/lib64/libMagickWand.so.5.0.0
httpd   6360 apache  mem       REG              253,1   417688 141495468 /usr/lib64/php/modules/imagick.so
httpd   6360 apache  mem       REG              253,1   197064   7039322 /usr/lib64/libGeoIP.so.1.5.0
httpd   6360 apache  mem       REG              253,1    20304 141495467 /usr/lib64/php/modules/geoip.so
httpd   6360 apache  mem       REG              253,1    15512    817658 /usr/lib64/libXau.so.6.0.0
httpd   6360 apache  mem       REG              253,1   136904    812743 /usr/lib64/libxcb.so.1.1.0
httpd   6360 apache  mem       REG              253,1   285296   1169372 /usr/lib64/libjpeg.so.62.1.0
httpd   6360 apache  mem       REG              253,1   179248    817645 /usr/lib64/libpng15.so.15.13.0
httpd   6360 apache  mem       REG              253,1    74480   2387214 /usr/lib64/libXpm.so.4.11.0
httpd   6360 apache  mem       REG              253,1  1318888   1169629 /usr/lib64/libX11.so.6.3.0
httpd   6360 apache  mem       REG              253,1   687608      3001 /usr/lib64/libfreetype.so.6.10.0
httpd   6360 apache  mem       REG              253,1   299824   2355384 /usr/lib64/libt1.so.5.1.2
httpd   6360 apache  mem       REG              253,1   345056 140404822 /usr/lib64/php/modules/gd.so
httpd   6360 apache  mem       REG              253,1  2713352 140404813 /usr/lib64/php/modules/fileinfo.so
httpd   6360 apache  mem       REG              253,1   176512 140404823 /usr/lib64/php/modules/dom.so
httpd   6360 apache  mem       REG              253,1   121296      2663 /usr/lib64/libsasl2.so.3.0.0
httpd   6360 apache  mem       REG              253,1   340144      4809 /usr/lib64/libldap-2.4.so.2.10.2
httpd   6360 apache  mem       REG              253,1    62800      4807 /usr/lib64/liblber-2.4.so.2.10.2
httpd   6360 apache  mem       REG              253,1   251824      1655 /usr/lib64/libnspr4.so
httpd   6360 apache  mem       REG              253,1    20016      1656 /usr/lib64/libplc4.so
httpd   6360 apache  mem       REG              253,1    15776      1657 /usr/lib64/libplds4.so
httpd   6360 apache  mem       REG              253,1   182008      1707 /usr/lib64/libnssutil3.so
httpd   6360 apache  mem       REG              253,1  1215920    343972 /usr/lib64/libnss3.so
httpd   6360 apache  mem       REG              253,1   164016    343974 /usr/lib64/libsmime3.so
httpd   6360 apache  mem       REG              253,1   259968    343975 /usr/lib64/libssl3.so
httpd   6360 apache  mem       REG              253,1   174072    204375 /usr/lib64/libssh2.so.1.0.1
httpd   6360 apache  mem       REG              253,1   208928      2488 /usr/lib64/libidn.so.11.6.11
httpd   6360 apache  mem       REG              253,1   422680    204377 /usr/lib64/libcurl.so.4.3.0
httpd   6360 apache  mem       REG              253,1    74648 140404812 /usr/lib64/php/modules/curl.so
httpd   6360 apache  mem       REG              253,1    32568 140404830 /usr/lib64/php/modules/bcmath.so
httpd   6360 apache  mem       REG              253,1    27512      1630 /usr/lib64/libnss_dns-2.17.so
httpd   6360 apache  mem       REG              253,1    58288      1632 /usr/lib64/libnss_files-2.17.so
httpd   6360 apache  mem       REG              253,1    15688      2803 /usr/lib64/libkeyutils.so.1.5
httpd   6360 apache  mem       REG              253,1    58480      4793 /usr/lib64/libkrb5support.so.0.1
httpd   6360 apache  mem       REG              253,1  2004600      2834 /usr/lib64/libcrypto.so.1.0.1e
httpd   6360 apache  mem       REG              253,1   445640      4796 /usr/lib64/libssl.so.1.0.1e
httpd   6360 apache  mem       REG              253,1    15840      1906 /usr/lib64/libcom_err.so.2.1
httpd   6360 apache  mem       REG              253,1   214816      4781 /usr/lib64/libk5crypto.so.3.1
httpd   6360 apache  mem       REG              253,1   929144      4791 /usr/lib64/libkrb5.so.3.3
httpd   6360 apache  mem       REG              253,1   308008      4777 /usr/lib64/libgssapi_krb5.so.2.2
httpd   6360 apache  mem       REG              253,1  1505240    818266 /usr/lib64/libxml2.so.2.9.1
httpd   6360 apache  mem       REG              253,1   113320      1624 /usr/lib64/libnsl-2.17.so
httpd   6360 apache  mem       REG              253,1    68192      1914 /usr/lib64/libbz2.so.1.0.6
httpd   6360 apache  mem       REG              253,1   491928      2502 /usr/lib64/libgmp.so.10.1.1
httpd   6360 apache  mem       REG              253,1   110808      1664 /usr/lib64/libresolv-2.17.so
httpd   6360 apache  mem       REG              253,1  4592464 205326337 /usr/lib64/httpd/modules/libphp5.so
httpd   6360 apache  mem       REG              253,1    27696 205326369 /usr/lib64/httpd/modules/mod_cgi.so
httpd   6360 apache  mem       REG              253,1    44048      1667 /usr/lib64/librt-2.17.so
httpd   6360 apache  mem       REG              253,1    15216      1711 /usr/lib64/libsystemd-daemon.so.0.0.10
httpd   6360 apache  mem       REG              253,1    11096 205326080 /usr/lib64/httpd/modules/mod_systemd.so
httpd   6360 apache  mem       REG              253,1    19448 205326061 /usr/lib64/httpd/modules/mod_proxy_scgi.so
httpd   6360 apache  mem       REG              253,1    39928 205326060 /usr/lib64/httpd/modules/mod_proxy_http.so
httpd   6360 apache  mem       REG              253,1    44168 205326059 /usr/lib64/httpd/modules/mod_proxy_ftp.so
httpd   6360 apache  mem       REG              253,1    11136 205326058 /usr/lib64/httpd/modules/mod_proxy_fdpass.so
httpd   6360 apache  mem       REG              253,1    19360 205326057 /usr/lib64/httpd/modules/mod_proxy_fcgi.so
httpd   6360 apache  mem       REG              253,1    15272 205326056 /usr/lib64/httpd/modules/mod_proxy_express.so
httpd   6360 apache  mem       REG              253,1    19384 205326055 /usr/lib64/httpd/modules/mod_proxy_connect.so
httpd   6360 apache  mem       REG              253,1    48160 205326054 /usr/lib64/httpd/modules/mod_proxy_balancer.so
httpd   6360 apache  mem       REG              253,1    52416 205326053 /usr/lib64/httpd/modules/mod_proxy_ajp.so
httpd   6360 apache  mem       REG              253,1    15304 205326395 /usr/lib64/httpd/modules/mod_lbmethod_heartbeat.so
httpd   6360 apache  mem       REG              253,1    11112 205326394 /usr/lib64/httpd/modules/mod_lbmethod_bytraffic.so
httpd   6360 apache  mem       REG              253,1    11112 205326393 /usr/lib64/httpd/modules/mod_lbmethod_byrequests.so
httpd   6360 apache  mem       REG              253,1    11120 205326392 /usr/lib64/httpd/modules/mod_lbmethod_bybusyness.so
httpd   6360 apache  mem       REG              253,1   110472 205326052 /usr/lib64/httpd/modules/mod_proxy.so
httpd   6360 apache  mem       REG              253,1    31864 205326049 /usr/lib64/httpd/modules/mod_mpm_prefork.so
httpd   6360 apache  mem       REG              253,1  1141552      1622 /usr/lib64/libm-2.17.so
httpd   6360 apache  mem       REG              253,1   193808      2176 /usr/lib64/liblua-5.1.so
httpd   6360 apache  mem       REG              253,1   117088 203433276 /usr/lib64/httpd/modules/mod_lua.so
httpd   6360 apache  mem       REG              253,1    19616 205326375 /usr/lib64/httpd/modules/mod_dav_lock.so
httpd   6360 apache  mem       REG              253,1    57088 205326374 /usr/lib64/httpd/modules/mod_dav_fs.so
httpd   6360 apache  mem       REG              253,1   102368 205326373 /usr/lib64/httpd/modules/mod_dav.so
httpd   6360 apache  mem       REG              253,1    15264 205326086 /usr/lib64/httpd/modules/mod_vhost_alias.so
httpd   6360 apache  mem       REG              253,1    11088 205326085 /usr/lib64/httpd/modules/mod_version.so
httpd   6360 apache  mem       REG              253,1    11160 205326083 /usr/lib64/httpd/modules/mod_userdir.so
httpd   6360 apache  mem       REG              253,1    15296 205326082 /usr/lib64/httpd/modules/mod_unixd.so
httpd   6360 apache  mem       REG              253,1    11128 205326081 /usr/lib64/httpd/modules/mod_unique_id.so
httpd   6360 apache  mem       REG              253,1    11160 205326079 /usr/lib64/httpd/modules/mod_suexec.so
httpd   6360 apache  mem       REG              253,1    15256 205326078 /usr/lib64/httpd/modules/mod_substitute.so
httpd   6360 apache  mem       REG              253,1    23448 205326077 /usr/lib64/httpd/modules/mod_status.so
httpd   6360 apache  mem       REG              253,1    23552 205326075 /usr/lib64/httpd/modules/mod_socache_shmcb.so
httpd   6360 apache  mem       REG              253,1    11176 205326074 /usr/lib64/httpd/modules/mod_socache_memcache.so
httpd   6360 apache  mem       REG              253,1    15312 205326073 /usr/lib64/httpd/modules/mod_socache_dbm.so
httpd   6360 apache  mem       REG              253,1    15392 205326072 /usr/lib64/httpd/modules/mod_slotmem_shm.so
httpd   6360 apache  mem       REG              253,1    11224 205326071 /usr/lib64/httpd/modules/mod_slotmem_plain.so
httpd   6360 apache  mem       REG              253,1    15312 205326070 /usr/lib64/httpd/modules/mod_setenvif.so
httpd   6360 apache  mem       REG              253,1    69024 205326068 /usr/lib64/httpd/modules/mod_rewrite.so
httpd   6360 apache  mem       REG              253,1    15304 205326066 /usr/lib64/httpd/modules/mod_reqtimeout.so
httpd   6360 apache  mem       REG              253,1    15288 205326065 /usr/lib64/httpd/modules/mod_remoteip.so
httpd   6360 apache  mem       REG              253,1    35992 205326051 /usr/lib64/httpd/modules/mod_negotiation.so
httpd   6360 apache  mem       REG              253,1    23608 203970151 /usr/lib64/httpd/modules/mod_mime.so
httpd   6360 apache  mem       REG              253,1    27720 203970152 /usr/lib64/httpd/modules/mod_mime_magic.so
httpd   6360 apache  mem       REG              253,1    11208 205326399 /usr/lib64/httpd/modules/mod_logio.so
httpd   6360 apache  mem       REG              253,1    28184 205326396 /usr/lib64/httpd/modules/mod_log_config.so
httpd   6360 apache  mem       REG              253,1    28104 205326391 /usr/lib64/httpd/modules/mod_info.so
httpd   6360 apache  mem       REG              253,1    52512 205326390 /usr/lib64/httpd/modules/mod_include.so
httpd   6360 apache  mem       REG              253,1    23736 205326387 /usr/lib64/httpd/modules/mod_headers.so
httpd   6360 apache  mem       REG              253,1    19408 205326386 /usr/lib64/httpd/modules/mod_filter.so
httpd   6360 apache  mem       REG              253,1    23536 205326384 /usr/lib64/httpd/modules/mod_ext_filter.so
httpd   6360 apache  mem       REG              253,1    15304 205326383 /usr/lib64/httpd/modules/mod_expires.so
httpd   6360 apache  mem       REG              253,1    11160 205326382 /usr/lib64/httpd/modules/mod_env.so
httpd   6360 apache  mem       REG              253,1    11152 205326381 /usr/lib64/httpd/modules/mod_echo.so
httpd   6360 apache  mem       REG              253,1    11176 205326380 /usr/lib64/httpd/modules/mod_dumpio.so
httpd   6360 apache  mem       REG              253,1    15256 205326379 /usr/lib64/httpd/modules/mod_dir.so
httpd   6360 apache  mem       REG              253,1    90632      1822 /usr/lib64/libz.so.1.2.7
httpd   6360 apache  mem       REG              253,1    31816 205326377 /usr/lib64/httpd/modules/mod_deflate.so
httpd   6360 apache  mem       REG              253,1    23616 205326376 /usr/lib64/httpd/modules/mod_dbd.so
httpd   6360 apache  mem       REG              253,1    11080 205326372 /usr/lib64/httpd/modules/mod_data.so
httpd   6360 apache  mem       REG              253,1    36080 205326367 /usr/lib64/httpd/modules/mod_cache_disk.so
httpd   6360 apache  mem       REG              253,1    77344 205326366 /usr/lib64/httpd/modules/mod_cache.so
httpd   6360 apache  mem       REG              253,1    40056 205326364 /usr/lib64/httpd/modules/mod_autoindex.so
httpd   6360 apache  mem       REG              253,1     7024 205326363 /usr/lib64/httpd/modules/mod_authz_user.so
httpd   6360 apache  mem       REG              253,1    11128 205326362 /usr/lib64/httpd/modules/mod_authz_owner.so
httpd   6360 apache  mem       REG              253,1    11168 205326361 /usr/lib64/httpd/modules/mod_authz_host.so
httpd   6360 apache  mem       REG              253,1    11168 205326360 /usr/lib64/httpd/modules/mod_authz_groupfile.so
httpd   6360 apache  mem       REG              253,1    11176 205326359 /usr/lib64/httpd/modules/mod_authz_dbm.so
httpd   6360 apache  mem       REG              253,1    15288 205326358 /usr/lib64/httpd/modules/mod_authz_dbd.so
httpd   6360 apache  mem       REG              253,1    23720 205326357 /usr/lib64/httpd/modules/mod_authz_core.so
httpd   6360 apache  mem       REG              253,1    19536 205326356 /usr/lib64/httpd/modules/mod_authn_socache.so
httpd   6360 apache  mem       REG              253,1    11152 205326355 /usr/lib64/httpd/modules/mod_authn_file.so
httpd   6360 apache  mem       REG              253,1    11176 205326354 /usr/lib64/httpd/modules/mod_authn_dbm.so
httpd   6360 apache  mem       REG              253,1    15256 205326353 /usr/lib64/httpd/modules/mod_authn_dbd.so
httpd   6360 apache  mem       REG              253,1    15344 205326352 /usr/lib64/httpd/modules/mod_authn_core.so
httpd   6360 apache  mem       REG              253,1    11136 205326351 /usr/lib64/httpd/modules/mod_authn_anon.so
httpd   6360 apache  mem       REG              253,1    36048 205326350 /usr/lib64/httpd/modules/mod_auth_digest.so
httpd   6360 apache  mem       REG              253,1    15320 205326349 /usr/lib64/httpd/modules/mod_auth_basic.so
httpd   6360 apache  mem       REG              253,1    11128 205326347 /usr/lib64/httpd/modules/mod_allowmethods.so
httpd   6360 apache  mem       REG              253,1    15352 205326346 /usr/lib64/httpd/modules/mod_alias.so
httpd   6360 apache  mem       REG              253,1    11152 205326345 /usr/lib64/httpd/modules/mod_actions.so
httpd   6360 apache  mem       REG              253,1    11200 205326344 /usr/lib64/httpd/modules/mod_access_compat.so
httpd   6360 apache  mem       REG              253,1   502040      1203 /usr/lib64/libfreebl3.so
httpd   6360 apache  mem       REG              253,1    20032      1831 /usr/lib64/libuuid.so.1.3.0
httpd   6360 apache  mem       REG              253,1   153184      1724 /usr/lib64/liblzma.so.5.0.99
httpd   6360 apache  mem       REG              253,1  2107600      1614 /usr/lib64/libc-2.17.so
httpd   6360 apache  mem       REG              253,1    19512      1620 /usr/lib64/libdl-2.17.so
httpd   6360 apache  mem       REG              253,1   141616      1662 /usr/lib64/libpthread-2.17.so
httpd   6360 apache  mem       REG              253,1   198600   5635062 /usr/lib64/libapr-1.so.0.4.8
httpd   6360 apache  mem       REG              253,1  1846280      4900 /usr/lib64/libdb-5.3.so
httpd   6360 apache  mem       REG              253,1   173288      1997 /usr/lib64/libexpat.so.1.6.0
httpd   6360 apache  mem       REG              253,1    40816      1618 /usr/lib64/libcrypt-2.17.so
httpd   6360 apache  mem       REG              253,1   172288   5635064 /usr/lib64/libaprutil-1.so.0.5.2
httpd   6360 apache  mem       REG              253,1   147120      1819 /usr/lib64/libselinux.so.1
httpd   6360 apache  mem       REG              253,1   398264      1803 /usr/lib64/libpcre.so.1.2.0
httpd   6360 apache  mem       REG              253,1   160240      1607 /usr/lib64/ld-2.17.so
httpd   6360 apache  DEL       REG                0,4            3784057 /dev/zero
httpd   6360 apache  DEL       REG                0,4          832438288 /SYSV0112bd72
httpd   6360 apache    0r      CHR                1,3      0t0      1028 /dev/null
httpd   6360 apache    1u     unix 0xffff880491d9d500      0t0   3784775 socket
httpd   6360 apache    2w      REG              253,1    95622   8326764 /var/log/httpd/error_log
httpd   6360 apache    3u     sock                0,7      0t0   3784778 protocol: TCP
httpd   6360 apache    4u     IPv6            3784779      0t0       TCP *:http (LISTEN)
httpd   6360 apache    5r     FIFO                0,8      0t0   3784049 pipe
httpd   6360 apache    6w     FIFO                0,8      0t0   3784049 pipe
httpd   6360 apache    7w      REG              253,1 11845300   8326761 /var/log/httpd/access_log
httpd   6360 apache    8u  a_inode                0,9        0      6936 [eventpoll]
Categories: linux Tags: ,

Import Blob data To Mysql

January 13, 2015 Leave a comment

If you have large blob data in your tables most likely mysql will die on you while trying to import.

Solution is add

max_allowed_packet=32M (or whatever value you require)

to [mysqld] section in your my.cnf file.

Categories: Uncategorized Tags:

Logitech M570 Centos 7 2015 Review

January 10, 2015 Leave a comment

When i first received Logitech m570 on December 2014 i tried it on Asus u46e laptop (centos 7 w 3.10.0-123.13.2.el7.x86_64 kernel) and without any problems i started to use it.

You can check that review here

Two days ago i received my new desktop (ThinkServer TS140) so i installed centos 7 (ps: centos 7 does not boot on legacy mode after installation. You have to change to uefi only mode in bios and install centos)

Attached the mouse  and nothing happens. Centos recognizes logitech but not as unifying device.

Jan  8 17:48:12 m kernel: logitech-djreceiver 0003:046D:C52B.001D: hiddev0,hidraw2: USB HID v1.11 Device [Logitech USB Receiver] on usb-0000:00:14.0-7/input2

so i thought maybe i forget to install some drivers, bottom line i started installation with minimal iso and i might have skip some drivers and/or libraries. After some research i found this bug report:

0007340: Broken support for Logitech Unifying Receiver – Paired mouse not recognized as HID

Seems like with 3.10.0-123 (or older ones) kernel may or may not recognize Unifying Device based on what im not sure. Some reported if there are only usb 3 then there is no problem or visa versa.

But in my situation both asus and thinkserver have usb 2 and usb 3 interfaces so i’m still not sure what is causing this bug and i didnt have time to investigate further.

Now im running 3.18.1-1 kernel on ThinkServer TS140 and m570 is working fine

Jan  8 18:10:56 m kernel: logitech-djreceiver 0003:046D:C52B.0004: hiddev0,hidraw1: USB HID v1.11 Device [Logitech USB Receiver] on usb-0000:00:14.0-7/input2
Jan  8 18:10:56 m kernel: logitech-djdevice 0003:046D:C52B.0005: input,hidraw2: USB HID v1.11 Mouse [Logitech Unifying Device. Wireless PID:1028] on usb-0000:00:14.0-7:1

Linux Probe / List Hardware

December 22, 2014 Leave a comment

dmidecode – tool for dumping a computer’s DMI (some say SMBIOS) table contents in a human-readable format.This table contains a description of the system’s hardware components, as well as other useful pieces of information such as serial numbers and BIOS revision

[root@m backup]# dmidecode --type slot
# dmidecode 2.12
# SMBIOS entry point at 0x000f0480
SMBIOS 2.8 present.

Handle 0x001C, DMI type 9, 17 bytes
System Slot Information
	Designation: PCIE16X
	Type: x16 PCI Express x16
	Current Usage: Available
	Length: Long
	ID: 1
	Characteristics:
		3.3 V is provided
		Opening is shared
		PME signal is supported
	Bus Address: 0000:ff:1f.7

Handle 0x001D, DMI type 9, 17 bytes
System Slot Information
	Designation: PCIE1X
	Type: x1 PCI Express x1
	Current Usage: Available
	Length: Short
	ID: 2
	Characteristics:
		3.3 V is provided
		Opening is shared
		PME signal is supported
	Bus Address: 0000:ff:1f.7

Handle 0x001E, DMI type 9, 17 bytes
System Slot Information
	Designation: PCIE4X
	Type: x4 PCI Express x4
	Current Usage: Available
	Length: Short
	ID: 3
	Characteristics:
		3.3 V is provided
		Opening is shared
		PME signal is supported
	Bus Address: 0000:ff:1f.7

Handle 0x001F, DMI type 9, 17 bytes
System Slot Information
	Designation: PCI1
	Type: x1 PCI
	Current Usage: Available
	Length: Short
	ID: 4
	Characteristics:
		3.3 V is provided
		Opening is shared
		PME signal is supported
	Bus Address: 0000:ff:1f.7

lshw – tool to extract detailed information on the hardware configuration of the machine. It can report exact memory configuration, firmware version, mainboard configuration, CPU version and speed, cache configuration, bus speed, etc. on DMI-capable x86 or IA-64 systems and on some PowerPC machines (PowerMac G4 is known to work).
blkid – locate/print block device attributes

[root@m backup]# blkid -p -n ext3,ext4 /dev/sda1
/dev/sda1: UUID="4ea235a9-2db2-3a11-856a-2cd7f27d75ff" VERSION="1.0" TYPE="ext4" USAGE="filesystem" PART_ENTRY_SCHEME="dos" PART_ENTRY_TYPE="0x83" PART_ENTRY_FLAGS="0x80" PART_ENTRY_NUMBER="1" PART_ENTRY_OFFSET="2048" PART_ENTRY_SIZE="1024000" PART_ENTRY_DISK="8:0"

lspci – utility for displaying information about PCI buses in the system and devices connected to them.
hwinfo – to probe for the hardware present in the system. It can be used to generate a system overview log which can be later used for support.

last, lastb – show listing of last logged in users
findfs – find a filesystem by label or UUID
findmnt – find a filesystem

or install inxi

[root@mar ~]# inxi -v 3
System:    Host: mar Kernel: 3.10.0-123.13.1.el7.x86_64 x86_64 (64 bit gcc: 4.8.2) Desktop: MATE 1.8.1
           Distro: CentOS Linux release 7.0.1406 (Core)
Machine:   Mobo: ASUSTeK model: U46E v: 1.0 serial: NB-1214556190
           Bios: American Megatrends v: U46E.204 date: 05/17/2011
CPU:       Dual core Intel Core i5-2410M (-HT-MCP-) cache: 3072 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 9178
           clock speeds: max: 2900 MHz 1: 2860 MHz 2: 2699 MHz 3: 2741 MHz 4: 2699 MHz
Graphics:  Card: Intel 2nd Generation Core Processor Family Integrated Graphics Controller bus-ID: 00:02.0
           Display Server: X.org 1.15.0 drivers: intel (unloaded: fbdev,vesa)
           tty size: 237x63 Advanced Data: N/A for root
Network:   Card-1: Intel Centrino Wireless-N + WiMAX 6150 driver: iwlwifi v: in-tree: bus-ID: 02:00.0
           IF: wlp2s0 state: down mac: 30:15:c1:54:38:6c
           Card-2: Qualcomm Atheros AR8151 v2.0 Gigabit Ethernet
           driver: atl1c v: 1.0.1.1-NAPI port: a000 bus-ID: 04:00.0
           IF: enp4s0 state: up speed: 1000 Mbps duplex: full mac: 11:da:e1:15:4c:cd
Drives:    HDD Total Size: 750.2GB (53.9% used) ID-1: model: ST9750423AS
Info:      Processes: 288 Uptime: 2 days Memory: 5619.5/7733.8MB Init: systemd runlevel: 5 Gcc sys: 4.8.2
           Client: Shell (bash 4.2.451) inxi: 2.2.16 

View current linux network driver:

[root@mar ~]# dmesg | grep 'enp4s0'
[    1.291293] systemd-udevd[284]: renamed network interface eth0 to enp4s0
[   21.056761] atl1c 0000:04:00.0: atl1c: enp4s0 NIC Link is Up
[ 4312.360231] device enp4s0 entered promiscuous mode

Get detailed info on driver:

[root@mar ~]# modinfo atl1c
filename:       /lib/modules/3.10.0-123.13.1.el7.x86_64/kernel/drivers/net/ethernet/atheros/atl1c/atl1c.ko
version:        1.0.1.1-NAPI
license:        GPL
description:    Qualcom Atheros 100/1000M Ethernet Network Driver
author:         Qualcomm Atheros Inc., 
author:         Jie Yang
srcversion:     D7C51AE9EAEA06DE7F10568
alias:          pci:v00001969d00001083sv*sd*bc*sc*i*
alias:          pci:v00001969d00001073sv*sd*bc*sc*i*
alias:          pci:v00001969d00002062sv*sd*bc*sc*i*
alias:          pci:v00001969d00002060sv*sd*bc*sc*i*
alias:          pci:v00001969d00001062sv*sd*bc*sc*i*
alias:          pci:v00001969d00001063sv*sd*bc*sc*i*
depends:        
intree:         Y
vermagic:       3.10.0-123.13.1.el7.x86_64 SMP mod_unload modversions 
signer:         CentOS Linux kernel signing key
sig_key:        DE:D3:BD:6A:08:F8:8B:A9:1C:08:E3:20:34:E4:D1:E0:1F:1A:EB:2D
sig_hashalgo:   sha256
Categories: linux Tags: ,

Virtualbox clone linux

December 22, 2014 Leave a comment

Remove or move /etc/udev/rules.d/70-persistent-net.rules from master machine.

Shutdown and clone master machine (select reinitialize mac card). Boot new machine.

Regenerate uuid for network card:

[root@localhost ~]# uuidgen eth0
6c63c2af-16b5-4df0-a153-afc347a06ce6

Edit ifcfg-eth0 ,enter new mac address and UUID on clone machine:

[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=08:00:27:8F:D6:C6
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=none
IPV6INIT=no
USERCTL=no
NM_CONTROLLED=yes
PEERDNS=yes
IPADDR=192.168.1.153
NETMASK=255.255.255.0
UUID=6c63c2af-16b5-4df0-a153-afc347a06ce6

Change hostname and gateway if required

[root@localhost ~]# vim /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=localhost.localdomain
GATEWAY=192.168.1.1

Reboot clone machine

Centos 7 low screen resolution problem

December 16, 2014 Leave a comment

somehow after upgrading one of my laptops to centos 7 my second monitor stuck to 1024×768 resolution. This is how i solved it:

Create the new resolution

[marko@marko ~]$ cvt 1280 1024 75
# 1280x1024 74.90 Hz (CVT 1.31M4) hsync: 80.30 kHz; pclk: 138.75 MHz
Modeline "1280x1024_75.00"  138.75  1280 1368 1504 1728  1024 1027 1034 1072 -hsync +vsync

Declare new resolution with xrandr

xrandr --newmode "1280x1024_75.00"  138.75  1280 1368 1504 1728  1024 1027 1034 1072 -hsync +vsync

Add new resolution to VGA1 (my second monitor)

xrandr --addmode VGA1 1280x1024_75.00

Create layout script and run

[marko@marko ~]$ cat layout.sh 
#!/bin/sh
xrandr --output HDMI1 --off --output LVDS1 --mode 1366x768 --pos 0x0 --rotate normal --output DP1 --off --output VGA1 --mode 1280x1024_60 --pos 1366x0 --rotate normal

Logitech m570 Centos 7 review

December 5, 2014 Leave a comment

Easiest way to change side buttons (or any other button in that matter) behaviour for logitech m570 trackball mouse under linux is xbindkeys.

Unfortunately this package is not available for centos 7 ( i do not know why  or if its replaced with another mechanism )  google search return absolutely no results.

So to get around this problem you have to install :

xautomation-1.07-3.fc19.x86_64.rpm
xbindkeys-1.8.5-4.fc19.x86_64.rpm

These are fedora 19 packages but works under centos 7. You can not install fedora 20 or 21 packages as they require libpng16.so.16 and that package is not available under centos as well

After you install above packages create .xbindkeysrc file under your home directory and paste below lines:

"xte 'key Page_Up'"
b:9

"xte 'key Page_Down'"
b:8

now start xbindkeys

[bakim@marko ~]$ xbindkeys

and test your mouse your side keys will act as key up and key down

Also with this setup side keys will act as back and forward button in firefox if you click them while you are holding scroll wheel.

Some useful xte key codes, this keys are case sensitive:

Home
Left
Up
Right
Down
Page_Up
Page_Down
End
Return
BackSpace
Tab
Escape
Delete
Shift_L
Shift_R
Control_L
Control_R
Meta_L
Meta_R
Alt_L
Alt_R