↑ 여기 회색 막대를 움직여서 전체 목록을 확인할 수 있어요.
Posted by on the 29th of March, 2022 at 11:42 am under 컴퓨터.  Post is not tagged.  This post has no comments.

회사에서 쓰는 가상 컴퓨터에서 snap이 동작을 안해 찾아본 기록.

동작하지 않는 이유

snap으로 설치한 앱을 실행해보면 이런 메시지가 뜨면서 되지 않는다.

Sorry, home directories outside of /home are not currently supported.
See https://forum.snapcraft.io/t/11209 for details.

snap 소스를 찾아보니 setup_user_data 함수에서 에러를 출력하는데 SNAP_USER_DATA 환경변수가 문제였다.
https://github.com/snapcore/snapd/blob/master/cmd/snap-confine/user-support.c#L27

SNAP_USER_DATA 환경병수는 userEnv 함수에서 설정하는데 이때 golang에서 제공하는 user.Current를 통해 정보를 얻어온다.
https://github.com/snapcore/snapd/blob/master/snap/snapenv/snapenv.go#L104

그리고 golang은 /etc/passwd 파일에서 직접 사용자 정보를 읽어온다.
https://github.com/golang/go/blob/master/src/os/user/lookup_unix.go#L19

해결 방법

1. local 사용자 추가

home directory가 /home 에 있는 local 사용자를 추가한다. 그리고 local 사용자로 전환해서 실행

(outside /home user)@localhost $ xhost +localhost
(outside /home user)@localhost $ sudo su – local_user
local_user$localhost $ (run snap application)

xhost를 실행해야 X Window 앱이 화면에 나온다.

2. snap 소스 코드 수정 (안해봤음)

현재 사용자용 디렉토리를 /home 에 하나 만든다. 그리고 snap 소스코드를 고쳐서 SNAP_USER_DATA 환경변수 설정할 때 prefix를 /home 쪽으로 바꿔치기 한다.

3. golang 소스 코드 수정 (안해봤음)

현재 사용자 home directory를 /etc/passwd 파일에서 얻어오는데 특정 환경변수로 override 할 수 있게 한다.

4. snap에서 공식적으로 알려주는 workaround (안해봤음)

https://snapcraft.io/docs/home-outside-home

그런데 회사 가상 컴퓨터에서 했다가 문제 생길까봐 안해봤음

5. docker를 이용한 방법 (안해봤음)

https://askubuntu.com/questions/1207472/how-do-you-actually-run-a-snap-package-when-your-home-directory-isnt-under-h

회사 가상 컴퓨터에 docker를 안깔아서 안해봤음

Posted by on the 31st of January, 2022 at 11:50 am under 컴퓨터.  Post is not tagged.  This post has no comments.

DS-216+II 에서 아직 DSM6을 쓰고 있다. 가장 큰 이유는 Serviio와 Syncthing이 DSM7을 지원하지 않기 때문이다. 이 중 Serviio는 Synology package 대신 Docker를 이용하는 방식으로 바꿨다. Syncthing도 Docker로 옮겨야지 생각했는데 설정을 어떻게 옮길지 몰라 망설이고 있었다.

그런데 지금 쓰는 Syncthing은 Synology community에서 제공하는 것으로 이미 DSM7을 지원하고 있었다. (https://github.com/SynoCommunity/spksrc/issues/4524) 이 패키지를 계속 쓸까 했지만 Docker를 써보니 OS 버전과 무관하게 쓸 수 있는 점이 더 나아 보여서 Docker로 옮기기로 했다.

옮기기 위해 확인했던 것

  • Syncthing 설정파일 위치
    • /volume1/@appstore/syncthing/var
    • user: sc-syncthing, group: syncthing
  • Docker의 syncthing 설정파일 위치
    • /volume1/docker/syncthing/config
    • user: 1000, group: 1000

옮기는 과정 정리

  1. Syncthing에서 모든 동기화 설정 Pause
  2. ssh로 접속해서 /volume1/@appstore/syncthing 디렉토리 백업
  3. 패키지 센터에서 Syncthing 제거
  4. 사용자 syncthing, 그룹 syncthing 추가
  5. Docker에 syncthing 추가
    • UID, GID는 각각 사용자 syncthing, 그룹 syncthing으로 지정
    • 호스트 네트워크 사용
    • docker/syncthing -> /var/syncthing 으로 마운트
    • 동기화 볼륨 마운트
  6. docker/syncthing 디렉토리에 백업했던 내용 복사
  7. 파일 소유권 변경
  8. Syncthing docker 시작
  9. 동기화 확인

 

Posted by on the 17th of October, 2021 at 12:30 pm under 사는이야기.  Post is not tagged.  This post has no comments.

요금 그래픽카드 팬 소리가 좀 커진거 같아 오랜만에 컴퓨터 청소를 했다. 하는김에 CPU 쿨러도 같이 했다. 전에는 그냥 눈에 보이는 부분만 닦고 말았는데 이번에는 완전히 분해 했다.

청소 전 사진은 없고, 청소 후 그래픽 카드.

(read more)

Posted by on the 30th of July, 2021 at 4:59 pm under 사는이야기.  Post is not tagged.  This post has no comments.

한줄 요약: wp-config.php 에 아래 설정 추가

define( 'CONCATENATE_SCRIPTS', false );

블로그 그냥 방치하고 있는데 WordPress 5.8업데이트가 나왔다. 그래서 또 간만에 업데이트를 했다. 다 하고 나서 에디터에서 Permanlink 수정하려는데 보니 javascript 가 달라졌다. 그래서 일단 어떻게 되나 테스트를 하려고 보니… 관리자 페이지에서 글쓰기 할 때 css 적용이 안되어서 이상하게 나왔다.

(read more)
Posted by on the 29th of June, 2021 at 1:13 am under 컴퓨터.  Post is not tagged.  This post has no comments.

2016년에 산 노트북 SSD를 약 4개월에 걸쳐 교체했다. 글 시작하기 전에 3줄 요약

  1. 삼섬 노트북 9 NT900X5L-K59는 NVME 방식 M.2 SSD 사용 가능함
  2. M.2 slot이 1개 밖에 없기 때문에 사용하던 SSD를 복사하려면 USB-NVME M.2 컨버터가 필요함
  3. SSD 복사는 Samsung Recovery로 가능
(read more)