Translate

2015년 7월 23일 목요일

[Ubuntu] 우분투 14 에 카스퍼스키 백신 설치하기



사용하는 우분투에 카스퍼스키를 설치해야 하는 일이 있어서 설치를 해봤다.

Kaspersky Download (Link)


작업은 다음과 같이 했다.
(libc6-i386 패키지가 설치되어 있다면 apt-get 명령어는 하지 않아도 된다.)


1004lucifer@1004lucifer-desktop:~/다운로드$ dpkg -i kes4lwks_8.0.1-50_i386.deb 
dpkg: error: 요청한 작업을 하려면 수퍼유저 권한이 필요합니다
1004lucifer@1004lucifer-desktop:~/다운로드$ sudo dpkg -i kes4lwks_8.0.1-50_i386.deb 
[sudo] password for 1004lucifer: 
(데이터베이스 읽는중 ...현재 226817개의 파일과 디렉터리가 설치되어 있습니다.)
Preparing to unpack kes4lwks_8.0.1-50_i386.deb ...
Error: libc6-i386 package must be installed before installing this package!
dpkg: error processing archive kes4lwks_8.0.1-50_i386.deb (--install):
 새로운 pre-installation 스크립트 하위 프로세스가 오류 1번을 리턴했습니다
처리하는데 오류가 발생했습니다:
 kes4lwks_8.0.1-50_i386.deb
1004lucifer@1004lucifer-desktop:~/다운로드$ 
1004lucifer@1004lucifer-desktop:~/다운로드$ 
1004lucifer@1004lucifer-desktop:~/다운로드$ sudo apt-get install libc6-i386
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다       
상태 정보를 읽는 중입니다... 완료
다음 새 패키지를 설치할 것입니다:
  libc6-i386
0개 업그레이드, 1개 새로 설치, 0개 제거 및 0개 업그레이드 안 함.
2,206 k바이트 아카이브를 받아야 합니다.
이 작업 후 9,860 k바이트의 디스크 공간을 더 사용하게 됩니다.
받기:1 http://kr.archive.ubuntu.com/ubuntu/ trusty-updates/main libc6-i386 amd64 2.19-0ubuntu6.6 [2,206 kB]
내려받기 2,206 k바이트, 소요시간 1초 (2,196 k바이트/초)
Selecting previously unselected package libc6-i386.
(데이터베이스 읽는중 ...현재 226817개의 파일과 디렉터리가 설치되어 있습니다.)
Preparing to unpack .../libc6-i386_2.19-0ubuntu6.6_amd64.deb ...
Unpacking libc6-i386 (2.19-0ubuntu6.6) ...
libc6-i386 (2.19-0ubuntu6.6) 설정하는 중입니다 ...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
1004lucifer@1004lucifer-desktop:~/다운로드$ 
1004lucifer@1004lucifer-desktop:~/다운로드$ 
1004lucifer@1004lucifer-desktop:~/다운로드$ sudo dpkg -i kes4lwks_8.0.1-50_i386.deb 
(데이터베이스 읽는중 ...현재 227124개의 파일과 디렉터리가 설치되어 있습니다.)
Preparing to unpack kes4lwks_8.0.1-50_i386.deb ...
Unpacking kes4lwks (8.0.1-50) ...
kes4lwks (8.0.1-50) 설정하는 중입니다 ...
 * Starting Kaspersky Lab Framework Supervisor kes4lwks-supervisor                                        [ OK ] 
Kaspersky Endpoint Security 8 for Linux has been installed successfully,
but it must be properly configured before using.
Please run /opt/kaspersky/kes4lwks/bin/kes4lwks-setup.pl script manually to
configure it.
Processing triggers for bamfdaemon (0.5.1+14.04.20140409-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.54ubuntu1.1) ...
Processing triggers for gnome-menus (3.10.1-0ubuntu2) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
ureadahead will be reprofiled on next reboot
1004lucifer@1004lucifer-desktop:~/다운로드$



2015년 7월 21일 화요일

[Solaris] 솔라리스 11 에 SVN Server 설치 - OpenCSW




환경

OS: Solaris 11
(작업은 root 계정으로 진행)

root@solaris11:~# uname -a
SunOS solaris11 5.11 11.2 i86pc i386 i86pc
root@solaris11:~#





PS. 인터넷이 안되는 상황(offline)이라면 아래의 링크로 들어가 설치하길 바란다.
  - [Solaris] 솔라리스 11 에 SVN Server 설치 (오프라인) - CollabNet





SVN(Subversion) 설치 방법
설치할 SVN을 선택한다: http://subversion.apache.org/packages.html#solaris

그중에 나는 OpenCSW 설치 (http://www.opencsw.org/packages/subversion/)
설치파일을 다운받을 필요 없이 아래와 같은 명령어로 설치가 가능하다.

# pkgadd -d http://get.opencsw.org/now
# /opt/csw/bin/pkgutil -U
# /opt/csw/bin/pkgutil -y -i subversion 
# /usr/sbin/pkgchk -L CSWsvn



설치가 완료되었다면 다음과 같이 저장소를 생성 및 셋팅 한다.


# svnadmin create --fs-type fsfs {저장소 경로}
# chmod -R g+w {저장소 경로}
# chown -R nobody:nobody {저장소 경로}

# vi {저장소 경로}/conf/svnserve.conf
 아래의 부분의 주석을 제거한다.
  anon-access = read
  auth-access = write
  password-db = passwd

# vi {저장소 경로}/conf/passwd
  사용자 계정과 패스워드를 입력한다.

# svnserve -d -r {저장소 경로}
  SVN Server 를 기동

# svn mkdir --editor-cmd=vi svn://localhost/{저장소 명}
  아무입력 없이 ':wq' 입력하여 종료한다.
  중간에 나오는 root 는 시스템계정 '사용자명' 은 조금전 생성한 사용자를 입력한다.



작업 후 svn://{IP_ADDRESS} 경로로 SVN을 접속해보면 접속이 되는 것을 확인 할 수 있다.





아래는 내가 실제로 작업한 부분..


1004lucifer@1004lucifer-desktop:~/다운로드$ ssh 192.168.0.81
The authenticity of host '192.168.0.81 (192.168.0.81)' can't be established.
RSA key fingerprint is bc:c2:b7:4c:83:c7:bb:68:8f:6b:3a:8d:fa:54:74:f4.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.0.81' (RSA) to the list of known hosts.
Password: 
Last login: Wed Jul 22 02:31:49 2015
Oracle Corporation      SunOS 5.11      11.2    June 2014
1004lucifer@solaris11:~$ 
1004lucifer@solaris11:~$ sudo bash
Password: 
root@solaris11:/export/home/1004lucifer# 
root@solaris11:/export/home/1004lucifer# cd ~
root@solaris11:~# 
root@solaris11:~# ls -l
total 0
root@solaris11:~# 
root@solaris11:~# pkgadd -d http://get.opencsw.org/now

## Downloading...
..............25%..............50%..............75%..............100%
## Download Complete


The following packages are available:
  1  CSWpkgutil     pkgutil - Installs Solaris packages easily
                    (all) 2.6.7,REV=2014.10.16

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]: 

Processing package instance <CSWpkgutil> from <http://get.opencsw.org/now>

pkgutil - Installs Solaris packages easily(all) 2.6.7,REV=2014.10.16
Please see /opt/csw/share/doc/pkgutil/license for license information.
## Processing package information.
## Processing system information.
## Verifying package dependencies.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

This package contains scripts which will be executed with super-user
permission during the process of installing this package.

Do you want to continue with the installation of <CSWpkgutil> [y,n,?] y

Installing pkgutil - Installs Solaris packages easily as <CSWpkgutil>

## Installing part 1 of 1.
/etc/opt/csw/pkgutil.conf.CSW
/etc/opt/csw <implied directory>
/opt/csw/bin/pkgutil
/opt/csw <implied directory>
/opt/csw/bin <implied directory>
/opt/csw/etc/pkgutil.conf.CSW
/opt/csw/etc <implied directory>
/opt/csw/libexec/pkgutil/wget-i386
/opt/csw/libexec/pkgutil/wget-sparc
/opt/csw/share/doc/pkgutil/license
/opt/csw/share/doc/pkgutil/readme
/opt/csw/share/man/man1/pkgutil.1
/opt/csw/var/pkgutil/admin.CSW
[ verifying class <none> ]
## Executing postinstall script.

Copying sample pkgutil.conf to /opt/csw/etc.
Copying sample pkgutil.conf to /etc/opt/csw.
Copying sample admin from /opt/csw/var/pkgutil to /var/opt/csw/pkgutil.

NOTE!
NOTE! Make sure to check out any changes in /etc/opt/csw/pkgutil.conf.CSW.
NOTE!


Installation of <CSWpkgutil> was successful.
root@solaris11:~# 
root@solaris11:~# /opt/csw/bin/pkgutil -U
=> Fetching new catalog and descriptions (http://mirror.opencsw.org/opencsw/testing/i386/5.11) if available ...
==> 3736 packages loaded from /var/opt/csw/pkgutil/catalog.mirror.opencsw.org_opencsw_testing_i386_5.11
root@solaris11:~# 
root@solaris11:~# 
root@solaris11:~# /opt/csw/bin/pkgutil -y -i subversion 
Solving needed dependencies ...
Solving dependency order ...
Install 39 NEW packages:
        CSWbdb48-4.8.30,REV=2010.12.06_rev=p0 (opencsw/testing)
        CSWcommon-1.5,REV=2010.12.11 (opencsw/testing)
        CSWggettext-data-0.18.1.1,p,REV=2011.03.15 (opencsw/testing)
        CSWglib2-2.41.0,REV=2014.05.31 (opencsw/testing)
        CSWiconv-1.14,REV=2011.08.08 (opencsw/testing)

...

Pausing for 5 seconds -- Ctrl-C to abort upgrade.

!! WARNING !! WARNING !! WARNING !! WARNING !! WARNING !! WARNING !! WARNING !!


Installation of <CSWsvn> was successful.
root@solaris11:~# 
root@solaris11:~# 
root@solaris11:~# 
root@solaris11:~# /usr/sbin/pkgchk -L CSWsvn
/opt/csw/bin/svn f none 0755 root bin 375128 33958 1392379858 CSWsvn
/opt/csw/bin/svnadmin f none 0755 root bin 61584 7843 1392379858 CSWsvn
/opt/csw/bin/svndumpfilter f none 0755 root bin 31356 37209 1392379858 CSWsvn
/opt/csw/bin/svnlook f none 0755 root bin 58316 44710 1392379858 CSWsvn
/opt/csw/bin/svnmucc f none 0755 root bin 29688 45253 1392379858 CSWsvn

...

/opt/csw/share/man/man5 d none 0755 root bin CSWlibmagic-data CSWlibkrb5-3 CSWsvn
/opt/csw/share/man/man5/svnserve.conf.5 f none 0644 root bin 3801 7279 1392379311 CSWsvn
/opt/csw/share/man/man8 d none 0755 root bin CSWsvn
/opt/csw/share/man/man8/svnserve.8 f none 0644 root bin 5379 19289 1392379311 CSWsvn
root@solaris11:~# 
root@solaris11:~# 
root@solaris11:~# cd /opt/csw/bin/
root@solaris11:/opt/csw/bin# ls -l
total 2112
drwxr-xr-x   2 root     bin            5  7월 22일  02:39 amd64
-rwxr-xr-x   1 root     bin        17840 2014년  6월  1일 gapplication
-rwxr-xr-x   1 root     bin        11592 2014년  6월  1일 gio-querymodules
-rwxr-xr-x   1 root     bin        23088 2014년  6월  1일 gsettings
drwxr-xr-x   2 root     bin            2  7월 22일  02:39 i486
drwxr-xr-x   2 root     bin            2  7월 22일  02:39 pentium
-rwxr-xr-x   1 root     bin       106397 2014년 10월 17일 pkgutil
-rwxr-xr-x   1 root     bin       375128 2014년  2월 14일 svn
-rwxr-xr-x   1 root     bin        61584 2014년  2월 14일 svnadmin
-rwxr-xr-x   1 root     bin        31356 2014년  2월 14일 svndumpfilter
-rwxr-xr-x   1 root     bin        58316 2014년  2월 14일 svnlook
-rwxr-xr-x   1 root     bin        29688 2014년  2월 14일 svnmucc
-rwxr-xr-x   1 root     bin        55228 2014년  2월 14일 svnrdump
-rwxr-xr-x   1 root     bin        92708 2014년  2월 14일 svnserve
-rwxr-xr-x   1 root     bin        48228 2014년  2월 14일 svnsync
-rwxr-xr-x   1 root     bin        14856 2014년  2월 14일 svnversion
-rwxr-xr-x   1 root     bin        46920 2011년 12월  9일 update-mime-database
-rwxr-xr-x   1 root     bin        15516 2013년  8월 16일 xmlcatalog
-rwxr-xr-x   1 root     bin        56112 2013년  8월 16일 xmllint
root@solaris11:/opt/csw/bin# 
root@solaris11:/opt/csw/bin# ./svnadmin help
일반적인 사용법: svnadmin SUBCOMMAND REPOS_PATH  [ARGS & OPTIONS ...]
특정 부속 명령의 사용법을 위해서는 'svnadmin help <subcommand>' 를 참조하십시오.
'svnlook --version'으로 버전과 파일시스템 모듈을 볼 수가 있습니다.

가능한 부속 명령어 목록:
   crashtest
   create
   deltify
   dump
   freeze
   help (?, h)
   hotcopy
   list-dblogs
   list-unused-dblogs
   load
   lock
   lslocks
   lstxns
   pack
   recover
   rmlocks
   rmtxns
   setlog
   setrevprop
   setuuid
   unlock
   upgrade
   verify

root@solaris11:/opt/csw/bin# 
root@solaris11:/opt/csw/bin# mkdir /root/svn
root@solaris11:/opt/csw/bin# 
root@solaris11:/opt/csw/bin# 
root@solaris11:/opt/csw/bin# ./svnadmin create --fs-type fsfs /root/svn/repository
root@solaris11:/opt/csw/bin# 
root@solaris11:/opt/csw/bin# chmod -R g+w /root/svn/repository/
root@solaris11:/opt/csw/bin# chown -R nobody:nobody /root/svn/repository/
root@solaris11:/opt/csw/bin# 
root@solaris11:/opt/csw/bin# ls -l /root/svn/
total 3
drwxrwxr-x   6 nobody   nobody         8  7월 22일  02:41 repository
root@solaris11:/opt/csw/bin# 
root@solaris11:/opt/csw/bin# vi /root/svn/repository/conf/svnserve.conf 
root@solaris11:/opt/csw/bin# 
root@solaris11:/opt/csw/bin# cat /root/svn/repository/conf/svnserve.conf 
### This file controls the configuration of the svnserve daemon, if you
### use it to allow access to this repository.  (If you only allow
### access through http: and/or file: URLs, then this file is
### irrelevant.)

### Visit http://subversion.apache.org/ for more information.

[general]
### The anon-access and auth-access options control access to the
### repository for unauthenticated (a.k.a. anonymous) users and
### authenticated users, respectively.
### Valid values are "write", "read", and "none".
### Setting the value to "none" prohibits both reading and writing;
### "read" allows read-only access, and "write" allows complete 
### read/write access to the repository.
### The sample settings below are the defaults and specify that anonymous
### users have read-only access to the repository, while authenticated
### users have read and write access to the repository.
anon-access = read
auth-access = write
### The password-db option controls the location of the password
### database file.  Unless you specify a path starting with a /,
### the file's location is relative to the directory containing
### this configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### Uncomment the line below to use the default password file.
password-db = passwd
### The authz-db option controls the location of the authorization
### rules for path-based access control.  Unless you specify a path
### starting with a /, the file's location is relative to the
### directory containing this file.  The specified path may be a
### repository relative URL (^/) or an absolute file:// URL to a text
### file in a Subversion repository.  If you don't specify an authz-db,
### no path-based access control is done.
### Uncomment the line below to use the default authorization file.
# authz-db = authz
### The groups-db option controls the location of the groups file.
### Unless you specify a path starting with a /, the file's location is
### relative to the directory containing this file.  The specified path
### may be a repository relative URL (^/) or an absolute file:// URL to a
### text file in a Subversion repository.
# groups-db = groups
### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they should
### have the same password database, and vice versa.  The default realm
### is repository's uuid.
# realm = My First Repository
### The force-username-case option causes svnserve to case-normalize
### usernames before comparing them against the authorization rules in the
### authz-db file configured above.  Valid values are "upper" (to upper-
### case the usernames), "lower" (to lowercase the usernames), and
### "none" (to compare usernames as-is without case conversion, which
### is the default behavior).
# force-username-case = none
### The hooks-env options specifies a path to the hook script environment 
### configuration file. This option overrides the per-repository default
### and can be used to configure the hook script environment for multiple 
### repositories in a single file, if an absolute path is specified.
### Unless you specify an absolute path, the file's location is relative
### to the directory containing this file.
# hooks-env = hooks-env

[sasl]
### This option specifies whether you want to use the Cyrus SASL
### library for authentication. Default is false.
### This section will be ignored if svnserve is not built with Cyrus
### SASL support; to check, run 'svnserve --version' and look for a line
### reading 'Cyrus SASL authentication is available.'
# use-sasl = true
### These options specify the desired strength of the security layer
### that you want SASL to provide. 0 means no encryption, 1 means
### integrity-checking only, values larger than 1 are correlated
### to the effective key length for encryption (e.g. 128 means 128-bit
### encryption). The values below are the defaults.
# min-encryption = 0
# max-encryption = 256
root@solaris11:/opt/csw/bin# 
root@solaris11:/opt/csw/bin# 
root@solaris11:/opt/csw/bin# vi /root/svn/repository/conf/passwd 
root@solaris11:/opt/csw/bin# 
root@solaris11:/opt/csw/bin# cat /root/svn/repository/conf/passwd 
### This file is an example password file for svnserve.
### Its format is similar to that of svnserve.conf. As shown in the
### example below it contains one section labelled [users].
### The name and password for each user follow, one account per line.

[users]
# harry = harryssecret
# sally = sallyssecret
1004lucifer = 123qwe
root@solaris11:/opt/csw/bin# 
root@solaris11:/opt/csw/bin# ./svnserve -d -r /root/svn/repository
root@solaris11:/opt/csw/bin# 
root@solaris11:/opt/csw/bin# ps -ef | grep svn
    root  3380     1   0 02:43:31 ?           0:00 ./svnserve -d -r /root/svn/repository
root@solaris11:/opt/csw/bin# 
root@solaris11:/opt/csw/bin# ./svn mkdir svn://localhost/repository
svn: E205007: 로그 메시지를 구하기 위해 외부 프로그램을 사용할 수 없습니다. SVN_EDITOR 환경변수를 설정하시거나 --message (-m) 또는 --file (-F) 옵션을 사용하세요
svn: E205007: 환경변수 SVN_EDITOR, VISUAL, EDITOR 중 하나는 설정하거나, 'editor-cmd' 를 구성화일에 명시해야합니다
root@solaris11:/opt/csw/bin# 
root@solaris11:/opt/csw/bin# ./svn mkdir --editor-cmd=vi svn://localhost/repository

로그 메시지가 변경되지 않았거나 지정되지 않았습니다
취소(A), 계속(C), 수정(E):
c
인증 영역(realm): <svn://localhost:3690> 1f9da62f-7f0b-4bf2-8d61-3ffd53f3f6ea
'root'의 암호:*******

인증 영역(realm): <svn://localhost:3690> 1f9da62f-7f0b-4bf2-8d61-3ffd53f3f6ea
사용자명:1004lucifer
'1004lucifer'의 암호:******


-----------------------------------------------------------------------
주의! 인증정보 영역:

   <svn://localhost:3690> 1f9da62f-7f0b-4bf2-8d61-3ffd53f3f6ea

에 대한 당신의 비밀번호는 디스크에 암호화되어 저장되지 않습니다.
가능하면, 비밀번호를 암호화하여 저장하도록 설정을 바꾸십시오.
자세한 것은 문서를 참조하세요.

이 주의 문구를 다음에 보이지 않게 하려면, 'store-plaintext-passwords'의
설정을 'yes' 혹은 'no'로 지정하면 됩니다. 설정 파일은 다음과 같습니다.
'/root/.subversion/servers'
-----------------------------------------------------------------------
비밀번호를 평문으로 저장하겠습니까 (yes/no)?yes

커밋된 리비전 1.
root@solaris11:/opt/csw/bin#




참조: http://keizwer.tistory.com/354


[VirtualBox] Solaris 11 에서 게스트 확장설치 방법



환경
OS: Ubuntu 14.04
VM: VirtualBox
VM OS: Solaris 11


공유폴더를 사용하거나 다른 여타 기능들을 사용하려면 게스트확장(guest addition)을 설치해야한다.
설치 방법은 아래와 같다.
(VBOXADDITIONS_5.0.0_101573 이라는 부분은 VirtualBox 버전에 따라 변경될 수 있다.)

*선행작업
가상머신의 '장치 => 게스트 확장 CD 이미지 삽입' 을 선택하면 이미지가 마운트 된다.


$ sudo bash
# /media/VBOXADDITIONS_5.0.0_101573/sunasroot.sh




2015년 7월 13일 월요일

[Android] LG G2 에서 발생하는 '블루투스 애플리케이션이 예상치 않게 중지되었습니다.' 오류



LG G2를 사용하며 한달 전부터 갑자기 블루투스가 종종 종료되기 시작했다.

아직까지 원인을 찾지 못했지만 OS버그 이거나 특정 Application 과의 문제로인해 발생했을 거라고 추측이 되고 있다.


Download Log : Link

adb logcat -v threadtime

07-02 17:02:07.096   994  1038 I BootReceiver: Copying /data/tombstones/tombstone_08 to DropBox (SYSTEM_TOMBSTONE)
07-02 17:02:07.126   994  1004 I ActivityManager: Process com.android.bluetooth (pid 24000) has died.
07-02 17:02:07.126   994  1004 W ActivityManager: Service crashed 2 times, stopping: ServiceRecord{4576f078 u0 com.android.bluetooth/com.lge.bluetooth.app.LGBluetoothAPIServer}
07-02 17:02:07.126   994  1004 W ActivityManager: Scheduling restart of crashed service com.android.bluetooth/com.broadcom.bt.service.hfp.BrcmHeadsetService in 1000ms
07-02 17:02:07.126   994  1004 W ActivityManager: Scheduling restart of crashed service com.android.bluetooth/.a2dp.A2dpService in 1000ms
07-02 17:02:07.126   994  1004 W ActivityManager: Scheduling restart of crashed service com.android.bluetooth/.hid.HidService in 1000ms
07-02 17:02:07.126   994  1004 W ActivityManager: Scheduling restart of crashed service com.android.bluetooth/.hdp.HealthService in 1000ms
07-02 17:02:07.126   994  1004 W ActivityManager: Scheduling restart of crashed service com.android.bluetooth/.pan.PanService in 1000ms
07-02 17:02:07.126   994  1004 W ActivityManager: Service crashed 2 times, stopping: ServiceRecord{4492f338 u0 com.android.bluetooth/com.lge.bluetooth.app.LGBluetoothUserBindServer}
07-02 17:02:07.126   994  1004 W ActivityManager: Service crashed 2 times, stopping: ServiceRecord{448d9d38 u0 com.android.bluetooth/.btservice.AdapterService}
07-02 17:02:07.126   994  1004 W ActivityManager: Service crashed 2 times, stopping: ServiceRecord{44441378 u0 com.android.bluetooth/.gatt.GattService}
07-02 17:02:07.126   994  1004 W ActivityManager: Scheduling restart of crashed service com.android.bluetooth/.map.BluetoothMapService in 1000ms
07-02 17:02:07.126   994  1004 W ActivityManager: Scheduling restart of crashed service com.android.bluetooth/com.broadcom.bt.service.ftp.FTPService in 1000ms
07-02 17:02:07.126   994  1004 W ActivityManager: Scheduling restart of crashed service com.android.bluetooth/.pbap.BluetoothPbapService in 1000ms
07-02 17:02:07.126   994  1004 W ActivityManager: Scheduling restart of crashed service com.android.bluetooth/.opp.BluetoothOppService in 1000ms
07-02 17:02:07.126   994  1004 I ActivityManager: resumeTopActivitiesLocked(): target Stack:ActivityStack{44358520 stackId=4, 18 tasks}
07-02 17:02:07.126   994  1004 D ActivityManager: resumeTopActivityLocked: Top activity resumed ActivityRecord{43a58808 u0 com.kakao.talk/.activity.chat.ChatRoomActivity t264}



adb logcat -v threadtime -b events

07-02 17:02:07.096   994 25352 I am_crash: [994,0,com.android.bluetooth,13155909,Native crash,Segmentation fault,unknown,0]
07-02 17:02:07.126   994  1004 I am_proc_died: [0,24000,com.android.bluetooth]
07-02 17:02:07.126   994  1004 I am_service_crashed_too_much: [0,2,com.android.bluetooth/com.lge.bluetooth.app.LGBluetoothAPIServer,24000]
07-02 17:02:07.126   994  1004 I am_destroy_service: [0,1165422712,-1]
07-02 17:02:07.126   994  1004 I am_schedule_service_restart: [0,com.android.bluetooth/com.broadcom.bt.service.hfp.BrcmHeadsetService,1000]
07-02 17:02:07.126   994  1004 I am_destroy_service: [0,1165219088,-1]
07-02 17:02:07.126   994  1004 I am_schedule_service_restart: [0,com.android.bluetooth/.a2dp.A2dpService,1000]
07-02 17:02:07.126   994  1004 I am_destroy_service: [0,1164713616,-1]
07-02 17:02:07.126   994  1004 I am_schedule_service_restart: [0,com.android.bluetooth/.hid.HidService,1000]
07-02 17:02:07.126   994  1004 I am_destroy_service: [0,1161886304,-1]
07-02 17:02:07.126   994  1004 I am_schedule_service_restart: [0,com.android.bluetooth/.hdp.HealthService,1000]
07-02 17:02:07.126   994  1004 I am_destroy_service: [0,1161883304,-1]
07-02 17:02:07.126   994  1004 I am_schedule_service_restart: [0,com.android.bluetooth/.pan.PanService,1000]
07-02 17:02:07.126   994  1004 I am_destroy_service: [0,1158640584,-1]
07-02 17:02:07.126   994  1004 I am_service_crashed_too_much: [0,2,com.android.bluetooth/com.lge.bluetooth.app.LGBluetoothUserBindServer,24000]
07-02 17:02:07.126   994  1004 I am_destroy_service: [0,1150481208,-1]
07-02 17:02:07.126   994  1004 I am_service_crashed_too_much: [0,2,com.android.bluetooth/.btservice.AdapterService,24000]
07-02 17:02:07.126   994  1004 I am_destroy_service: [0,1150131512,-1]
07-02 17:02:07.126   994  1004 I am_service_crashed_too_much: [0,2,com.android.bluetooth/.gatt.GattService,24000]
07-02 17:02:07.126   994  1004 I am_destroy_service: [0,1145312120,-1]
07-02 17:02:07.126   994  1004 I am_schedule_service_restart: [0,com.android.bluetooth/.map.BluetoothMapService,1000]
07-02 17:02:07.126   994  1004 I am_destroy_service: [0,1144351760,-1]
07-02 17:02:07.126   994  1004 I am_schedule_service_restart: [0,com.android.bluetooth/com.broadcom.bt.service.ftp.FTPService,1000]
07-02 17:02:07.126   994  1004 I am_destroy_service: [0,1144285720,-1]
07-02 17:02:07.126   994  1004 I am_schedule_service_restart: [0,com.android.bluetooth/.pbap.BluetoothPbapService,1000]
07-02 17:02:07.126   994  1004 I am_destroy_service: [0,1142747352,-1]
07-02 17:02:07.126   994  1004 I am_schedule_service_restart: [0,com.android.bluetooth/.opp.BluetoothOppService,1000]
07-02 17:02:07.126   994  1004 I am_destroy_service: [0,1140593600,-1]
07-02 17:02:07.176   994  1191 I am_create_service: [0,1158430888,.DockService,1000,4175]
07-02 17:02:07.196   994  1521 I am_proc_start: [0,25362,1002,com.android.bluetooth,broadcast,com.android.bluetooth/.pbap.BluetoothPbapReceiver]
07-02 17:02:07.196   994  1005 I am_destroy_service: [0,1158430888,4175]
07-02 17:02:07.206   994  1520 I am_proc_bound: [0,25362,com.android.bluetooth]
07-02 17:02:07.276   994  2025 I am_create_service: [0,1158283600,.BluetoothPbapService,1002,25362]





https://medium.com/@md_ray/how-to-solve-android-s-bluetooth-has-stopped-error-on-lg-g2-root-access-e7371a8f14ba

위의 링크를 보면 뭔가 블루투스의 설정을 변경하는 것 같은데..
난 아직 Rooting 을 하지 않아서 작업을 할 수 없다.

좀더 지켜보고 문제가 지속된다면 Android 초기화를 할 예정...



======================================
2015.08.15 추가

오류가 잦은탓에 한동안 블루투스를 사용하고 있지 않다가 혹시나 싶어 오늘 사용해봤다.
그동안 애플리케이션을 주기적으로 업데이트를 해서 일까??
몇시간을 들었지만 아직 에러가 발생하지 않았다.

다만 밖에 1시간정도 운동하러 나갔을 때 블루투스를 사용하지 않았음에도
'블루투스 애플리케이션이 예상치 않게 중지되었습니다.' 메시지가 발생을 했다.
GPS를 사용하는 다른 어플리케이션과의 문제가 있었을까??

암튼 이제부터 블루투스를 다시 사용을 해보고 문제가 있는지 다시 봐야겠다.


======================================
2015.08.17 추가

이틀정도 길거리를 다니며 블루투스로 음악을 들어봤는데
이전과 같은 증상이 발생을 했다.

아무래도 초기화 밖에 답이 없는건가..;;




2015년 7월 6일 월요일

[App Engine] 프로젝트 생성 시 "Bad Request" 발생하며 생성이 안되는 문제




Google App Engine 을 처음시작하여 프로젝트를 생성하려 하는데
"문제가 발생했습니다. 프로젝트를 생성할 수 없습니다. 나중에 다시 시도해 주세요."
라는 문자열과 같이 "Bad Request" 라는 원인과 함께 프로젝트 생성이 되지 않았다.







원인
프로젝트명 첫글자를 숫자로 기입한게 문제가 된 것이다.





2015년 7월 5일 일요일

[Android] BroadcastReceiver 의 am_broadcast_discard_app 이슈



Android App에서 종종 ANR이 발생되어 원인분석을 했다.


증상
Receiver 에서 Broadcast 를 수신받지 못한 후 ANR 발생



adb logcat -v threadtime -b events

06-17 12:07:05.067  3800  3826 I am_broadcast_discard_app: [0,536238391,android.intent.action.PACKAGE_ADDED,7,ResolveInfo {45fc40d com.???.???/.packages.PackageReceiver m=0x208000}]
06-17 12:07:05.127  3800  3826 I am_proc_start: [0,28839,1000,com.!!!.!!!,broadcast,com.!!!.!!!/.receiver.AppInstallReceiver]
06-17 12:07:05.167  3800  3826 I am_anr  : [0,0,com.???.???,8961605,Broadcast of Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.@@@.@@@ flg=0x4000010 (has extras) }]






/data/anr/traces.txt (ANR 이 발생되면 디바이스에 해당 파일이 생성된다.)

...

"ActivityManager" prio=5 tid=17 TimedWaiting
  | group="main" sCount=1 dsCount=0 obj=0x131c3ba0 self=0x7fa70ba800
  | sysTid=3826 nice=-2 cgrp=default sched=0/0 handle=0x7f9b52f900
  | state=S schedstat=( 0 0 0 ) utm=779 stm=841 core=3 HZ=100
  | stack=0x7f906e8000-0x7f906ea000 stackSize=1036KB
  | held mutexes=
  at java.lang.Object.wait!(Native method)
  - waiting on <0x0d0c5110> (a com.android.server.am.ActivityManagerService$6)
  at java.lang.Object.wait(Object.java:422)
  at com.android.server.am.ActivityManagerService.dumpStackTraces(ActivityManagerService.java:7145)
  - locked <0x0d0c5110> (a com.android.server.am.ActivityManagerService$6)
  at com.android.server.am.ActivityManagerService.dumpStackTraces(ActivityManagerService.java:7122)
  at com.android.server.am.ActivityManagerService.appNotResponding(ActivityManagerService.java:7373)
  at com.android.server.am.BroadcastQueue$AppNotResponding.run(BroadcastQueue.java:217)
  at android.os.Handler.handleCallback(Handler.java:739)
  at android.os.Handler.dispatchMessage(Handler.java:95)
  at android.os.Looper.loop(Looper.java:145)
  at android.os.HandlerThread.run(HandlerThread.java:61)
  at com.android.server.ServiceThread.run(ServiceThread.java:46)

...





https://android.googlesource.com/platform/frameworks/base/+/483f3b06ea84440a082e21b68ec2c2e54046f5a6/services/java/com/android/server/am/BroadcastQueue.java

final void broadcastTimeoutLocked(boolean fromMsg) {
    if (fromMsg) {
        mPendingBroadcastTimeoutMessage = false;
    }
    if (mOrderedBroadcasts.size() == 0) {
        return;
    }
    long now = SystemClock.uptimeMillis();
    BroadcastRecord r = mOrderedBroadcasts.get(0);
    if (fromMsg) {
        if (mService.mDidDexOpt) {
            // Delay timeouts until dexopt finishes.
            mService.mDidDexOpt = false;
            long timeoutTime = SystemClock.uptimeMillis() + mTimeoutPeriod;
            setBroadcastTimeoutLocked(timeoutTime);
            return;
        }
        if (!mService.mProcessesReady) {
            // Only process broadcast timeouts if the system is ready. That way
            // PRE_BOOT_COMPLETED broadcasts can't timeout as they are intended
            // to do heavy lifting for system up.
            return;
        }
        long timeoutTime = r.receiverTime + mTimeoutPeriod;
        if (timeoutTime > now) {
            // We can observe premature timeouts because we do not cancel and reset the
            // broadcast timeout message after each receiver finishes.  Instead, we set up
            // an initial timeout then kick it down the road a little further as needed
            // when it expires.
            if (DEBUG_BROADCAST) Slog.v(TAG,
                    "Premature timeout ["
                    + mQueueName + "] @ " + now + ": resetting BROADCAST_TIMEOUT_MSG for "
                    + timeoutTime);
            setBroadcastTimeoutLocked(timeoutTime);
            return;
        }
    }
    Slog.w(TAG, "Timeout of broadcast " + r + " - receiver=" + r.receiver
            + ", started " + (now - r.receiverTime) + "ms ago");
    r.receiverTime = now;
    r.anrCount++;
    // Current receiver has passed its expiration date.
    if (r.nextReceiver <= 0) {
        Slog.w(TAG, "Timeout on receiver with nextReceiver <= 0");
        return;
    }
    ProcessRecord app = null;
    String anrMessage = null;
    Object curReceiver = r.receivers.get(r.nextReceiver-1);
    Slog.w(TAG, "Receiver during timeout: " + curReceiver);
    logBroadcastReceiverDiscardLocked(r);
    if (curReceiver instanceof BroadcastFilter) {
        BroadcastFilter bf = (BroadcastFilter)curReceiver;
        if (bf.receiverList.pid != 0
                && bf.receiverList.pid != ActivityManagerService.MY_PID) {
            synchronized (mService.mPidsSelfLocked) {
                app = mService.mPidsSelfLocked.get(
                        bf.receiverList.pid);
            }
        }
    } else {
        app = r.curApp;
    }
    if (app != null) {
        anrMessage = "Broadcast of " + r.intent.toString();
    }
    if (mPendingBroadcast == r) {
        mPendingBroadcast = null;
    }
    // Move on to the next receiver.
    finishReceiverLocked(r, r.resultCode, r.resultData,
            r.resultExtras, r.resultAbort, true);
    scheduleBroadcastsLocked();
    if (anrMessage != null) {
        // Post the ANR to the handler since we do not want to process ANRs while
        // potentially holding our lock.
        mHandler.post(new AppNotResponding(app, anrMessage));
    }
}



am_broadcast_discard_app 이라는 로그는 Broadcast를 정상적으로 수신 할 수 없는 경우에 발생이 된다고 한다. (본문 하단의 추가내용 확인)
(http://stackoverflow.com/questions/28675002/broadcast-receiver-being-discarded)



traces.txt 파일을 통해 ANR 원인에 대한 스택을 보면 BroadcastQueue$AppNotResponding Class 에서 ANR 관련 tracesFile 을 생성한다.
최초 BroadcastQueue Class의 broadcastTimeoutLocked Method 에서 AppNotResponding 을 수행시키는데 Broadcast 가 발생했음에도 시간내에 처리되지 않으면 ANR을 발생시키는 것으로 보인다.




위의 이슈로 인해 제조사에 문의를 했다.
제조사에서 온 답변은 다음과 같다.
(메일의 내용을 그대로 담을 수 없어 내용을 조금 수정했다.)

======================================
해당 App에서 App 다운로드시 백그라운드에서 다른 이름의 여러 패키지들이 연속적으로 다운로드 되어지면서, android.intent.action.PACKAGE_ADDED 가 너무 많이 전달됨에 따라 Broadcast처리에 로드가 걸려 안드로이드에서 발생시킨 ANR로 보입니다.

최근 프레임워크에서 관련하여 PACKAGE _ADDED Broadcast가 무분별하게 전달되지 않도록 하는 수정이 있었습니다. 이 수정이 반영된 이후의 바이너리에선 아직 재현된 이슈가 없습니다.
======================================






=============================
2015.07.12 내용 추가

2주 뒤에 위와 같은 이슈가 발생이 되어 android.intent.action.PACKAGE_ADDED 가 짧은 시간에 많이 발생이 되는경우 ANR이 발생되는 증상이 발생 되었다.

onReceive 메소드 내부의 로직을 확인결과 시간이 오래 걸릴 수 있는 로직이 발견되었다.
짧은 시간에 broadcast가 많이 발생 시 문제가 될 수 있기에 Thread 처리를 하여 수정을 했다.

이후 해당 문제로 ANR 발생되는 일이 아직 발생하지 않았다.