가족용으로 OpenClaw를 여러 프로필로 운영할 때, Linux 감각(systemd)으로 접근하면 macOS에서는 한 번씩 막힙니다.

 

핵심은 간단합니다:

포트 변경은 config만 바꾸고 끝내지 말고, launchd 서비스 정의까지 재반영해야 한다.

───

왜 헷갈릴까? (macOS vs Linux)

• Linux: 보통 systemd unit + env 반영 흐름이 익숙함
• macOS: launchd + LaunchAgents + 서비스 env 파일 구조
• 그래서 gateway.port를 바꿨는데도 이전 포트로 뜨는 현상이 생길 수 있음

원인 대부분은:

  1. 서비스 정의(plist) 재반영이 안 됐거나
  2. 기존 env/agent 캐시가 남아 있는 경우

───

권장 절차 (프로필별 포트 변경)

아래 순서가 안전합니다.

# 1) 최초 1회: 프로필 설정
openclaw --profile <myprofile> configure

# 2) 포트 변경
openclaw --profile <myprofile> config set gateway.port <myport> --strict-json

# 3) launchd 서비스 정의 재반영
openclaw --profile <myprofile> gateway install

# 4) 시작
openclaw --profile <myprofile> gateway start

# 5) 상세 상태 확인
openclaw --profile <myprofile> gateway status --deep

# 6) 실제 리슨 포트 확인
lsof -nP -iTCP:<myport> -sTCP:LISTEN

자주 나는 오타

• —profile(긴 대시) ❌ → --profile ✅
• -iTCCP ❌ → -iTCP ✅

───

안 될 때: 클린 재기동 루틴

포트가 계속 예전 값으로 잡히면 아래로 초기화 후 다시 올립니다.

openclaw --profile <myprofile> gateway stop
launchctl bootout gui/$UID/ai.openclaw.<myprofile> 2>/dev/null || true

rm -f ~/Library/LaunchAgents/ai.openclaw.<myprofile>.plist
rm -f ~/.openclaw-<myprofile>/service-env/ai.openclaw.<myprofile>.env

openclaw --profile <myprofile> gateway install
openclaw --profile <myprofile> gateway start
openclaw --profile <myprofile> gateway status --deep
lsof -nP -iTCP:<myport> -sTCP:LISTEN

───

가족용 다중 프로필 운영 템플릿

예시(충돌 피하기 쉬운 방식):

프로필 용도 권장 포트
seungbeom 메인 운영 3444
heekyung 가족 계정 1 3445
family-bot 자동화/실험 3446

포트 할당 규칙 추천

• 3400~3499 같은 전용 대역을 정해서 사용
• 프로필 추가 시 +1 증가
• 문서에 즉시 기록(누가 어떤 포트인지)

───

점검 체크리스트

• [ ] 프로필마다 gateway.port 중복 없음
• [ ] gateway status --deep 포트 = lsof 리슨 포트
• [ ] 재부팅 후에도 동일 포트로 자동 기동
• [ ] 새 프로필 추가 시 같은 절차 재사용 가능

───

한 줄 결론

Mac mini에서 OpenClaw 포트 문제는 대부분
“config 변경 + gateway install로 launchd 재반영”을 지키면 해결됩니다.

+ Recent posts