> For the complete documentation index, see [llms.txt](https://docs.tibero.com/tmaxopensql/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tibero.com/tmaxopensql/administration/openproxy/undefined.md).

# 사용법

## 시작

`OpenSQL-Installer` 를 통해 설치한 경우 `OpenProxy`는 아래 명령어로 기동된 상태입니다.

```bash
bash $OPENSQL_HOME/scripts/start_openproxy.sh
```

* `$OPENSQL_HOME/etc/openproxy.toml` 설정 파일을 로드하여 백그라운드(`nohup`)로 프로세스를 실행합니다.
* 프로세스 기동 확인 후 PID를 `$OPENSQL_HOME/etc/openproxy.pid`에 저장합니다.
* 기동 대기 시간은 최대 10초이며, 이 안에 프로세스가 확인되지 않으면 오류와 함께 로그 마지막 20줄을 출력합니다.
* 로그 레벨은 `LOG_LEVEL` 환경변수로 지정하며, 기본값은 `info`입니다.

```
Starting OpenProxy with config: /opt/opensql/etc/openproxy.toml
OpenProxy started with PID 18472
```

## 종료

```bash
bash $OPENSQL_HOME/scripts/stop_openproxy.sh
```

* `$OPENSQL_HOME/etc/openproxy.pid`에서 PID를 읽어 `SIGTERM` 신호를 보냅니다.
* 프로세스가 완전히 종료될 때까지 대기한 후 PID 파일을 삭제합니다.
* PID 파일이 없거나 해당 PID의 프로세스가 실행 중이지 않으면 오류 메시지를 출력합니다.

```
Stopping OpenProxy (PID: 18472)
OpenProxy stopped
```

## 재시작

OpenProxy 프로세스를 재시작합니다.

```bash
bash $OPENSQL_HOME/scripts/restart_openproxy.sh
```

* `stop_openproxy.sh` → `start_openproxy.sh` 순서로 실행합니다.
* 프로세스가 실행 중이지 않아도 stop 단계의 오류를 무시하고 start를 진행합니다.

```
Restarting OpenProxy...
Stopping OpenProxy (PID: 18472)
OpenProxy stopped.
Starting OpenProxy with config: /opt/opensql/etc/openproxy.toml
OpenProxy started with PID 18531
```

## 리로딩

```bash
bash $OPENSQL_HOME/scripts/reload_openproxy.sh
```

* 실행 중인 OpenProxy 프로세스에 `SIGHUP` 신호를 보내 **프로세스를 재시작하지 않고** 설정 파일을 재로드합니다.
* `openproxy.toml` 수정 후 서비스 중단 없이 설정을 반영할 때 사용합니다.
* PID 파일이 없거나 프로세스가 실행 중이지 않으면 오류를 반환합니다.

```
Reloading OpenProxy configuration (PID: 18531)...
OpenProxy configuration reloaded successfully.
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.tibero.com/tmaxopensql/administration/openproxy/undefined.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
