Skip to content

Commit c11742f

Browse files
committed
update start-server.sh
1 parent 6a3e808 commit c11742f

3 files changed

Lines changed: 4 additions & 29 deletions

File tree

.github/workflows/verify-package.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,3 @@ jobs:
7979
ls -lh dist/*.tar.gz dist/*.zip
8080
test -f dist/function-stream-*.tar.gz
8181
test -f dist/function-stream-*-lite.tar.gz
82-
83-
- name: Upload Packages
84-
uses: actions/upload-artifact@v4
85-
if: success()
86-
with:
87-
name: dist-packages
88-
path: dist/*.tar.gz
89-
retention-days: 1

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,8 @@ We provide a robust shell script to manage the server process, capable of handli
119119

120120
| Option | Description |
121121
|---------------------|-----------------------------------------------------------------------------|
122-
| `-d`, `--daemon` | Run the server in the background (Daemon mode). Writes PID to `function-stream.pid`. |
122+
| `-d`, `--daemon` | Run the server in the background (Daemon mode). |
123123
| `-c`, `--config <path>` | Specify a custom configuration file path. |
124-
| `-p`, `--pidfile <path>` | Specify a custom location for the PID file. |
125124
| `-D <KEY>=<VALUE>` | Inject environment variables (e.g., `-D RUST_LOG=debug`). |
126125

127126
**Examples:**
@@ -132,16 +131,16 @@ We provide a robust shell script to manage the server process, capable of handli
132131
./bin/start-server.sh
133132
```
134133

135-
2. **Daemon Mode (Production)** — Runs the server in the background, redirects stdout/stderr to `logs/`, and manages the PID file.
134+
2. **Daemon Mode (Production)** — Runs the server in the background, redirects stdout/stderr to `logs/`.
136135

137136
```bash
138137
./bin/start-server.sh -d
139138
```
140139

141-
3. **Custom Configuration** — Start with a specific config file and write the PID to a specific location.
140+
3. **Custom Configuration** — Start with a specific config file.
142141

143142
```bash
144-
./bin/start-server.sh -d -c /etc/function-stream/prod.yaml -p /var/run/fs.pid
143+
./bin/start-server.sh -d -c /etc/function-stream/prod.yaml
145144
```
146145

147146
4. **Environment Variable Injection** — Inject environment variables without modifying the script or system env.

bin/start-server.sh

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ export FUNCTION_STREAM_HOME="$APP_HOME"
7272
export FUNCTION_STREAM_CONF="${FUNCTION_STREAM_CONF:-$APP_HOME/conf/config.yaml}"
7373
export FUNCTION_STREAM_LOG_DIR="${FUNCTION_STREAM_LOG_DIR:-$APP_HOME/logs}"
7474

75-
PID_FILE="$APP_HOME/function-stream.pid"
7675
BINARY="$BIN_DIR/function-stream"
7776
FOREGROUND="true"
7877
APP_ARGS=""
@@ -88,10 +87,6 @@ while [ $# -gt 0 ]; do
8887
export FUNCTION_STREAM_CONF="$2"
8988
shift 2
9089
;;
91-
-p|--pidfile)
92-
PID_FILE="$2"
93-
shift 2
94-
;;
9590
-d|--daemon)
9691
FOREGROUND="false"
9792
shift
@@ -116,15 +111,6 @@ mkdir -p "$FUNCTION_STREAM_LOG_DIR"
116111

117112
check_port_usage "$FUNCTION_STREAM_CONF" || exit 1
118113

119-
if [ "$FOREGROUND" = "false" ] && [ -f "$PID_FILE" ]; then
120-
if kill -0 "$(cat "$PID_FILE")" 2>/dev/null; then
121-
echo "[ERROR] Already running (PID: $(cat "$PID_FILE"))"
122-
exit 1
123-
else
124-
rm -f "$PID_FILE"
125-
fi
126-
fi
127-
128114
echo "------------------------------------------------"
129115
echo "Starting Function Stream"
130116
echo "Home: $FUNCTION_STREAM_HOME"
@@ -141,8 +127,6 @@ else
141127
nohup "$BINARY" --config "$FUNCTION_STREAM_CONF" $APP_ARGS > "$LOG_OUT" 2> "$LOG_ERR" &
142128
PID=$!
143129

144-
echo "$PID" > "$PID_FILE"
145-
146130
sleep 1
147131
if kill -0 "$PID" >/dev/null 2>&1; then
148132
echo "[SUCCESS] Started. PID: $PID"

0 commit comments

Comments
 (0)